summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/fonts/source/public/pl/polkap.mf
blob: df8616096877042cbd4849b3331b7f54bb0aa3ee (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
% ---------------------------------------------------------------------------
% This is POLKAP.MF (polskie kapitaliki, i.e., caps and small caps) in
% text format.
% The program is a modification of the CSC.MF file.
% ---------------------------------------------------------------------------
% PL VERSION 1.09a, 30th March 2020 (see README.ENG)
% ---------------------------------------------------------------------------
% AUTHORS OF MODIFICATION: Bogusław Jackowski and Marek Ryćko
% ---------------------------------------------------------------------------
% This file belongs to the public domain under conditions similar to
% those of D. E. Knuth specified for the Computer Modern family of fonts.
%
% For details see either the file MEXINFO.POL or MEXINFO.ENG.
% ---------------------------------------------------------------------------
font_coding_scheme:=if ligs=0: "TeX typewriter text"
 else: "TeX text without f-ligatures" fi;
spanish_shriek=oct"016"; spanish_query=oct"017";

mode_setup; font_setup;

input pl_dod;  % Polish additional definitions
input pl_dl;   % Polish majuscules
input pl_cud;  % Polish and French quotation marks

input romanu;  % upper case (majuscules)
input greeku;  % upper case greek letters
input romand;  % numerals
input romanp;  % ampersand, question marks, currency sign
input romspu;  % uppercase specials (\AE, \OE, \O)
input punct;   % punctuation symbols common to all roman and italic
input accent;  % accents common to roman and italic text
input romsub;  % substitutes for ligatures

if ligs>0: input comlig; fi  % ligatures common with italic

ligtable "!": "`" =: spanish_shriek;
ligtable "?": "`" =: spanish_query;
font_slant slant; font_x_height x_height#;

if monospace: font_normal_space 9u#; % no stretching or shrinking
 font_quad 18u#;
 font_extra_space 9u#;
else: font_normal_space 6u#+2letter_fit#;
 font_normal_stretch 3u#; font_normal_shrink 2u#;
 font_quad 18u#+4letter_fit#;
 font_extra_space 2u#;

% IMPLICIT KERNS (the first portion):

% three degrees of kerning (more precisely, |-u#| is fourth):
k#:=-.5u#; kk#:=-1.5u#; kkk#:=-2u#;

% The kern for a latin letter is repeated for the corresponding
% diacritical one; the following kerns, however, should have been added
% between |"F"|, |"P"|, |"T"|, |"V"|, |"W"|, |"Y"| and |"."|, |","|,
% and between dots (because of `...') but for the sake of compatibility
% with CM's they would have been inserted only if |improve_kerns=true|
% (by default |improve_kerns=false|).

if improve_kerns: ligtable ".": "." kern -kkk#; fi
ligtable "P": "T": "Y":
 if improve_kerns:  "." kern k#, "," kern k#, fi
 "a" kern kk#, ogonked_a kern kk#, "A" kern kk#, ogonked_A kern kk#;
ligtable "F": "V": "W":
 if improve_kerns: "." kern -u#, "," kern -u#, fi
 if serifs: "a" kern kkk#, ogonked_a kern kkk#,
  "A" kern kkk#, ogonked_A kern kkk#,
 else:
  "a" kern kk#, ogonked_a kern kk#, "A" kern kk#, ogonked_A kern kk#,
 fi
 "K": "X": "o" kern k#, accented_o kern k#, "O" kern k#, accented_O kern k#,
 "c" kern k#, accented_c kern k#, "C" kern k#, accented_C kern k#,
  "g" kern k#, "G" kern k#, "q" kern k#, "Q" kern k#;
ligtable "O": accented_O: "D":
 "x" kern k#, "X" kern k#, "w" kern k#, "W" kern k#,
 "a" kern k#, ogonked_a kern k#, "A" kern k#, ogonked_A kern k#,
 "v" kern k#, "V" kern k#, "y" kern k#, "Y" kern k#;
ligtable "A": ogonked_A: if serifs: "R": fi
 "c" kern k#, accented_c kern k#, "C" kern k#, accented_C kern k#,
 "o" kern k#, accented_o kern k#, "O" kern k#, accented_O kern k#,
 "g" kern k#, "G" kern k#, "u" kern k#, "U" kern k#, "q" kern k#,
 "Q" kern k#, "L": crossed_L: "T" kern kk#, "t" kern kk#,
 "Y" kern kk#, "y" kern kk#, "V" kern kkk#, "v" kern kkk#,
 "W" kern kkk#, "w" kern kkk#;
ligtable "I": "I" kern -k#; % Richard III

fi

boolean is_small_cap; is_small_cap:=true;
%%% fine higher
% the `higher' values are used while putting accents and attaching ogoneks
forsuffixes $=u,o,letter_fit,cap_height,x_height,bar_height,body_height,stem:
 higher.$.#:=$.#; higher.$:=$;
endfor

%%% fine lower
forsuffixes $ = u, width_adj, cap_serif_fit, letter_fit,
 body_height, cap_height, x_height, bar_height, comma_depth,
 flare, cap_hair, stem, cap_stem, cap_curve, cap_ess,
 cap_jut, beak_jut, beak, slab, cap_bar, cap_band, cap_notch_cut,
 o, apex_o:  $.#:=lower.$.#;
endfor
fudge:=lower.fudge;

% optional part:
forsuffixes $ = depth_corr, left_corr, top_breadth_corr, tip_breadth_corr,
  tip_xcorr, tip_ycorr, pre_angle, post_angle, pre_limit, post_limit,
  pre_lightness, post_lightness, pre_deflexion, post_deflexion, cap_flat,
  ogonek_pen#: if known lower.$: $:=lower.$; fi
endfor

font_setup; % now try again with |lower| settings

% repeat ``last minute font setup'' from PL_DOD.MF, as |font_setup|
% clears pen memory
%%% define_pixels prepare_pen
if not serifs: fisp:=round(1/3[fine,crisp]); prepare_pen fisp; fi
if known ogonek_pen#:
 define_whole_pixels(ogonek_pen); prepare_pen ogonek_pen;
fi

ogonked_A:=ogonked_a;
accented_C:=accented_c;
ogonked_E:=ogonked_e;
crossed_L:=crossed_l;
accented_N:=accented_n;
accented_O:=accented_o;
accented_S:=accented_s;
accented_Z:=accented_z;
dotted_Z:=dotted_z;

saved_height:=whatever;

input pl_dl;   % Polish majuscules (in positions of respective minuscules)

% restore the previous state (ordnung must sein):
polish_uc_positions; is_small_cap:=false;

extra_endchar:=extra_endchar&";charcode:=charcode+code_offset";

code_offset:=ASCII"a" - ASCII"A";
input romanu;  % majuscules (in positions of respective minuscules)
code_offset:=-3;
input romspu;  % \AE, \OE, \O\ (in positions of \ae, \oe, \o)
code_offset:=0;
input cscspu;  % substitutes for the remaining characters of romspl

if not monospace:

% IMPLICIT KERNS (the second portion):

% three degrees of kerning (more precisely, |-u#| is fourth):
k#:=-.5u#; kk#:=-1.5u#; kkk#:=-2u#;

% Usually a kern for a latin letter is repeated for the corresponding
% diacritical one except that kerns
%  - between Polish opening quotes and some letters
%  have been added; the following kerns should have been added:
%  - between |"f"|, |"p"|, |"t"|, |"v"|, |"w"|, |"y"| and |"."|, |","|
%  - between |"a"| with ogonek, |"a"| and |"'"|
% but for the sake of compatibility with CM's they would have been
% inserted only if |improve_kerns=true| (see the comment in the first
% of implicit kerns).

ligtable "p": "t": "y":
 if improve_kerns: "." kern k#, "," kern k#, fi
 "a" kern kk#, ogonked_a kern kk#;
ligtable "f": "v": "w":
 if improve_kerns: "." kern -u#, "," kern -u#, fi
 "a" kern if serifs: kkk# else: kk# fi,
 ogonked_a kern if serifs: kkk# else: kk# fi,
 "k": "x": "o" kern k#, accented_o kern k#, "c" kern k#,
 accented_c kern k#, "g" kern k#, "q" kern k#;
ligtable "o": accented_o: "d":
 "x" kern k#, "w" kern k#, "a" kern k#, ogonked_a kern k#,
 "v" kern k#, "y" kern k#;
ligtable "a": ogonked_a:
 if improve_kerns: "'" kern kk#, fi
 if serifs: "r": fi "c" kern k#, accented_c kern k#,
 "o" kern k#, accented_o kern k#, "g" kern k#, "u" kern k#, "q" kern k#,
 "l": crossed_l: "'" kern kk#, "t" kern kk#, "y" kern kk#, "v" kern kkk#,
 "w" kern kkk#;
ligtable "i": "i" kern -k#; % skiing (in Polish, e.g., poliizopren)

ligtable polish_opening_quotes:
 if serifs:
  "A" kern -k#, ogonked_A kern -k#,
  "C" kern -k#, accented_C kern -k#, "D" kern -k#,
  "E" kern -k#, ogonked_E kern -k#, "F" kern -k#, "H" kern -k#,
  "I" kern -k#, "J" kern -k#, "K" kern -k#,
  "L" kern -k#, crossed_L kern -k#, "M" kern -k#,
  "N" kern -k#, accented_N kern -k#, "P" kern -k#,
  "R" kern -k#, "S" kern -k#, accented_S kern -k#, "T" kern k#,
  "X" kern -k#, "Y" kern k#,
  "Z" kern -k#, accented_Z kern -k#, dotted_Z kern -k#,
 else:
  "T" kern kk#, "Y" kern kk#,
 fi
  "V" kern kk#, "W" kern k#,
 if serifs:
  "a" kern -k#, ogonked_a kern -k#,
  "c" kern -k#, accented_c kern -k#, "d" kern -k#,
  "e" kern -k#, ogonked_e kern -k#, "f" kern -k#, "h" kern -k#,
  "i" kern -k#, "j" kern -k#, "k" kern -k#,
  "l" kern -k#, crossed_l kern -k#, "m" kern -k#,
  "n" kern -k#, accented_n kern -k#, "p" kern -k#,
  "r" kern -k#, "s" kern -k#, accented_s kern -k#, "t" kern k#,
  "x" kern -k#, "y" kern k#,
  "z" kern -k#, accented_z kern -k#, dotted_z kern -k#,
 else:
  "t" kern kk#, "y" kern kk#,
 fi
  "v" kern kk#, "w" kern k#;
fi

% There are also ligature/kern |"-"|, |"`"|, and |"'"| in the COMLIG file
% and for  |"<"|, |">"|, |","| in the PL_CUD file.

bye.
%%\end