diff options
Diffstat (limited to 'tex/context/base/typo-dig.mkiv')
-rw-r--r-- | tex/context/base/typo-dig.mkiv | 51 |
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 |