summaryrefslogtreecommitdiff
path: root/info/digests/tex88/polish/polset.tex
blob: 3e6ad8be0d0dc4fddc966bed821a970fee49f948 (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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
%----------------------------------------------------------------------
%  18:46:21  7/4/1988
%----------------------------------------------------------------------
% module `POLTAILS'
%
%
% macro package for PLAIN TeX
% A PREMATURED VERSION!!!
% to be used with crossed fingers
% NO RIGHTS RESERVED
%
% SPECIFICATION:
% defines macros \Polisha \PolishA \Polishe \PolishE
% for Polish tailed characters,
% \Polishl and \PolishL for Polish suppressed l's
% and, moreover, macro \polopenquot as Polish
% opening quotation symbol, macro \numbersymbol for N,
% and facilitates the use of them.
%
% macros and variables with names containing at-sign `@' are assumed
% to be local for this module
%
%
% IMPLEMENTATION :
%
% authors:  B. JACKOWSKI - T. HOœDYS - M. RY›KO
%
%--------
%
\def\KeepKerns#1#2{%
#2{\setbox0=\hbox{#1}\kern-\wd0\copy0\kern-\wd0}#2}%
%--------
\catcode `\@=11 %
%--------
\newdimen\prop@rshift
% \prop@rshift<0  -  shift to the left, >0  -  shift to the right
\newdimen\taild@pth
\newdimen\d@pthcorr
% \d@pthcorr<0 - shift up, >0 - shift down
\newdimen\min@x
\newdimen\curr@x
%--------
{%
\font\fivegr@@k=cmmi5 at 5truept%
\global\min@x=\fontdimen5\fivegr@@k}
%--------
\def\@@lap#1{\vbox to 0pt{\hsize=0pt\kern\d@pthcorr\rlap{\hss#1}\vss}}%
%--------
\def\s@ttwofonts#1#2{%
\font\small@rfont=\curr@nttailfont#1%
\font\bigg@rfont=\curr@nttailfont#2%
}%
%--------
\def\s@tprop@rfonts{%
\curr@x=\fontdimen5\the\font%
% doubled magnification factors (half excluded): 2000, 2400, 3456, 4148, 4976
\s@ttwofonts00%
\ifdim 2\min@x>\curr@x%
\s@ttwofonts01%
\else\ifdim 2.4\min@x>\curr@x%
\s@ttwofonts12%
\else\ifdim 3.456\min@x>\curr@x%
\s@ttwofonts23%
\else\ifdim 4.148\min@x>\curr@x%
\s@ttwofonts34%
\else%
\ifdim 4.976\min@x>\curr@x%
\s@ttwofonts45%
\fi\fi\fi\fi\fi}%
%--------
\def\s@ttailparam@t@rs#1#2{%
% \curr@ntcedillashift and \curr@ntiotashift are defined later on
\if c\curr@nttail%
% C E D I L L A
\prop@rshift=\curr@ntcedillashift{#2}%
\def\prop@rchar{\char'30}%
\d@pthcorr=-0.05ex
\setbox0=\hbox{\prop@rchar}\taild@pth=\dp0
\advance\taild@pth by \d@pthcorr % O.K. since \s@ttailparam@t@rs
%                                  is used inside a group in \tail@d
\else%
% G R E E K   I O T A
\def\prop@rchar{\char'23}%
\prop@rshift=\curr@ntiotashift{#2}%
\s@tprop@rfonts%
\ifnum \the\lccode`#1=`#1 %   small letter
\small@rfont\else%
\ifnum \the\uccode`#1=`#1 %   capital letter
\bigg@rfont%
\fi\fi%
\d@pthcorr=-0.05ex
\taild@pth=1ex \advance\taild@pth by \d@pthcorr \fi}%
%--------
\def\tail@d#1#2{%
#1%  incidentally, preceeding implicit kerns are preserved
%    (e.g., W\\asko is O.K.)
{\s@ttailparam@t@rs{#1}{#2}%
\setbox0=\@@lap{\kern2\prop@rshift\prop@rchar}\dp0=\taild@pth \box0}%
}%
%--------
\def\PolishA{\tail@d A0}%
\def\PolishE{\tail@d E1}%
\def\Polisha{\tail@d a2}%
\def\Polishe{\tail@d e3}%
%--------
\def\Polishl{\char32l}% 
\def\PolishL{\leavevmode{\setbox0\hbox{L}\hbox to\wd0{\hss\char32L}%
\kern-\wd0}L}
%--------
\newdimen\polop@nquotdim%
\def\polopenquot{%
{\setbox0=\hbox{''}\polop@nquotdim=\ht0%
\setbox0=\hbox{,}\advance\polop@nquotdim by -\ht0%
\setbox1=\hbox{\lower\polop@nquotdim\hbox{''}}%
\ht1=\ht0 \dp1=\dp0%
\leavevmode\box1}}%
%--------
\def\@@symbol{\vrule height 1ex width 0.22em depth -0.9ex%
\llap{\char'27 \kern -0.28em}}%
%--------
\def\numbersymbol{N\kern0.05em\@@symbol\kern 0.1em }% DON'T REMOVE THE SPACE!
%--------
\catcode `\@=12%
%----------------------------------------------------------------------
% the main macro of this part of the module, i.e., \Polishdiacriticalletters#1,
% produces the Polish diacritical character made of a letter #1;
% it may be used with letters a, c, e, l, n, o, s, x, z,
%                         and A, C, E, L, N, O, S, X, Z,
% #1=x and #1=X represent accented z and Z, resp.
% #1=z and #1=Z represent dotted z and Z, resp.,
% #1=@ repesents N§ symbol,
% #1=, repesents Polish opening quotation mark,i.e. ",,";
%

% GENERAL REMARKS
% the module should work well with a basic set of CM or AM fonts;
% due to especial arragement of macros accomplishing
% Polish "tailed" letters implicit kernings are preserved;
%
% IT DOES NOT WORK IN MATHMODE!!! - embeding in boxes might help...
% (also typewriter fonts does not provide necessary types)
%
%--------
\def\Polishdiacriticalletters#1{%
\if      a#1\KeepKerns{\Polisha}a%
\else\if c#1\KeepKerns{\'c}c%
\else\if e#1\KeepKerns{\Polishe}e%
\else\if l#1\Polishl%
\else\if n#1\'n%
\else\if o#1\KeepKerns{\'o}o%
\else\if s#1\'s%
\else\if x#1\'z%
\else\if z#1\.z%
\else\if A#1\KeepKerns{\PolishA}A%
\else\if C#1\KeepKerns{\'C}C%
\else\if E#1\PolishE%
\else\if L#1\PolishL%
\else\if N#1\'N%
\else\if O#1\KeepKerns{\'O}O%
\else\if S#1\'S%
\else\if X#1\'Z%
\else\if Z#1\.Z%
\else\if @#1\numbersymbol%
\else\if ,#1\polopenquot%
\else%
\ifhmode %
  \hskip2pt \vrule height1.5ex width\overfullrule depth0.2ex \hskip2pt %
\else %
   \ifvmode %
   \vskip2pt \hrule height1.5ex width\overfullrule depth0.2ex \vskip2pt %
\fi %
\fi %
%\message{NIE MA DIAKRYTYCZNEGO #1!   }%
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
%
%--------
%
\begingroup
\global\let\previoustwobackslashes=\\%
\def\\#1{%
\Polishdiacriticalletters{#1}}%
\global\let\Polishtwobackslashes=\\
\endgroup
%--------
%
% An alternative implementation, using active `/' rather than `\\':
%
%--------
\newcount\previousslashcode \previousslashcode=\the\catcode`\/%
\begingroup
\catcode`\/=12 %
\global\def\normalslash{/}
\catcode`\/=\active %
\global\let\previoussingleslash=/%
\def/#1{%
\ifx     /#1\normalslash \else%
\Polishdiacriticalletters{#1}%
\fi%
}%
\global\let\Polishsingleslash=/
%----------------------------------------------------------------------
% macros \switchtoslash and \switchtobackslashes enable an undecided
% user to switch back and forth between the two ways of marking Polish
% diacritical letters in a source text: after \switchtoslash / should be 
% used as the preceding operator, after \switchtobackslashes - \\ (default).
% Switching restores the previous meaning of the other operator.
%----------------------------------------------------------------------
\global\def\switchtoslash{%
\global\previousslashcode=\the\catcode`\/%
\catcode`\/=\active%
\global\let\\=\previoustwobackslashes%
\global\let\previoussingleslash=/%
\global\let/=\Polishsingleslash}%
%
\global\def\switchtobackslashes{%
\global\let\previoustwobackslashes=\\%
\global\let\\=\Polishtwobackslashes%
\ifnum \the\catcode`\/=\active \global\let/=\previoussingleslash \fi%
\global\catcode`\/=\previousslashcode %
}%
\endgroup%
%
%----------------------------------------------------------------------
% some additional macros:
%----------------------------------------------------------------------
\begingroup%
\catcode`\@=11 %
% a, A, e, and E shifts:
\global\def\setiotashifts(#1\A #2\E #3\a #4\e){%
\def\curr@ntiotashift##1{%
\ifcase##1 #1em\or#2em\or#3em\or#4em\fi}}% DON'T REMOVE THE SPACE!
%--------
\global\def\setcedillashifts(#1\A #2\E #3\a #4\e){%
\def\curr@ntcedillashift##1{%
\ifcase##1 #1em\or#2em\or#3em\or#4em\fi}}% DON'T REMOVE THE SPACE!
%--------
\global\def\switchtoiotatail{\let\curr@nttail=i}%
\global\def\switchtocedillatail{\let\curr@nttail=c}%
\global\def\switchtononbold{%
\setiotashifts(-0.12\A -0.2\E -0.1\a -0.18\e)%
\setcedillashifts(-0.1\A -0.24\E -0.14\a -0.2\e)%
\def\curr@nttailfont##1{%
\ifcase ##1 cmmi5 at 5truept \or%
cmmi5 at 5.475truept \or%
cmmi5 at 6truept \or%
cmmi5 at 7.2truept \or%
cmmi5 at 8.64truept \or%
cmmi5 at 10.37truept \or%
\fi}%
}%
\global\def\switchtobold{%
\setiotashifts(-0.14\A -0.18\E -0.1\a -0.2\e)%
\setcedillashifts(-0.18\A -0.24\E -0.16\a -0.22\e)%
\def\curr@nttailfont##1{%
\ifcase ##1 cmmi5 at 5truept \or%
cmmi5 at 5.475truept \or%
cmmi5 at 6truept \or%
cmmi5 at 7.2truept \or%
cmmib10 at 10truept \or%
cmmib10 at 10.95truept \or%
\fi}%
}%
\endgroup%
%----------------------------------------------------------------------
% DEFAULTS:
%----------------------------------------------------------------------
\switchtobackslashes
\switchtoiotatail
\switchtononbold
%
%
\endinput