1
2
3
4
5
6
7
8
9
10
11
12
13
14\writestatus{loading}{ConTeXt Typesetting Macros Spacing}
15
16\unprotect
17
18\registerctxluafile{typospa}{autosuffix}
19
20\definesystemattribute[spacing][public]
21
22
23
24
25
26
27
28\installcorenamespace{characterspacing}
29
30\installsetuponlycommandhandler \??characterspacing {pcharacterspacing}
31
32\setup_p_characterspacing
33 [\c!left=0,
34 \c!right=0,
35 \c!alternative=0,
36 \c!language=0]
37
38\permanent\tolerant\protected\def\definecharacterspacing[#1]#*[#2]
39 {\clf_definecharacterspacing{#1}{#2}}
40
41\permanent\tolerant\protected\def\setupcharacterspacing[#1]#*[#S#2]#*[#S#3]
42 {\begingroup
43 \ifchknumber#2\or
44 \setupcurrent_p_characterspacing[#3]
45 \clf_setupcharacterspacing
46 {#1}
47 \numexpr#2\relax
48 {
49 left \direct_p_characterspacingparameter\c!left\space
50 right \direct_p_characterspacingparameter\c!right\space
51 alternative \direct_p_characterspacingparameter\c!alternative\space
52 }
53 \relax
54 \else
55 \setupcurrent_p_characterspacing[#2]
56 \clf_setupcharacterspacing
57 {#1}
58 \zerocount
59 {
60 language {\direct_p_characterspacingparameter\c!language}
61 }
62 \fi
63 \endgroup}
64
65\permanent\protected\def\setcharacterspacing[#1]
66 {\clf_setcharacterspacing{#1}}
67
68\permanent\protected\def\resetcharacterspacing
69 {\c_attr_spacing\attributeunsetvalue}
70
71\appendtoks
72 \resetcharacterspacing
73\to \everyresettypesetting
74
75
76
77
78
79
80\definecharacterspacing [frenchpunctuation]
81
82\setupcharacterspacing [frenchpunctuation] ["003A] [\c!left =.25,\c!alternative=1]
83\setupcharacterspacing [frenchpunctuation] ["003B] [\c!left =.25,\c!alternative=1]
84\setupcharacterspacing [frenchpunctuation] ["003F] [\c!left =.25,\c!alternative=1]
85\setupcharacterspacing [frenchpunctuation] ["0021] [\c!left =.25,\c!alternative=1]
86\setupcharacterspacing [frenchpunctuation] ["00AB] [\c!right=.25,\c!alternative=1]
87\setupcharacterspacing [frenchpunctuation] ["00BB] [\c!left =.25,\c!alternative=1]
88
89
90
91
92
93
94\protect \endinput
95 |