blob: 02df0abde70bee443b88db1188fae57e46ccc2f7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
%D \module
%D [ file=enco-inf,
%D version=2000.27.12, % moved to runtime module
%D title=\CONTEXT\ Encoding Macros,
%D subtitle=Ending Related Tracing,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright=Hans Hagen \& Ton Otten]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
\unprotect
\gdef\visualizecharacters% {}'s needed
{\def\uchar##1##2{\hbox to 2.5em
{\ifcase##1\relax\red\or\blue\else\green\fi##1\hss##2}}%
\let\normalbuildtextaccent\buildtextaccent
\let\normalbottomaccent \bottomaccent
% \def\char{\green\normalchar}%
\def\char% can be used in \oalign
{\bgroup\def\char{\green\normalchar\scratchcounter\egroup}%
\afterassignment\char\scratchcounter}%
\def\buildtextaccent{\let\green\empty\blue\normalbuildtextaccent}%
\def\bottomaccent{\let\green\empty\red\normalbottomaccent}}
\gdef\visualizecharacterslegend%
{\hbox{\currentencoding:\space
{\blue composed}\space{\red bottom}\space{\green char}\space raw}}
\gdef\showaccents%
{\bgroup
\starttextrule{\visualizecharacterslegend}
\visualizecharacters
\def\do##1%
{{\def\dodo####1%
{\hss\hbox to 1em{\hss\expanded{##1####1\recurselevel}\hss}}%
\hbox to \hsize
{\localcolortrue
\hbox to 2em{\tttf\string##1\hss}%
\dorecurse{26}{\dodo\character}}%
\hbox to \hsize
{\localcolortrue
\hskip2em
\dorecurse{26}{\dodo\Character}}}%
\par}
\do\'\do\`\do\^\do\~\do\"
\do\H\do\r\do\v\do\u\do\=
\do\.\do\b\do\d\do\k\do\c
\stoptextrule
\egroup}
\gdef\showcharacters%
{\bgroup
\dontcomplain
\forgetall
\def\startencoding[##1]{}
\def\stopencoding{\endinput}
\dimen0=\!!zeropoint
\dimen2=\!!zeropoint
\def\definecharacter ##1 ##2 %
{\setbox0=\hbox{\getvalue{##1}}%
\ifdim\wd0>\dimen0 \dimen0=\wd0 \fi
\setbox2=\hbox spread 1em{\box0 ##1}
\ifdim\wd2>\dimen2 \dimen2=\wd2 \fi}%
\readsysfile{\f!encodingprefix def}{}{}
\advance\dimen0 by 1em
\edef\encwidth{\the\dimen0}
\dimen0=\hsize
\advance\dimen0 2em
\advance\dimen2 2em
\divide \dimen0 by \dimen2
\edef\enccols{\number\dimen0}
\visualizecharacters
\startcolumns[\c!n=\enccols,\c!afstand=2em]
\def\definecharacter ##1 ##2 %
{\hbox{\localcolortrue\hbox to \encwidth{\getvalue{##1}\hss}##1}\par}
\readsysfile{\f!encodingprefix def}{}{}
\stopcolumns
\egroup}
\gdef\showhyphenations#1%
{\hbox
{language: \currentlanguage/\the\normallanguage\quad
font: \fontname\font\quad
encoding: \currentencoding\quad
mapping: \currentencoding\quad
sample: \hyphenatedword{#1}}}
\protect \endinput
|