A Typesetter's Toolkit
Total Page:16
File Type:pdf, Size:1020Kb
A Typesetter's Toolht Pierre A. MacKay Department of Classics DH-10, Department of Near Eastern Languages and Civilization (DH-20) University of Washington, Seattle, WA 98195 U.S.A. Internet: mackayecs .washi ngton .edu Abstract Over the past ten years, a variety of publications in the humanities has required the development of special capabilities, particularly in fonts for non-English text. A number of these are of general interest, since they involve strategies for remapping fonts and for generating composite glyphs from an existing repertory of simple characters. Techniques for selective compilation and remapping of METAFONTs are described here, together with a program for generating Postscript-style Adobe Font Metrics from Computer Modern Fonts. Introduction usually start out in a technology that was out of date in the first place. In the past year we have History. For the past ten years I have served as had to work with one text made up of extensive the technical department of a typesetting effort quotations from Greek inscriptions, composed in which produces scholarly publications for the fields a version of RUNOFF dating from about 1965 and of Classics and Near Eastern Languages, with occa- modified by an unknown hand to produce Greek sional forays into the related social sciences. Right on an unknown printer. The final version of the from the beginning these texts have presented the manuscript was submitted to the editorial board in challenge of special characters, both simplex and 1991. I have no idea when the unique adaptation for composite. We have used several different roman- epigraphical Greek was first written. At least I know izations for Arabic, Persian and Turkish, and at what RUNOFF is. A subsequent text arrived in 1992 least three conventions for fully accented Ancient composed, with passages in both Greek and Latin, in Greek: book text, epigraphical and numismatic. a system named SAMNA, about which we could find The presses we deal with will sometimes accept out nothing at all at the time. (The reviewer of this the default Computer Modern, which looks very paper kindly informed me that it is a mid-range PC handsome indeed when set in a well designed page, wordprocessor, but in our case I got the impression but they often have a house style or a series style that we were dealing with a mainframe program.) that requires some font not available in METAFONT The editor of a humanities series is not at coding. Special characters are still needed even in liberty to set the kind of conditions that were set for those styles, but fortunately we have not yet had to submissions to this session of the TEX Users Group. create any completely new glyphs for the Postscript You do not tell a scholar who has fought through Type 1 fonts we rely on, only to modify existing twenty years to the completion of a monograph that glyphs. he must now retype the entire thing in a different To appreciate the constraints we are under, you convention. Each monograph is a unique problem, have to remember that most of our work is in the with unique demands for special fonts, formatting humanities, and that the humanities are the Third and coding. So the first items in our toolkit are World in the scholarly famdy of nations. It is an odd general tools for remapping and character selection, correlation, but apparently a sound one, that the simple but powerful tools for any work in font most productive of humanities scholars, is probably development. These tools preserve the integrity of going to be the one with the least access to useful the basic character designs in a font, eliminate the technology. If you are ever curious about items of proliferation of dialect versions of public source industrial archaeology such as the original KayPro files, and make the effort of development much microcomputer, search among the humanists of simpler and faster. your local university, and you may find a dozen We have had to explore both METAFONT and or so still in use. Humanist manuscripts are often Postscript rather intensely for some of this work, the result of fifteen or twenty years' effort, and and to do so under considerable pressure. (It is 2 74 TUGboat, Volume 15 (1994),No. 3 -Proceedings of the 1994 Annual Meeting A Typesetter's Toolkit surprising how often a really complex typesetting not merely a wasteful approach, it was intrinsically task arrives with the request that it be returned a bad one. Over the past ten years, various changes as final camera-ready copy some time the previous have been made to the Computer Modern character week.) This paper describes some of the tools we files, and I am virtually certain that most of the have developed in and around the basic TEX and copies of s romanu .mf across the world have not METAFONT utilities. Not all the tools are written kept up with those changes. In ths particular in TEX and METAFONT coding. It is undoubtedly instance it could be argued that it doesn't much possible to write a serviceable awk interpreter in TEX matter, but there are dozens of other places where macros, but when the pressure is on, the fact that literal copies of Knuth's Computer Modern have awk and sed are already to hand in any Unix system been used unnecessarily, and where the probability is irresistible. Since contributors to the software is very strong that they have been let go stale distributions of the Free Software Foundation are whde small improvements were made to the official malung many of these tools available even outside release. The present UnixT~xrelease of s romanu .mf the Unix realm, the mention of them is no longer to is quite small, and runs no risk of missing out on be condemned as purely Unix Cultural Imperialism. changes in the basic romanu .mf .' (For an extract from s romanu .mf, see the Appendix.) METAFONT Tools Silvio Levy's Greek font provides another exam- ple very much to the point. In order to achieve the Selection from existing character files. One of maximum compatibility with Computer Modern for our earliest METAFONT tools came out of the bilingual texts, the uppercase letters of the Greek need to experiment expeditiously with numerous alphabet in this font were copied from romanu .mf mode-defs for laser-printers. To do thls conscien- and greeku. mf, given different code positions, and tiously, you have to manipulate at least two of the collected into the file upper .mf in the original re- usual mode-def parameters, blacker and f i 11i n, lease. So far as I know, no change has been made and you have to do it at several resolutions, so as to in upper. mf in many years, although the Computer be sure that you have reached a compromise that is Modern sources have seen several small changes. A reasonable over the normal range of text sizes from more efficient approach than making a copy of the seven to fourteen point, and not utterly impossible character files is gri byupr .mf. (An extract is given above and below those sizes. Since blacker and in the Appendix.) This generates the entire upper- fi11 in interact with one another in unexpected case Greek alphabet, including a lunate uppercase ways, this evaluation can become impossibly bur- sigma and a digamma, without any new character densome if an entire font must be generated for each design code being provided at all. The Computer attempt. I chose therefore to borrow from Knuth's Modern sources are treated as read-only files, as test files, and produced modetest.mf, which is a they ought to be, and remapped into a convenient straight steal, modified very slightly so that the order in the Greek font. The mapping in evidence characteristic use-i t/l ose-i t macros will not be here is actually for a font associated with modified confused with Knuth's version. (An extract from Thesaurus Linguae Graecae Beta-code, not for Silvio modetest. mf is given in the Appendix.) Levy's original fonts, and extensive remapping and Because the if . fi construction is about even character substitution is done in other parts the first test applied to either TEX or METAFONT of the font as well. But Silvio Levy's files are never input, discarding unwanted characters in this way altered. They are treated as a read-only resource wastes very little time and races through to produce throughout. a selective minifont in only a few seconds on a medium-fast workstation. The process of evaluating the results can be further accelerated with the aid of other tools which I shall return to in another paper. I have attempted to adapt a similar approach Here, I wish to explore some of the other uses of to speed up the the generation of invisible fonts but the use-i t/l ose-i t macros. When I originally the existing pattern of if . .fi groupings around wrote the code for a slab-serifed uppercase 'I' to such characters as lowercase g is pretty intractable. make a Computer Modern version of the font used The present approach, for which I am afraid I am in Leslie Lamport's SliTEX, I took a copy of the responsible in the Unix environment at least, is to entire romanu .mf file, called it sromanu .mf and let METAFONT go through all the work of creating introduced the modified letter into that. This was the picture and then erase it, a practice that is dismally slow on a Macintosh or a PC.