summaryrefslogtreecommitdiff
path: root/tex/context/base/typo-dig.mkiv
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2010-07-04 15:32:09 +0300
committerMarius <mariausol@gmail.com>2010-07-04 15:32:09 +0300
commit85b7bc695629926641c7cb752fd478adfdf374f3 (patch)
tree80293f5aaa7b95a500a78392c39688d8ee7a32fc /tex/context/base/typo-dig.mkiv
downloadcontext-85b7bc695629926641c7cb752fd478adfdf374f3.tar.gz
stable 2010-05-24 13:10
Diffstat (limited to 'tex/context/base/typo-dig.mkiv')
-rw-r--r--tex/context/base/typo-dig.mkiv51
1 files changed, 51 insertions, 0 deletions
diff --git a/tex/context/base/typo-dig.mkiv b/tex/context/base/typo-dig.mkiv
new file mode 100644
index 000000000..d8f731418
--- /dev/null
+++ b/tex/context/base/typo-dig.mkiv
@@ -0,0 +1,51 @@
+%D \module
+%D [ file=typo-dig,
+%D version=2010.01.18,
+%D title=\CONTEXT\ Typesetting Macros,
+%D subtitle=Digits,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=\PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Typesetting Macros / Digits}
+
+\unprotect
+
+\registerctxluafile{typo-dig}{1.001}
+
+\definesystemattribute[digits] \chardef\digitsattribute \dogetattributeid{digits}
+
+%D This could as well be a dynamic font feature but why bother.
+%D
+%D \macros
+%D {\equaldigits}
+%D
+%D \starttyping
+%D test test \ruledhbox{123} test test\par
+%D test test \ruledhbox{\equaldigits{123}} test test\par
+%D test test \equaldigits{123} test test\par
+%D \stoptyping
+%D
+%D \typebuffer
+%D
+%D This calls result in:
+%D
+%D \startvoorbeeld
+%D \startlines
+%D \getbuffer
+%D \stoplines
+%D \stopvoorbeeld
+
+\unexpanded\def\setdigitsmanipulation
+ {\ctxlua{digits.enable()}%
+ \gdef\setdigitsmanipulation[##1]{\attribute\digitsattribute##1\relax}%
+ \setdigitsmanipulation}
+
+\unexpanded\def\equaldigits{\groupedcommand{\setdigitsmanipulation[\plusone]}{}}
+\unexpanded\def\dummydigit {\hphantom{\setdigitsmanipulation[\plusone]0}}
+
+\protect \endinput