typo-dig.mkiv /size: 1437 b    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=typo-dig,
3
%D version=2010.01.18,
4
%D title=\CONTEXT\ Typesetting Macros,
5
%D subtitle=Digits,
6
%D author=Hans Hagen,
7
%D date=\currentdate,
8
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9
%C
10
%C This module is part of the \CONTEXT\ macro||package and is
11
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12
%C details.
13 14
\writestatus
{
loading
}{
ConTeXt
Typesetting
Macros
/
Digits
}
15 16
\unprotect
17 18
\registerctxluafile
{
typo
-
dig
}{}
19 20
\definesystemattribute
[
digits
][
public
]
21 22
%D This could as well be a dynamic font feature but why bother.
23
%D
24
%D \macros
25
%D {\equaldigits}
26
%D
27
%D \startbuffer
28
%D test test \ruledhbox{123} test test\par
29
%D test test \ruledhbox{\equaldigits{123}} test test\par
30
%D test test \equaldigits{123} test test\par
31
%D \stopbuffer
32
%D
33
%D \typebuffer
34
%D
35
%D This calls result in:
36
%D
37
%D \startlines
38
%D \getbuffer
39
%D \stoplines
40 41
\unexpanded
\def
\setdigitsmanipulation
[#
1
]
%
42
{
\clf_setdigitsmanipulation
{
#
1
}}
43 44
\unexpanded
\def
\resetdigitsmanipulation
45
{
\c_attr_digits
\attributeunsetvalue
}
46 47
\appendtoks
48
\resetdigitsmanipulation
49
\to
\everyresettypesetting
50 51
\unexpanded
\def
\equaldigits
{
\groupedcommand
{
\setdigitsmanipulation
[
\number
\plusone
]
}{}}
52
\unexpanded
\def
\dummydigit
{
\hphantom
{
\setdigitsmanipulation
[
\number
\plusone
]
0
}}
53 54
\appendtoks
55
\resetdigitsmanipulation
56
\to
\everyinitializeverbatim
57 58
\protect
\endinput
59