summaryrefslogtreecommitdiff
path: root/tex/context/base/typo-dig.mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-01-18 22:43:00 +0100
committerHans Hagen <pragma@wxs.nl>2010-01-18 22:43:00 +0100
commite1cd565bd3872eb5665b95a0ca93e9ba6982c929 (patch)
tree645d840cbec918941bfffdeacb38de331110a72e /tex/context/base/typo-dig.mkiv
parent4e362156550b2624811c01de388d3d695f444d77 (diff)
downloadcontext-e1cd565bd3872eb5665b95a0ca93e9ba6982c929.tar.gz
beta 2010.01.18 22:43
Diffstat (limited to 'tex/context/base/typo-dig.mkiv')
-rw-r--r--tex/context/base/typo-dig.mkiv50
1 files changed, 50 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..59de87cd3
--- /dev/null
+++ b/tex/context/base/typo-dig.mkiv
@@ -0,0 +1,50 @@
+%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]}{}}
+
+\protect \endinput