Debian Codegraph @

texmf-dist/source/fontinst/base/filtfam.dtx

raw
1 % \CheckSum{1041}
2 % \iffalse meta-comment
3 %
4 % Copyright 1993, 1994, 1995, 1996 Alan Jeffrey,
5 % hacked and maintained 1997, 1998 Sebastian Rahtz,
6 % copyright 1998, 1999 the fontinst maintenance team and any individual
7 % authors listed elsewhere in this file. All rights reserved.
8 %
9 % This file is part of the fontinst system version 1.9.
10 % -----------------------------------------------------
11 %
12 % It may be distributed under the terms of the LaTeX Project Public
13 % License, as described in lppl.txt in the base LaTeX distribution.
14 % Either version 1.0 or, at your option, any later version.
15 %
16 %%% From file: filtfam.dtx
17 %
18 %<*driver>
19 \documentclass{ltxdoc}
20 \usepackage{fisource}
21 \GetFileInfo{filtfam.dtx}
22 \title{The \package{fontinst} utility}
23 \author{Alan Jeffrey, Sebastian Rahtz, Ulrik Vieth}
24 \begin{document}
25 \maketitle
26 \DocInput{filtfam.dtx}
27 \end{document}
28 %</driver>
29 % \fi
30 %
31 % \section{Installing Latin families}
32 %
33 % \changes{1.800}{1998/06/22}{\cs{textcompfamily} integrated into
34 % \cs{latinfamily}. (UV)}
35 %
36 % \begin{macro}{\latinfamily}
37 % The macro:
38 % \begin{quote}
39 % |\latinfamily|\marg{family}\marg{commands}
40 % \end{quote}
41 % installs a Latin font family.
42 %
43 % \StopEventually{}
44 %
45 % \begin{macrocode}
46 %<*pkg>
47 \def\latinfamily#1#2{{
48 \edef\a_macro{#1}
49 \expandafter\parse_family\a_macro
50 \empty_command\empty_command\end_parse_family
51 \installfonts
52 \if_file_exists{\raw_encoding.mtx}\then
53 \installfamily{\raw_encoding}{\latex_family}{#2}
54 \fi
55 \installfamily{OT1}{\latex_family}{#2}
56 \installfamily{T1}{\latex_family}{#2}
57 %<*textcomp>
58 \installfamily{TS1}{\latex_family}{#2}
59 %</textcomp>
60 \latin_weights
61 \endinstallfonts
62 }}
63 % \end{macrocode}
64 % \end{macro}
65 %
66 % \begin{macro}{\parse_family}
67 % \begin{macro}{\font_family}
68 % \begin{macro}{\font_variant}
69 % \begin{macro}{\raw_variant}
70 % \begin{macro}{\latex_variant}
71 % |\parse_family FAMILY\end_parse_family|
72 %
73 % Intializes |\latex_family| to |FAMILY|, |\font_family| to first
74 % three characters of |FAMILY|, |\font_variant| and |\raw_variant|
75 % to fourth and fifth character (if present).
76 %
77 % SPQR 02/95: If the fourth parameter is |x| or |9|, then its an expert
78 % indication, not a variant. So initialy set |\raw_variant| to |#4|,
79 % but unset it if the expert test succeeds. When |#4| is used for a
80 % real variant, it passes through.
81 %
82 % SPQR 05/95: If it \emph{is} an expert font, then the variantness
83 % is expressed by the encoding, not a variant letter, so unset
84 % |\font_variant|.
85 %
86 % UV 06/98: Added |\if_oldstyle_| code from Alan's v~1.511 beta.
87 % If the fourth parameter is |9|, treat it as if |j| was given.
88 %
89 % Note that instead of using |\setcommand\digit|, we now use separate
90 % encoding files for |T1j.etx|, etc.
91 %
92 % \begin{macrocode}
93 \def\parse_family #1#2#3#4#5\end_parse_family{
94 \gdef\font_family{#1#2#3}
95 \gdef\font_variant{#4#5}
96 \gdef\raw_variant{#4#5}
97 \gdef\latex_family{#1#2#3#4#5}
98 \_expert_false
99 \_oldstyle_false
100 \ifx#4x
101 \_expert_true
102 \gdef\raw_variant{#5}
103 \gdef\font_variant{#5}
104 %\setcommand\digit##1{##1}
105 \else\ifx#4j
106 \_expert_true
107 \_oldstyle_true
108 \gdef\raw_variant{#5}
109 \gdef\font_variant{#5}
110 %\setcommand\digit##1{##1oldstyle}
111 \else\ifx#49
112 \gdef\latex_family{#1#2#3j#5}
113 \_expert_true
114 \_oldstyle_true
115 \gdef\raw_variant{#5}
116 \gdef\font_variant{#5}
117 %\setcommand\digit##1{##1oldstyle}
118 \else
119 \_expert_false
120 \_oldstyle_false
121 %\setcommand\digit##1{##1}
122 \fi\fi\fi
123 %<*debug>
124 \if_oldstyle_
125 \immediate\write16{INFO>~parse~family~<#1#2#3><#5>~(oldstyle)}
126 \else\if_expert_
127 \immediate\write16{INFO>~parse~family~<#1#2#3><#5>~(expert)}
128 \else
129 \immediate\write16{INFO>~parse~family~<#1#2#3><#4#5>}
130 \fi\fi
131 %</debug>
132 }
133 % \end{macrocode}
134 % \end{macro}
135 % \end{macro}
136 % \end{macro}
137 % \end{macro}
138 % \end{macro}
139 %
140 % \begin{macro}{\if_expert_}
141 % \begin{macro}{\if_oldstyle_}
142 % \begin{macrocode}
143 \newif\if_expert_
144 \newif\if_oldstyle_
145 % \end{macrocode}
146 % \end{macro}
147 % \end{macro}
148 %
149 %
150 % \subsection{Processing a list of weights, widths and shapes}
151 %
152 % \begin{macro}{\latin_weight}
153 % \begin{macro}{\font_weight}
154 % \begin{macro}{\latex_weight}
155 % |\latin_weight{FONTWEIGHT}{LATEXWEIGHT}|
156 %
157 % \begin{macrocode}
158 \def\latin_weight#1#2{
159 \gdef\font_weight{#1}%
160 \gdef\latex_weight{#2}%
161 \latin_widths
162 }
163 % \end{macrocode}
164 % \end{macro}
165 % \end{macro}
166 % \end{macro}
167 %
168 % \begin{macro}{\latin_width}
169 % \begin{macro}{\font_width}
170 % \begin{macro}{\latex_width}
171 % |\latin_width{FONTWIDTH}{LATEXWIDTH}|
172 %
173 % \begin{macrocode}
174 \def\latin_width#1#2{
175 \gdef\font_width{#1}
176 \gdef\latex_width{#2}
177 \latin_shapes
178 }
179 % \end{macrocode}
180 % \end{macro}
181 % \end{macro}
182 % \end{macro}
183 %
184 % \begin{macro}{\latin_shape}
185 % \begin{macro}{\font_shape}
186 % \begin{macro}{\raw_shape}
187 % \begin{macro}{\encoding_shape}
188 % \begin{macro}{\latex_shape}
189 % \begin{macro}{\encoding_switches}
190 % |\latin_shape{FONTSHAPE}{RAWSHAPE}{ENCODINGSHAPE}{LATEXSHAPE}{SWITCHES}|
191 %
192 % Calls |\fake_width_WIDTH| and |\fake_shape_SHAPE| to generate an
193 % |8r|-reencoded |.mtx| file. If successful, calls |\latin_encodings|.
194 %
195 % UV 06/98: Added a fifth argument |SWITCHES|, which may be used
196 % to set |\if_textcomp_| before it is evaluated in |\latin_encodings|.
197 %
198 % \begin{macrocode}
199 \def\latin_shape#1#2#3#4#5{
200 \gdef\font_shape{#1}
201 \gdef\raw_shape{#2}
202 \gdef\encoding_shape{#3}
203 \if_oldstyle_
204 \gdef\encoding_shape{#3\oldstyle_shape}
205 \fi
206 \gdef\latex_shape{#4}
207 \gdef\encoding_switches{#5}
208 %<*debug>
209 \immediate\write16{
210 INFO>~to~make~LaTeX~font~shape~<\latex_family,
211 \latex_weight,\latex_shape,\latex_width>~seek~
212 \font_family\font_weight\raw_shape
213 \raw_variant\raw_encoding\font_width.mtx}
214 %</debug>
215 \csname fake_width_\font_width\endcsname
216 \csname fake_shape_\raw_shape\endcsname
217 \if_file_exists{
218 \font_family\font_weight\raw_shape
219 \raw_variant\raw_encoding\font_width.mtx
220 }\then
221 \latin_encodings
222 \fi
223 }
224 % \end{macrocode}
225 % \end{macro}
226 % \end{macro}
227 % \end{macro}
228 % \end{macro}
229 % \end{macro}
230 % \end{macro}
231 %
232 %
233 % \subsection{Faking font shapes}
234 %
235 % (CK) changed font faking code; based on SPQR's code (still in this
236 % file). I am not sure that know what I am doing here; let's hope
237 % I won't be caught. Also changed: Order of |\font_width| and
238 % |\font_encoding| in MANY places. Also added tests which prevent
239 % multiple calls to the same font faking routine. (Seems to be
240 % necessary in some cases and can't hurt.) --- (ASAJ) I think CK
241 % knows more about what he's doing than he's letting on.
242 %
243 % \begin{macro}{\fake_shape_}
244 % Check if an |8a|-encoded |.afm| file exists for current combination
245 % of font attributes, and, if so, call |\fake_shape_raw_encoding|.
246 % For expert fonts, also check if an |8x|-encoded |.afm| file exists,
247 % and call |\fake_shape_expert_encoding|, if approporiate.
248 %
249 % UV, 06/98: Cut down lengthy |\fake_shape_| routine into several
250 % subroutines |\fake_shape_raw_encoding| and optionally
251 % |\fake_shape_expert_encoding| and |\fake_shape_oldstyle_encoding|.
252 %
253 % UV, 06/98: Added experimental code to install OsF or SC\&OsF fonts.
254 %
255 % \begin{macrocode}
256 \def\fake_shape_{
257 \if_file_exists{
258 \font_family\font_weight\raw_shape\raw_variant
259 \adobe_encoding\font_width.afm
260 }\then
261 \fake_shape_raw_encoding
262 \fi
263 \if_expert_
264 \if_file_exists{
265 \font_family\font_weight\raw_shape\raw_variant
266 \expert_encoding\font_width.afm
267 }\then
268 \fake_shape_expert_encoding
269 \fi
270 \fi
271 %<*oldstyle>
272 \if_oldstyle_
273 \gdef\oldstyle_variant{\oldstyle_shape}
274 \if_file_exists{
275 \font_family\font_weight\raw_shape\oldstyle_variant
276 \adobe_encoding\font_width.afm
277 }\then
278 \fake_shape_oldstyle_encoding
279 \else
280 \gdef\oldstyle_variant{\caps_shape}
281 \if_file_exists{
282 \font_family\font_weight\raw_shape\oldstyle_variant
283 \adobe_encoding\font_width.afm
284 }\then
285 \fake_shape_oldstyle_encoding
286 \fi
287 \fi
288 \fi
289 %</oldstyle>
290 }
291 % \end{macrocode}
292 % \end{macro}
293 %
294 % \begin{macro}{\fake_shape_raw_encoding}
295 % Called from |\fake_shape_| if an |8a|-encoded |.afm| file was found.
296 % Invokes
297 % \begin{quote}
298 % |\transformfont{<FONT>8r}|\\
299 % | {\reencodefont{8r}{\fromafm{<FONT>8a}}}|
300 % \end{quote}
301 % to generate an |8r|-reencoded |.mtx| file (and a raw |.pl| file),
302 % followed by
303 % \begin{quote}
304 % |\installrawfont{<FONT>8r}{<FONT>8r,8r}{8r}...|
305 % \end{quote}
306 % to install a ligfull |.pl| file.
307 %
308 % \begin{macrocode}
309 \def\fake_shape_raw_encoding{
310 \if_file_exists{
311 \font_family\font_weight\raw_shape\raw_variant
312 \raw_encoding\font_width.mtx
313 }\then % no action required
314 \else
315 %<*debug>
316 \immediate\write16{
317 INFO>~run~\string\transformfont\space\space
318 <\font_family\font_weight\raw_shape\raw_variant
319 \raw_encoding\font_width>~from~
320 <\font_family\font_weight\raw_shape\raw_variant
321 \adobe_encoding\font_width>
322 }
323 %</debug>
324 \transformfont{
325 \font_family\font_weight\raw_shape\raw_variant
326 \raw_encoding\font_width
327 }{
328 \reencodefont{\raw_encoding}{
329 \fromafm{
330 \font_family\font_weight\raw_shape\raw_variant
331 \adobe_encoding\font_width
332 }
333 }
334 }
335 \if_file_exists{ \raw_encoding.mtx }\then
336 %<*debug>
337 \immediate\write16{
338 INFO>~run~\string\installrawfont\space
339 <\font_family\font_weight\font_shape\raw_variant
340 \raw_encoding\font_width>
341 <\font_family\font_weight\raw_shape\raw_variant
342 \raw_encoding\font_width,
343 \raw_encoding>
344 <\raw_encoding>
345 <\raw_encoding>
346 <\latex_family>
347 <\latex_weight\latex_width>
348 <\latex_shape>}
349 %</debug>
350 \installrawfont{
351 \font_family\font_weight\raw_shape\raw_variant
352 \raw_encoding\font_width
353 }{ \font_family\font_weight\raw_shape\raw_variant
354 \raw_encoding\font_width,
355 \raw_encoding
356 }{ \raw_encoding
357 }{ \raw_encoding
358 }{ \latex_family
359 }{ \latex_weight\latex_width
360 }{ \latex_shape
361 }{}
362 \fi
363 \fi
364 }
365 % \end{macrocode}
366 % \end{macro}
367 %
368 % \begin{macro}{\fake_shape_expert_encoding}
369 % Called from |\fake_shape_| if an |8x|-encoded |.afm| file was found.
370 % Invokes
371 % \begin{quote}
372 % |\fromafm{<FONT>8x}|
373 % \end{quote}
374 % to generate an |8x|-encoded |.mtx| file (and a raw |.pl| file).
375 %
376 % \begin{macrocode}
377 \def\fake_shape_expert_encoding{
378 \if_file_exists{
379 \font_family\font_weight\raw_shape\raw_variant
380 \expert_encoding\font_width.mtx
381 }\then % no action required
382 \else
383 \fromafm{
384 \font_family\font_weight\raw_shape\raw_variant
385 \expert_encoding\font_width
386 }
387 \fi
388 }
389 % \end{macrocode}
390 % \end{macro}
391 %
392 % \begin{macro}{\fake_shape_oldstyle_encoding}
393 % Called from |\fake_shape_| if an OsF or SC\&OsF variant of an
394 % |8a|-encoded |.afm| file was found. Invokes
395 % \begin{quote}
396 % |\transformfont{<FONT>j8r}|\\
397 % | {\reencodefont{8r}{\fromafm{<FONT>j8a}}}|
398 % \end{quote}
399 % to generate an |8r|-reencoded |.mtx| file (and a raw |.pl| file).
400 %
401 % \begin{macrocode}
402 %<*oldstyle>
403 \def\fake_shape_oldstyle_encoding{
404 \if_file_exists{
405 \font_family\font_weight\raw_shape\oldstyle_variant
406 \adobe_encoding\font_width.mtx
407 }\then % no action required
408 \else
409 %<*debug>
410 \immediate\write16{
411 INFO>~run~\string\transformfont\space\space
412 <\font_family\font_weight\raw_shape\oldstyle_variant
413 \raw_encoding\font_width>~from~
414 <\font_family\font_weight\raw_shape\oldstyle_variant
415 \adobe_encoding\font_width>
416 }
417 %</debug>
418 \transformfont{
419 \font_family\font_weight\raw_shape\oldstyle_variant
420 \raw_encoding\font_width
421 }{
422 \reencodefont{\raw_encoding}{
423 \fromafm{
424 \font_family\font_weight\raw_shape\oldstyle_variant
425 \adobe_encoding\font_width
426 }
427 }
428 }
429 \fi
430 }
431 %</oldstyle>
432 % \end{macrocode}
433 % \end{macro}
434 %
435 %
436 % \begin{macro}{\fake_shape_c}
437 % Check if an |8a|-encoded |.afm| file exists for the small caps shape.
438 % If so, call |\fake_shape_| to generate an |8r|-reencoded MTX
439 % file and to install a ligfull |.pl| file. If not, reset |\raw_shape|
440 % to the default shape and |\encoding_shape| to small caps before
441 % calling |\fake_shape_| to install a faked small caps font.
442 %
443 % \begin{macrocode}
444 \def\fake_shape_c{
445 \if_file_exists{
446 \font_family\font_weight\raw_shape\raw_variant
447 \adobe_encoding\font_width.afm
448 }\then
449 \fake_shape_
450 \else
451 % If real smallcaps font doesn't exist, fake it from the roman.
452 \gdef\raw_shape{}
453 \if_oldstyle_
454 \gdef\encoding_shape{cj}
455 \else
456 \gdef\encoding_shape{c}
457 \fi
458 \fake_shape_
459 \fi
460 }
461 % \end{macrocode}
462 % \end{macro}
463 %
464 %
465 % \begin{macro}{\fake_shape_o}
466 % Check if an |8a|-encoded |.afm| file exists for the oblique shape.
467 % If so, call |\fake_shape_| to generate an |8r|-reencoded MTX
468 % file and to install a ligfull |.pl| file. If not, call macros
469 % to fake a oblique fonts.
470 %
471 % \begin{macrocode}
472 \def\fake_shape_o{
473 \if_file_exists{
474 \font_family\font_weight\raw_shape\raw_variant
475 \adobe_encoding\font_width.afm
476 }\then
477 \fake_shape_
478 \else
479 \fake_shape_o_raw_encoding
480 \if_expert_
481 \fake_shape_o_expert_encoding
482 \fi
483 %<*oldstyle>
484 \if_oldstyle_
485 \fake_shape_o_oldstyle_encoding
486 \fi
487 %</oldstyle>
488 \fi
489 }
490 % \end{macrocode}
491 % \end{macro}
492 %
493 % \begin{macro}{\fake_shape_o_raw_encoding}
494 % Called from |\fake_shape_o| if the oblique shape needs to be faked.
495 % Invokes
496 % \begin{quote}
497 % |\transformfont{<FONT>o8r}|\\
498 % | {\slantfont{SLANT}{\frommtx{<FONT>8r}}}|
499 % \end{quote}
500 % to generate an |8r|-reencoded |.mtx| file (and a raw |.pl| file),
501 % followed by
502 % \begin{quote}
503 % |\installrawfont{<FONT>o8r}{<FONT>o8r,8r}{8r}...|
504 % \end{quote}
505 % to install a ligfull |.pl| file.
506 %
507 % \begin{macrocode}
508 \def\fake_shape_o_raw_encoding{
509 \if_file_exists{
510 \font_family\font_weight\raw_variant
511 \raw_encoding\font_width.mtx
512 }\then
513 \if_file_exists{
514 \font_family\font_weight\font_shape\raw_variant
515 \raw_encoding\font_width.mtx
516 }\then % no action required
517 \else
518 %<*debug>
519 \immediate\write16{
520 INFO>~run~\string\transformfont\space\space
521 <\font_family\font_weight\font_shape\raw_variant
522 \raw_encoding\font_width>~from~
523 <\font_family\font_weight\raw_variant
524 \raw_encoding\font_width>~(faking~oblique)
525 }
526 %</debug>
527 %%% WARNING: famtool.pl relies on this message format!!!
528 \immediate\write16{
529 Faking~oblique~font~
530 \font_family\font_weight\font_shape\raw_variant
531 \raw_encoding\font_width
532 \space from~
533 \font_family\font_weight\raw_variant
534 \raw_encoding\font_width
535 }
536 \transformfont{
537 \font_family\font_weight\font_shape\raw_variant
538 \raw_encoding\font_width
539 }{
540 \slantfont{\SlantAmount}{
541 \frommtx{
542 \font_family\font_weight\raw_variant
543 \raw_encoding\font_width
544 }
545 }
546 }
547 \if_file_exists{ \raw_encoding.mtx }\then
548 %<*debug>
549 \immediate\write16{
550 INFO>~run~\string\installrawfont\space
551 <\font_family\font_weight\font_shape\raw_variant
552 \raw_encoding\font_width>
553 <\font_family\font_weight\font_shape\raw_variant
554 \raw_encoding\font_width,
555 \raw_encoding>
556 <\raw_encoding>
557 <\raw_encoding>
558 <\latex_family>
559 <\latex_weight\latex_width>
560 <\latex_shape>}
561 %</debug>
562 \installrawfont{
563 \font_family\font_weight\font_shape\raw_variant
564 \raw_encoding\font_width
565 }{ \font_family\font_weight\font_shape\raw_variant
566 \raw_encoding\font_width,
567 \raw_encoding
568 }{ \raw_encoding
569 }{ \raw_encoding
570 }{ \latex_family
571 }{ \latex_weight\latex_width
572 }{ \latex_shape
573 }{}
574 \fi
575 \fi
576 \fi
577 }
578 % \end{macrocode}
579 % \end{macro}
580 %
581 % \begin{macro}{\fake_shape_o_expert_encoding}
582 % Called from |\fake_shape_o| if the oblique shape needs to be faked.
583 % Invokes
584 % \begin{quote}
585 % |\transformfont{<FONT>o8x}|\\
586 % | {\slantfont{SLANT}{\frommtx{<FONT>8x}}}|
587 % \end{quote}
588 % to generate an |8x|-reencoded |.mtx| file (and a raw |.pl| file).
589 %
590 % \begin{macrocode}
591 \def\fake_shape_o_expert_encoding{
592 \if_file_exists{
593 \font_family\font_weight\raw_variant
594 \expert_encoding\font_width.mtx
595 }\then
596 \if_file_exists{
597 \font_family\font_weight\font_shape\raw_variant
598 \expert_encoding\font_width.mtx
599 }\then % no action required
600 \else
601 %<*debug>
602 \immediate\write16{
603 INFO>~run~\string\transformfont\space\space
604 <\font_family\font_weight\font_shape\raw_variant
605 \expert_encoding\font_width>~from~
606 <\font_family\font_weight\raw_variant
607 \expert_encoding\font_width>~(faking~oblique)
608 }
609 %</debug>
610 %%% WARNING: famtool.pl relies on this message format!!!
611 \immediate\write16{
612 Faking~oblique~font~
613 \font_family\font_weight\font_shape\raw_variant
614 \expert_encoding\font_width
615 \space from~
616 \font_family\font_weight\raw_variant
617 \expert_encoding\font_width
618 }
619 \transformfont{
620 \font_family\font_weight\font_shape\raw_variant
621 \expert_encoding\font_width
622 }{
623 \slantfont{\SlantAmount}{
624 \frommtx{
625 \font_family\font_weight\raw_variant
626 \expert_encoding\font_width
627 }
628 }
629 }
630 \fi
631 \fi
632 }
633 % \end{macrocode}
634 % \end{macro}
635 %
636 % \begin{macro}{\fake_shape_o_oldstyle_encoding}
637 % Called from |\fake_shape_o| if the oblique shape needs to be faked.
638 % Invokes
639 % \begin{quote}
640 % |\transformfont{<FONT>oj8r}|\\
641 % | {\slantfont{SLANT}{\frommtx{<FONT>j8r}}}|
642 % \end{quote}
643 % to generate an |8r|-reencoded |.mtx| file (and a raw |.pl| file).
644 %
645 % \begin{macrocode}
646 %<*oldstyle>
647 \def\fake_shape_o_oldstyle_encoding{
648 \if_file_exists{
649 \font_family\font_weight\oldstyle_variant
650 \raw_encoding\font_width.mtx
651 }\then
652 \if_file_exists{
653 \font_family\font_weight\font_shape\oldstyle_variant
654 \raw_encoding\font_width.mtx
655 }\then % no action required
656 \else
657 %<*debug>
658 \immediate\write16{
659 INFO>~run~\string\transformfont\space\space
660 <\font_family\font_weight\font_shape\oldstyle_variant
661 \raw_encoding\font_width>~from~
662 <\font_family\font_weight\oldstyle_variant
663 \raw_encoding\font_width>~(faking~oblique)
664 }
665 %</debug>
666 %%% WARNING: famtool.pl relies on this message format!!!
667 \immediate\write16{
668 Faking~oblique~font~
669 \font_family\font_weight\font_shape\oldstyle_variant
670 \raw_encoding\font_width
671 \space from~
672 \font_family\font_weight\oldstyle_variant
673 \raw_encoding\font_width
674 }
675 \transformfont{
676 \font_family\font_weight\font_shape\oldstyle_variant
677 \raw_encoding\font_width
678 }{
679 \slantfont{\SlantAmount}{
680 \frommtx{
681 \font_family\font_weight\oldstyle_variant
682 \raw_encoding\font_width
683 }
684 }
685 }
686 \fi
687 \fi
688 }
689 %</oldstyle>
690 % \end{macrocode}
691 % \end{macro}
692 %
693 %
694 % \begin{macro}{\fake_shape_i}
695 % Call |\fake_shape_| to generate an |8r|-reencoded |.mtx| file and a
696 % ligfull |.pl| file, if a corresponding |8a|-encoded |.afm| file exists.
697 % Otherwise, do nothing, since an italic shape can't be faked.
698 %
699 % \begin{macrocode}
700 \let\fake_shape_i\fake_shape_ % We must do this again!
701 % \end{macrocode}
702 % \end{macro}
703 %
704 %
705 % \subsection{Faking font widths}
706 %
707 % \begin{macro}{\if_fake_narrow_}
708 % \begin{macrocode}
709 \newif\if_fake_narrow_
710 \_fake_narrow_false
711 % \end{macrocode}
712 % \end{macro}
713 %
714 % \begin{macro}{\fakenarrow}
715 % |\fakenarrow{WIDTH}|
716 %
717 % Sets the expansion factor used to generate faked narrow fonts.
718 % If it isn't set, do not attempt to install faked narrow fonts.
719 % \begin{macrocode}
720 \def\fakenarrow#1{
721 \_fake_narrow_true
722 \gdef\fake_narrow_width{#1}
723 }
724 % \end{macrocode}
725 % \end{macro}
726 %
727 % \begin{macro}{\fake_width_}
728 % Do nothing for the default width or the condensed width.
729 % \begin{macrocode}
730 \def\fake_width_{}
731 \def\fake_width_c{}
732 % \end{macrocode}
733 % \end{macro}
734 %
735 % \begin{macro}{\fake_width_n}
736 % If we are faking narrow fonts, check if an |8a|-encoded |.afm| file
737 % exists for the current shape in narrow width, and if not call
738 % |\fake_shape_n_raw_encoding| and |\fake_shape_n_expert_encoding|.
739 %
740 % \begin{macrocode}
741 \def\fake_width_n{
742 \if_fake_narrow_
743 \if_file_exists{
744 \font_family\font_weight\raw_shape\raw_variant
745 \adobe_encoding\font_width.afm
746 }\then % no action required
747 \else
748 \fake_width_n_raw_encoding
749 \if_expert_
750 \fake_width_n_expert_encoding
751 \fi
752 \fi
753 \fi
754 }
755 % \end{macrocode}
756 % \end{macro}
757 %
758 % \begin{macro}{\fake_width_n_raw_encoding}
759 % Called from |\fake_width_n| if the narrow width needs to be faked.
760 % Invokes
761 % \begin{quote}
762 % |\transformfont{<FONT>8rn}|\\
763 % | {\xscalefont{WIDTH}{\frommtx{<FONT>8r}}}|
764 % \end{quote}
765 % to generate an |8r|-encoded |.mtx| file for a faked narrow font,
766 % followed by
767 % \begin{quote}
768 % |\installrawfont{<FONT>8rn}{<FONT>8rn,8r}{8r}...|
769 % \end{quote}
770 % to install a ligfull |.pl| file.
771 %
772 % \begin{macrocode}
773 \def\fake_width_n_raw_encoding{
774 \if_file_exists{
775 \font_family\font_weight\font_shape\raw_variant
776 \raw_encoding.mtx
777 }\then
778 \if_file_exists{
779 \font_family\font_weight\font_shape\raw_variant
780 \raw_encoding\font_width.mtx
781 }\then % no action required
782 \else
783 %<*debug>
784 \immediate\write16{
785 INFO>~run~\string\transformfont\space\space
786 <\font_family\font_weight\font_shape\raw_variant
787 \raw_encoding\font_width>~from~
788 <\font_family\font_weight\font_shape\raw_variant
789 \raw_encoding>~(faking~narrow)
790 }
791 %</debug>
792 %%% WARNING: famtool.pl relies on this message format!!!
793 \immediate\write16{
794 Faking~narrow~font~
795 \font_family\font_weight\font_shape\raw_variant
796 \raw_encoding\font_width
797 \space from~
798 \font_family\font_weight\font_shape\raw_variant
799 \raw_encoding
800 }
801 \transformfont{
802 \font_family\font_weight\font_shape\raw_variant
803 \raw_encoding\font_width
804 }{
805 \xscalefont{\fake_narrow_width}{
806 \frommtx{
807 \font_family\font_weight\font_shape\raw_variant
808 \raw_encoding
809 }
810 }
811 }
812 \if_file_exists{ \raw_encoding.mtx }\then
813 %<*debug>
814 \immediate\write16{
815 INFO>~run~\string\installrawfont\space
816 <\font_family\font_weight\font_shape\raw_variant
817 \raw_encoding\font_width>
818 <\font_family\font_weight\font_shape\raw_variant
819 \raw_encoding\font_width,
820 \raw_encoding>
821 <\raw_encoding>
822 <\raw_encoding>
823 <\latex_family>
824 <\latex_weight\latex_width>
825 <\latex_shape>}
826 %</debug>
827 \installrawfont{
828 \font_family\font_weight\font_shape\raw_variant
829 \raw_encoding\font_width
830 }{ \font_family\font_weight\font_shape\raw_variant
831 \raw_encoding\font_width,
832 \raw_encoding
833 }{ \raw_encoding
834 }{ \raw_encoding
835 }{ \latex_family
836 }{ \latex_weight\latex_width
837 }{ \latex_shape
838 }{}
839 \fi
840 \fi
841 \fi
842 }
843 % \end{macrocode}
844 % \end{macro}
845 %
846 % \begin{macro}{\fake_width_n_expert_encoding}
847 % Called from |\fake_width_n| if the narrow width needs to be faked.
848 % Invokes
849 % \begin{quote}
850 % |\transformfont{<FONT>8xn}|\\
851 % | {\xscalefont{WIDTH}{\frommtx{<FONT>8x}}}|
852 % \end{quote}
853 % to generate an |8x|-encoded |.mtx| file for a faked narrow font.
854 %
855 % \begin{macrocode}
856 \def\fake_width_n_expert_encoding{
857 \if_file_exists{
858 \font_family\font_weight\font_shape\raw_variant
859 \expert_encoding.mtx
860 }\then
861 \if_file_exists{
862 \font_family\font_weight\font_shape\raw_variant
863 \expert_encoding\font_width.mtx
864 }\then % no action required
865 \else
866 %<*debug>
867 \immediate\write16{
868 INFO>~run~\string\transformfont\space\space
869 <\font_family\font_weight\font_shape\raw_variant
870 \expert_encoding\font_width>~from~
871 <\font_family\font_weight\font_shape\raw_variant
872 \expert_encoding>~(faking~narrow)
873 }
874 %</debug>
875 %%% WARNING: famtool.pl relies on this message format!!!
876 \immediate\write16{
877 Faking~narrow~font~
878 \font_family\font_weight\font_shape\raw_variant
879 \expert_encoding\font_width
880 \space from~
881 \font_family\font_weight\font_shape\raw_variant
882 \expert_encoding
883 }
884 \transformfont{
885 \font_family\font_weight\font_shape\raw_variant
886 \expert_encoding\font_width
887 }{
888 \xscalefont{\fake_narrow_width}{
889 \frommtx{
890 \font_family\font_weight\font_shape\raw_variant
891 \expert_encoding
892 }
893 }
894 }
895 \fi
896 \fi
897 }
898 % \end{macrocode}
899 % \end{macro}
900 %
901 %
902 % \subsection{Installing reencoded fonts}
903 %
904 % \begin{macro}{\latin_encoding}
905 % \begin{macro}{\font_encoding}
906 % \begin{macro}{\latex_encoding}
907 % \begin{macro}{\latex_mtx}
908 %
909 % |\latin_encoding{FONTENC}{EXPERTISED-ENC}{OLDSTYLE-ENC}|
910 % |{LATEXENC}{LATEXMTX}|
911 %
912 % If this is an expertised family |EXPERTISED-ENC| is used instead
913 % of |FONTENC|. If this is an expertised family with oldstyle
914 % digits |OLDSTYLE-ENC| is used instead of |EXPERTISED-ENC|.
915 %
916 % UV 06/98: Added code for oldstyle encodings from Alan's v~1.511.
917 % The |\font_encoding| is changed when |\if_oldstyle_| is true.
918 %
919 % UV 06/98: Added anonther parameter for the default metrics file
920 % (which is usually either |latin.mtx| or |textcomp.mtx|).
921 %
922 % UV 06/98: Added experimental code for OsF or SC\&OsF fonts.
923 %
924 % \begin{macrocode}
925 \def\latin_encoding#1#2#3#4#5{
926 \gdef\latex_encoding{#4}
927 \gdef\latex_mtx{#5}
928 \if_oldstyle_
929 \gdef\font_encoding{#3}
930 \else\if_expert_
931 \gdef\font_encoding{#2}
932 \else
933 \gdef\font_encoding{#1}
934 \fi\fi
935 \gdef\expert_font{}
936 \gdef\oldstyle_font{}
937 \if_expert_
938 \if_file_exists{
939 \font_family\font_weight\raw_shape\raw_variant
940 \expert_encoding\font_width.mtx
941 }\then
942 \gdef\expert_font{
943 \font_family\font_weight\raw_shape\raw_variant
944 \expert_encoding\font_width,
945 }
946 \fi
947 \fi
948 %<*oldstyle>
949 \if_oldstyle_
950 \if_file_exists{
951 \font_family\font_weight\raw_shape\oldstyle_variant
952 \raw_variant\raw_encoding\font_width.mtx
953 }\then
954 \gdef\oldstyle_font{
955 unsetnum,
956 \font_family\font_weight\raw_shape\oldstyle_variant
957 \raw_variant\raw_encoding\font_width,
958 resetosf,
959 }
960 \fi
961 \fi
962 %</oldstyle>
963 %<*debug>
964 \immediate\write16{
965 INFO>~run~\string\installfont\space
966 <\font_family\font_weight\font_shape\font_variant
967 \font_encoding\font_width>
968 <\font_family\font_weight\raw_shape\raw_variant
969 \raw_encoding\font_width,
970 \if_oldstyle_
971 \ifx\raw_shape\caps_shape
972 resetosf,
973 \fi
974 \fi
975 \expert_font
976 \oldstyle_font
977 \latex_mtx>
978 <\latex_encoding\encoding_shape>
979 <\latex_encoding>
980 <\latex_family>
981 <\latex_weight\latex_width>
982 <\latex_shape>}
983 %</debug>
984 \installfont{
985 \font_family\font_weight\font_shape\font_variant
986 \font_encoding\font_width
987 }{
988 \font_family\font_weight\raw_shape\raw_variant
989 \raw_encoding\font_width,
990 \if_oldstyle_
991 \ifx\raw_shape\caps_shape
992 resetosf,
993 \fi
994 \fi
995 \expert_font
996 \oldstyle_font
997 \latex_mtx
998 }{
999 \latex_encoding\encoding_shape
1000 }{
1001 \latex_encoding
1002 }{
1003 \latex_family
1004 }{
1005 \latex_weight\latex_width
1006 }{
1007 \latex_shape
1008 }{}
1009 }
1010 % \end{macrocode}
1011 % \end{macro}
1012 % \end{macro}
1013 % \end{macro}
1014 % \end{macro}
1015 %
1016 % \subsection{Default weights, widths and shapes}
1017 %
1018 % \begin{center}
1019 % \begin{tabular}{llll}
1020 % \hline
1021 % \multicolumn{2}{l}{Fontname: \texttt{weight.map}} &
1022 % \multicolumn{2}{l}{NFSS: \emph{\LaTeX\ Companion}, p.~190} \\
1023 % \hline
1024 % |a| & Thin Hairline & |ul| & Ultra Light \\
1025 % |j| & ExtraLight & |el| & Extra Light \\
1026 % |l| & Light & |l| & Light \\
1027 % |r| & Regular Roman & |m| & Medium \\
1028 % |k| & Book & |m| & Medium \\
1029 % |m| & Medium & |mb| & (was: |m|) \\
1030 % |d| & Demi & |db| & (was: |sb|) \\
1031 % |s| & Semibold & |sb| & Semibold \\
1032 % |b| & Bold & |b| & Bold \\
1033 % |h| & Heavy Heavyface & |eb| & (was missing) \\
1034 % |c| & Black & |eb| & (was missing) \\
1035 % |x| & ExtraBold ExtraBlack & |eb| & Extra Bold \\
1036 % |u| & Ultra UltraBlack & |ub| & Ultra Bold \\
1037 % |p| & Poster & & (still missing) \\
1038 % \hline
1039 % \end{tabular}
1040 % \end{center}
1041 %
1042 % \begin{macro}{\latin_weights}
1043 % Each call to |\latin_weight| maps a Fontname weight code
1044 % (|\font_weight|) to a \LaTeX{} weight code (|\latex_weight|).
1045 % Non-existing weights are ignored (or substituted when the
1046 % |.fd| files are written out by |\endinstallfont|).
1047 %
1048 % The standard values are given in the table. They may be changed,
1049 % but you'd better know what you're doing.
1050 %
1051 % UV, 04/98: Changed the processing order: Do the most common
1052 % shapes first. Added new mappings for |c| and |h|, changed
1053 % mapping for |m| to newly invented \LaTeX{} weight |mb|.
1054 %
1055 % \begin{macrocode}
1056 \def\latin_weights{
1057 \latin_weight{r}{m}
1058 \latin_weight{k}{m}
1059 \latin_weight{b}{b}
1060 \latin_weight{s}{sb}
1061 \latin_weight{d}{db} % was {d}{sb}, SPQR changed
1062 \latin_weight{m}{mb} % was {m}{m}, UV changed
1063 \latin_weight{c}{eb} % UV added
1064 \latin_weight{h}{eb} % UV added
1065 \latin_weight{x}{eb}
1066 \latin_weight{u}{ub}
1067 \latin_weight{l}{l}
1068 %\latin_weight{j}{el}
1069 %\latin_weight{a}{ul} % UV added
1070 }
1071 % \end{macrocode}
1072 % \end{macro}
1073 %
1074 % \begin{center}
1075 % \begin{tabular}{llll}
1076 % \hline
1077 % \multicolumn{2}{l}{Fontname: \texttt{width.map}} &
1078 % \multicolumn{2}{l}{NFSS: \emph{\LaTeX\ Companion}, p.~190} \\
1079 % \hline
1080 % |t| & Thin & -- & -- \\
1081 % |o| & Ultra Condensed & |uc| & Ultra Condensed \\
1082 % |u| & Ultra Compressed & |uc| & . . \\
1083 % |q| & Extra Compressed & |ec| & Extra Condensed \\
1084 % |c| & Condensed & |c| & Condensed \\
1085 % |p| & Compressed & |c| & . . \\
1086 % |n| & Narrow & |c| & . . \\
1087 % -- & -- & |sc| & Semi Condensed \\
1088 % |r| & Normal, Medium, Regular & |m| & Medium \\
1089 % -- & -- & |sx| & Semi Expanded \\
1090 % |e| & Expanded & |x| & Expanded \\
1091 % |x| & Extended & |x| & . . \\
1092 % |v| & Extra Expanded & |ex| & Extra Expanded \\
1093 % -- & -- & |ux| & Ultra Expanded \\
1094 % |w| & Wide & -- & -- \\
1095 % \hline
1096 % \end{tabular}
1097 % \end{center}
1098 %
1099 % \begin{macro}{\latin_widths}
1100 % Each call to |\latin_width| maps a Fontname width code
1101 % (|\font_width|) to a \LaTeX{} width code (|\latex_width|).
1102 % Non-existing narrow fonts are faked only if |\fakenarrow|
1103 % is specifically called for.
1104 %
1105 % \begin{macrocode}
1106 \def\latin_widths{
1107 \latin_width{}{}
1108 \latin_width{n}{c}
1109 %latin_width{c}{c}
1110 %latin_width{x}{x}
1111 }
1112 % \end{macrocode}
1113 % \end{macro}
1114 %
1115 % \begin{macro}{\latin_shapes}
1116 % The fifth argument of |\latin_shape| is stored in the variable
1117 % |\encoding_switches|.
1118 % \begin{macrocode}
1119 \def\latin_shapes{
1120 \latin_shape{} {} {} {n} {\_textcomp_true }
1121 \latin_shape{c}{c}{} {sc}{\_textcomp_false}
1122 \latin_shape{o}{o}{} {sl}{\_textcomp_true }
1123 \latin_shape{i}{i}{i}{it}{\_textcomp_true }
1124 }
1125 % \end{macrocode}
1126 % \end{macro}
1127 %
1128 % \begin{macro}{\latin_encodings}
1129 % |\encoding_switches| is evaluated immediatley before the
1130 % |\if_textcomp_| test to set it as appropriate for the curent shape.
1131 % \changes{1.925}{2003/03/31}{Changed from using \texttt{latin.mtx} to
1132 % \texttt{newlatin.mtx}. (LH)}
1133 % \begin{macrocode}
1134 \def\latin_encodings{
1135 \latin_encoding{7t}{9t}{9o}{OT1}{newlatin}
1136 \latin_encoding{8t}{9e}{9d}{T1} {newlatin}
1137 %<*textcomp>
1138 \encoding_switches
1139 \if_textcomp_
1140 \latin_encoding{8c}{9c}{9c}{TS1}{textcomp}
1141 \fi
1142 %</textcomp>
1143 }
1144 % \end{macrocode}
1145 % \end{macro}
1146 %
1147 % \begin{macro}{\if_textcomp_}
1148 % Switch to control whether or not to install a text companion
1149 % encoding. It is set or unset for each shape by |\latin_shapes|
1150 % and evaluated in |\latin_encodings|.
1151 %
1152 % \begin{macrocode}
1153 \newif\if_textcomp_
1154 % \end{macrocode}
1155 % \end{macro}
1156
1157 %
1158 % \begin{macro}{\raw_encoding}
1159 % \begin{macro}{\adobe_encoding}
1160 % \begin{macro}{\expert_encoding}
1161 % \begin{macrocode}
1162 \def\raw_encoding{8r}
1163 \def\adobe_encoding{8a}
1164 \def\expert_encoding{8x}
1165 % \end{macrocode}
1166 % \end{macro}
1167 % \end{macro}
1168 % \end{macro}
1169
1170 % \begin{macro}{\caps_shape}
1171 % \begin{macro}{\oldstyle_shape}
1172 % \begin{macrocode}
1173 \def\caps_shape{c}
1174 \def\oldstyle_shape{j}
1175 % \end{macrocode}
1176 % \end{macro}
1177 % \end{macro}
1178 %
1179 % \begin{macro}{\SlantAmount}
1180 % \begin{macrocode}
1181 \def\SlantAmount{167}
1182 %</pkg>
1183 % \end{macrocode}
1184 % \end{macro}
1185 %
1186 % \Finale
1187 \endinput