A Postscript Font Installation Package Written in TEX
Total Page:16
File Type:pdf, Size:1020Kb
A PostScript Font Installation Package Written in TEX Alan Jeffrey School of Cognitive and Computing Sciences University of Sussex Falmer Brighton BN1 9QH UK Internet: a1 an jeecogs. susx.ac. uk Abstract Ths paper describes a font installation package written entirely in TEX. It can parse Adobe Font Metric and Font Encoding files, and convert them into Prop- erty List and Virtual Property List files, for processing with pltotf and vptovf. Since it is written in TEX, it is very custornizable, and can deal with arbitrary font encodings, as well as mathematics fonts. Introduction The most important difference between ths package and other PostScript font installation packages (such This paper describes fonti nst version 0.19, a pro- as Rokicki's (1993) afm2tfm, used in Rahtz's (1993) totype font installation package for PostScript fonts psnfss) is that it is written in TEX rather than C, (or any other fonts with font metrics given in Adobe and so can be more easily customized by the user to Font Metric format). This package: deal with non-standard encodings and mathematical Is written in TEX, for maximum portabhty (at fonts. At the moment, only the T1 (Cork) encoding the cost of speed). is supported, but mathematical fonts will be added Supports as much of the Cork encoding as once an 8-bit font standard can be agreed upon. possible. Allows fonts to be generated in an arbitrary Usage encoding, with arbitrary 'fake' characters, There are four ways to generate fonts using the for example, the 'ij' character can be faked if fonti nst package: necessary by putting an 'i' next to a 'j'. The simplest method to install the 'varda' Allows caps and small caps fonts with letter fonts (Times, Courier and Helvetica) with spacing and kerning. the T1 (Cork) encoding is to run TEX on Allows kerning to be shared between fontvani . tex. characters, for example, 'ij' can be kerned If you want to install other TI fonts, you can on the left as if it were an 'i' and on the edit fontvani . tex to create a TEX file which right as if it were a 'j'. This is useful, installs your fonts. since many PostScript fonts only include a Alternatively, you can run TEX on the lile kerning information for characters without fontinst. tex and get an interactive prompt, diacriticals. wbch asks you for details on the fonts you Allows the generation of math fonts with want to install. nextlarger, varchar, and arbitrary font If you want to install some fonts in a dmensions. non-Cork encoding, you can create new Allows more than one PostScript font to encodmg files. These consist of: a macros file, contribute to a TEX font, for example, the 'ffi' a PostScript encoding vector, and a 'fudge' file ligatures for a font can be taken from the containing all the information that TEX needs Expert encoding, if you have it. that isn't contained in the afm lile. Automatically generates an fd file for use with In each case, the fonti nst package creates a nurn- version 2 of the New Font Selection Scheme. ber of files: Can be customized by the user to deal with filename. pl contains the Property List of each arbitrary font encodings. PostScript font. You should convert it to a TEX TUGboat, Volume 14 (1993), No. 3 -Proceedings of the 1993 Annual Meeting 285 Alan Jeffrey font metric with pl totf, and then delete the ptmbq roman, bold weight. pl file. ptmbi q italic, bold weight. filename. vpl contains the Virtual Property rn ptmbcq caps and small caps, bold weight. List of each TEX font. You should convert it Each of these fonts may be built from more than to a TEX font metric and a Virtual Font with one PostScript font, for example, ptmrq might use vptovf, and then delete the vp1 file. Times-Roman for most characters, and the Expert filename. f d contains the LATEX Font set for the ffi and ffl Ligatures. Definitions for each family. If you are using When you run TEX on fontinst. tex you are version 2 of the New Font Selection Scheme, prompted for information on the font family you you can use these to access the font family by would llke to install. For each famdy, you are promp- saying \font fami 1y{family name}. ted for: filename. atx is a temporary file containing \Fami 1yName, for example, Adobe Times a translation of an afm file into a syntax that Roman is ptm. can be read by TEX, and can be deleted. \Fami 1yEncodi ng, for example, TI. filename. etx is a temporary file containing Each famly can include a number of fonts, and a translation of a PostScript encoding vector you will be prompted for mformation about each into a syntax that can be read by TEX, and can of them: be deleted. \FontName, for example, Adobe Times Roman Vanilla Fonts is ptmrq. s \FontEncodi ng, for example, Tlul c (for T1 To install the vanilla fonts, you just copy the follow- upper and lower case) or Tlcsc (for T1 caps ing afm files into a directory read by TEX, and run TEX and small caps). on fontvani tex. \Fontweight, for example, m (medium) or b Ti mes-Roman Ti mes-Ital i c (bold). Ti mes-Bo1 d Times-BoldItalic \Fontshape, for example, n (normal), sl Courier Couri er-Obl i que (oblique), it (italic) or sc (caps and small Courier-Bold Courier-Boldoblique caps). He1 veti ca Helveti ca-Obl i que Helveti ca-Bold Helveti ca-BoldObl ique Each TEX font can be built from a number of Post- Script fonts. For each Postscript font you will be This installs the Times, Courier and Helvetica famil- asked for: ies, in bold and normal weights, with roman, italic, and small caps variants. If you would like to install \AFMName, for example, Adobe Times is other PostScript fonts, the simplest thing to do is Ti mes-Roman. edit fontvani . tex. For example, to generate the \AFMShortName, for example, Adobe Times Palatino fonts, you can say: Roman is ptmr0. \makevanilla{ppt} \AFMEncodi ng, for example, adobe (for Adobe {Pal ati no}{Palati no-Ital i c} Standard Encoding) or expert (for Adobe {Pal ati no-Obl ique}{Pal atino-Bol dl Expert Encoding). {Pal ati no-Bol dIta1i c} Using font inst in Other Macro Packages {Pal ati no-Bol dObl i que} If you run TEX on fonti nst . tex, you will be promp- Prompts ted interactively about the fonts you want to in- When you run TEX on fontinst.tex, you Mill1 be stall. Sometimes this is not what you want, for ex- prompted for mformation about the fonts you are ample, fontvani . tex uses the macros defined in going to install. For each font family, you can specify fonti nst. tex without running the prompt. This is a number of TEX fonts, which can in turn be built achieved by having fonti nst. tex check to see if a from a number of PostScript fonts. For example, the macro \noprompt is defined. So if you want to use Times Roman (ptm) font famdy consists of the fonts: fonti nst . tex yourself, you should say: ptmrq roman, medium weight. \def\noprompt{!} \input fonti nst ptmri q italic, medium weight. The most useful commands given by fonti nst . tex rn ptmrcq caps and small caps, medium weight. are: 286 TUGboat, Volume 14 (1993), No. 3 -Proceedings of the 1993 Annual Meeting A PostScript Font Installation Package Written in TEX \makef ami 1y {commands} This generates \afmuni ts is the length of one afm unit. a font famdy named \Fami 1yName with There are usually 1000 afm units to the encodmg \Fami 1yEncodi ng using the em-quad. \maketexfont commands. \itsl ant is the italic slant, measured in \maketexfont{commands) Ths generates points. Ths is normally assigned to font a TEX font named \FontName with encoding dimension 1. \FontEncoding, weight \Fontweight and \xhei ght is the x-height of the font, shape \Fontshape using the \makerawfont measured in afm units. This is usually commands. assigned to font dimension 5. \makerawfont Ths generates a PostScript \capheight is the capital height of the font, font named \AFMName with short name measured in afm units. \AFMShortName and encoding \AFMEncodi ng. \ascender is the ascender height of the font, For example, to generate a family consisting of just measured in afm units. Adobe Times Roman you could say: \under1 inethi ckness is the rule width of \def\FamilyName{ptm} the font, measured in afm units. \def\Fami 1yEncodi ng{Tl} \iffi xedpi tch is true if the font is \makefami 1y{ monoweight. \def\FontName{ptmr} \getchar{glyph} globally sets the following \def\FontEncoding{Tlul c} parameters: \def\FontWeight{m} - \chardp, \charht, \chari c and \def\FontShape{n} \charwd are the dimensions of the \maketexfont{ character and its italic correction. These \def\AFMName{Times-Roman) are given in points. \def\AFMShortName{rptmr} - \map is a token list consisting of the MAP \def\AFMEncodi ng{adobe} instructions used to generate the glyph. 1 For example, to set character 123 from 1 font 0, followed by character 45 from Installing a New Encoding font 2, \map would be set to: (SETCHAR D 123) The main advantage of using a font installation pack- (SELECTFONT D 2) age written in TEX is that it is very custornizable. To (SETCHAR D 45) install a font in a new encoding, you just have to - \startfont is the font number the generate a new enc file, a new mac file and a new character expects to start in, and fud file.