From 85b7bc695629926641c7cb752fd478adfdf374f3 Mon Sep 17 00:00:00 2001 From: Marius Date: Sun, 4 Jul 2010 15:32:09 +0300 Subject: stable 2010-05-24 13:10 --- tex/context/base/typo-dig.mkiv | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 tex/context/base/typo-dig.mkiv (limited to 'tex/context/base/typo-dig.mkiv') 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 -- cgit v1.2.3