summaryrefslogtreecommitdiff
path: root/tex/context/base/mkii/enco-mis.mkii
blob: 28523685e4ec040d845ca388e35938f8398fc43a (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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
%D \module
%D   [       file=enco-mis,
%D        version=2000.05.07, % 1999.11.11,
%D          title=\CONTEXT\ Encoding Macros,
%D       subtitle=Missing Glyphs,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D In this file we collect some definitions that construct
%D pseudo characters. Some day we will move some definitions
%D from \type {plain.tex} to this file. Some definitions are
%D derived from definitions in the \LATEX\ distribution,
%D especially Johannes Braams' Babel system.

\startmapping[\s!default]

\defineuppercasecom \dj  \DJ
\defineuppercasecom \Dj  \dj
\defineuppercasecom \DJ  \dj

\definecharacter dstroke {\pseudoencodeddj}
\definecharacter Dstroke {\pseudoencodedDJ}

\stopmapping

%D We need proper names like in enco-com.tex!

\definecharacter dj {\dstroke} % {\pseudoencodeddj}
\definecharacter Dj {\Dstroke} % {\pseudoencodedDJ}
\definecharacter DJ {\Dstroke} % {\pseudoencodedDJ}

\unprotect

\def\pseudoencodeddj % like in babel, but safer
  {\dontleavehmode\hbox\bgroup
   \setbox\scratchbox\hbox{d}%
   \scratchdimen\ht\scratchbox
   \advance\scratchdimen 1ex
   \scratchdimen.45\scratchdimen
   \dimen2=\withoutpt\the\slantperpoint\dimen0
   \advance\dimen2 .5ex
   \hbox to \wd\scratchbox
     {\box\scratchbox\hss
      \raise\scratchdimen\hbox{\kern\dimen2\vbox{\hrule\!!height0.1ex\!!width0.3em}}}%
   \egroup}

\def\pseudoencodedDJ % design: taco; quality assurance: mojca; cleanup: hans
  {\dontleavehmode
   \hbox\bgroup
   \setbox\scratchbox\hbox{D}%
   \dimen2=1.1ex
   \dimen2=\withoutpt\the\slantperpoint\dimen2
   \hbox to \wd\scratchbox
     {\rlap
        {\raise.52\ht\scratchbox
         \hbox
           {\kern\dimen2
            \vbox{\hrule\!!height.04ex\!!depth.04ex\!!width.4\wd\scratchbox}}}%
     \box\scratchbox}%
   \egroup}

% currency

\def\fakedollar % pretty cmr dependent
  {\bgroup
   \ifnum\fam=\itfam
     \sl
   \else\ifnum\fam=\bifam
     \bs
   \fi\fi
   \$%
   \egroup}

\def\fakesterling % pretty cmr dependent
  {\bgroup
   \ifnum\fam=\bffam
     \bi
   \else\ifnum\fam=\bifam
     \bi
   \else\ifnum\fam=\bsfam
     \bi
   \else
     \it
   \fi\fi\fi
   \$%
   \egroup}

\def\fakeflorin
  {\bgroup
   \ifnum\fam=\bffam
     \bi
   \else\ifnum\fam=\bifam
     \bi
   \else\ifnum\fam=\bsfam
     \bi
   \else
     \it
   \fi\fi\fi
   f%
   \egroup}

% perthings

\def\fakepercent
  {\mathematics{^{\scriptscriptstyle0}\kern-.25em/\kern-.2em_{\scriptscriptstyle0}}}

\def\fakeperthousand
  {\mathematics{^{\scriptscriptstyle0}\kern-.25em/\kern-.2em_{\scriptscriptstyle00}}}

\def\fakepermine
  {\dontleavehmode
   \bgroup
   \setbox\scratchbox\hbox
     {\mathematics{+}}%
   \hbox to \wd\scratchbox
     {\hss
      \mathematics{^{\scriptscriptstyle-}\kern-.4em/\kern-.3em_{\scriptscriptstyle-}}%
      \hss}%
   \egroup}

% guillemots

%D Yes I know, they are ugly:

\def\fakeleftguillemot
  {\dontleavehmode\hbox{\raise.25ex\hbox{$\scriptscriptstyle\ll$}}}

\def\fakerightguillemot
  {\hbox{\raise.25ex\hbox{$\scriptscriptstyle\gg$}}}

\def\fakeleftsubguillemot
  {\dontleavehmode\hbox{\raise.25ex\hbox{$\scriptscriptstyle<$}}}

\def\fakerightsubguillemot
  {\hbox{\raise.25ex\hbox{$\scriptscriptstyle>$}}}

%D Needed:

\def\fakevisiblespace
  {\leavevmode\hbox
     {\setbox\scratchbox\hbox{(}%
      \scratchdimen.1\dp\scratchbox
      \setbox\scratchbox\hbox{\space}%
      \hbox to \wd\scratchbox
        {\vrule
           \!!depth  5\scratchdimen
           \!!width   \scratchdimen
           \!!height  \zeropoint
         \hss
         \vrule
           \!!depth  5\scratchdimen
           \!!width   \wd\scratchbox
           \!!height-4\scratchdimen
         \hss
         \vrule
           \!!depth  5\scratchdimen
           \!!width   \scratchdimen
           \!!height  \zeropoint}}}

%\def\fakeunderscore{\leavevmode\kern.06em\vbox{\hrule\!!width.3em}}

\def\fakeunderscore
  {\leavevmode\hbox
     {\setbox\scratchbox\hbox{(}%
      \scratchdimen.2\dp\scratchbox
      \setbox\scratchbox\hbox{\space}%
      \vrule
        \!!depth \scratchdimen
        \!!width \wd\scratchbox
        \!!height\zeropoint}}

\ifx\mathunderscore\undefined \let\mathunderscore\fakeunderscore \fi
\ifx\textunderscore\undefined \let\textunderscore\fakeunderscore \fi

\unexpanded\def\normalunderscore{\ifmmode\mathunderscore\else\textunderscore\fi}

\let\_\normalunderscore

% Handy but obsolete, replaced by \unknownchar:
%
% \def\missingglyph{\ruledhbox{?}}

\protect \endinput