METAFONT for Beginners Third Draft, Revision ‘W4’

METAFONT for Beginners Third Draft, Revision ‘W4’

METAFONT for Beginners Third Draft, Revision ‘W4’ (14:12 GMT +10 Thursday 14 July 1994) Geoffrey Tobin ([email protected]) Contents Scope 3 Where you can obtain this file 3 Reference 4 Acknowledgements 4 Motivation 5 1WhatisMETAFONT?5 2 Getting METAFONT’s Attention 6 2.1 Typing at METAFONT’s ‘**’prompt.......................... 6 2.2TypingontheCommandLine............................. 7 2.3 ‘Please type another input file name: ’ ................... 8 3Basefiles 8 3.1 The plain base..................................... 9 3.2LoadingaDifferentBase................................ 9 3.3TheLinkageTrick................................... 9 3.4MakingaBase;theLocalModesfile......................... 11 4Fonts 11 4.1ProofMode....................................... 11 4.2LocalfontMode..................................... 11 4.3FontNaming...................................... 12 4.4 UsingaNewFontinTEX ............................... 12 4.5Magnification(andResolution)............................ 12 4.6 GFtoPK ......................................... 13 4.7StoringtheFonts.................................... 13 4.8 Environment Variables for emTEXandweb2c .................... 14 5 Some Limitations of METAFONT 16 1 6 WhatWentWrong? 16 6.1Bigfonts,butUnwanted................................ 17 6.2 Consequences of Some Typing Errors on METAFONT’s command line . 17 6.3FindingtheFonts.................................... 19 6.4 MakeTeXPK ........................................ 19 6.5StrangePaths;Notacycle;Badpos......................... 20 7 METAFONT Mail List 21 8Conclusion 21 2 Scope This is not a tutorial on METAFONT. It is an attempted description of how some of the pitfalls in running the program may, hopefully, be avoided. Whereyoucanobtainthisfile For those without ftp, an older version of METAFONT for Beginners can be received by email from: [email protected] by sending the one-line message: sendme faq.mf METAFONT for Beginners can be obtained by ftp from the CTAN (Comprehensive TEX Archive Network) sites, in the documentation subdirectory, as the file metafont-for-beginners.tex The following record of a unix ‘script’ command lists several CTAN sites. bash$ script Script started on Mon Jun 27 19:17:54 1994 bash$ finger [email protected] [ftp.shsu.edu] Login name: ctan_us In real life: US CTAN Bldg: Directory: /pub/mirror/ctan_us Shell: /usr/local/bin/tcsh Last login Sun Jun 26 14:59 on ttyp6 Plan: In order to reduce network load, it is recommended that you use the CTAN host which is located in the closest network proximity to your site. The participating hosts in the Comprehensive TeX Archive Network (CTAN) are: ftp.dante.de (Germany) /tex-archive (/pub/tex /pub/archive) ftp.shsu.edu (Texas, USA) /tex-archive (/pub/tex /pub/archive) ftp.tex.ac.uk (England) /tex-archive (/pub/tex /pub/archive) Known mirrors of the CTAN reside on (alphabetically): ftp.center.osaka-u.ac.jp (Japan) /CTAN 3 ftp.cs.rmit.edu.au (Australia) /tex-archive ftp.loria.fr (France) /pub/unix/tex/ctan ftp.uni-bielefeld.de (Germany) /pub/tex ftp.uni-stuttgart.de (Germany) /tex-archive (/pub/tex) ftpserver.nus.sg (Singapore) /pub/zi/TeX src.doc.ic.ac.uk (England) /packages/tex/uk-tex sunsite.unc.edu (North Carolina, USA) /pub/packages/TeX wuarchive.wustl.edu (Missouri, USA) /packages/TeX Known partial mirrors of the CTAN reside on (alphabetically): dongpo.math.ncu.edu.tw (Taiwan) /tex-archive ftp.adfa.oz.au (Australia) /pub/tex/ctan ftp.muni.cz (The Czech Republic) /pub/tex/CTAN nic.switch.ch (Switzerland) /mirror/tex ftp.cs.ruu.nl (The Netherlands) /pub/tex-archive Please send updates to this list to <[email protected]>. bash$ exit exit script done on Mon Jun 27 19:18:09 1994 Reference The METAFONT book, by Donald Ervin Knuth, published by the American Mathematical Soci- ety and Addison Wesley Publishing Company. First edition, 1986, covers METAFONT 1.0. Later editions cover METAFONT 2.0 and above. This file is based, except where indicated otherwise, on the 1986 edition.1 Acknowledgements Additions and corrections were kindly contributed by: Bill Alford ([email protected]), Tim A. H. Bell ([email protected]), Karl Berry ([email protected]), Gert W. Bultman ([email protected]), Anita Zanolini Hoover ([email protected]), Berthold K. P. Horn ([email protected]), Michal Jaegermann ([email protected]), and David Kastrup ([email protected]). 1 Opinion: I actually enjoy reading The METAFONT book,whereasThe TEXbook confuses me no end. 4 Typesetting was initiated by Yannis Haralambous ([email protected]). Mistakes remain copyright c 1994 Geoffrey Tobin. Motivation It’s a common experience to have initial (and medial and final :-) ) difficulty with running METAFONT, and not all ‘TEXnicians’ are as familiar with METAFONT as they are with TEX. Still, nothing ventured, nothing gained. So let’s be of good cheer, and get down to work. 1WhatisMETAFONT? METAFONT is a program for making bitmap fonts for use by TEX, its viewers, printer drivers, and related programs. It interprets a drawing language with a syntax apparently derived in part from the Algol2 family of programming languages, of which C, C++, Pascal and Modula-2 are members. The input can be interactive, or from a source file. METAFONT source files are usually suffixed ‘.mf’. METAFONT sources can utilize scaling, rotation, reflection, skewing and shifting, and other complex transformations in obvious and intuitive ways. But that is another story, told (in part) by The METAFONT book. METAFONT’s bitmap output is a gf (generic font) file. This may be compressed to an equivalent pk (packed) font by the auxiliary program GFtoPK. Why doesn’t METAFONT output pk fonts directly? Firstly, Tomas Rokicki had not invented pk at the time Donald E. Knuth was writing METAFONT. Secondly, to change METAFONT now would be too big a change in Knuth’s opinion. (Knuth is a very conservative programmer; this fact is a two-sided coin.) gf and pk files are suffixed ‘.*gf’and‘.*pk’ respectively, where, in a typical unix instal- lation, the ‘*’ stands for the font resolution. (Resolution will be explained below.) ms-dos truncates file name suffixes to three characters, so a font suffix ‘.1200gf’ becomes ‘.120’— beware of this! A bitmap is all that’s needed for large-scale proofs, as produced by the GFtoDVI utility, but for TEX to typeset a font it needs a tfm (TEXFontMetric) file to describe the dimensions, ligatures and kerns of the font. METAFONT canbetoldtomakeatfm file, by making the internal variable ‘fontmaking’ positive. Most output device modes (see subsection 3.4 below) do this. Remember that TEXreadsonlythetfm files. The glyphs, or forms of the characters, as stored in gf or pk font files, do not enter the picture (I mean, are not read) until the dvi drivers are run. 2Around 1960, Donald Knuth worked as an Algol compiler designer. 5 TEX can scale tfm files. Unfortunately, bitmaps such as gf and pk are not scalable. However, METAFONT files can be compiled into fonts of arbitrary scale by METAFONT,evenby non-programmers — see subsection 4.5. Incidentally, properly constructed tfm files are device-independent, so running METAFONT with different modes normally produces the identical tfm.Dimensionsintfm files are specified to METAFONT in device independent ‘sharped’ dimensions (commonly suffixed by #), where a value of 1 corresponds to the dimension of 1pt (typographical point). Most of METAFONT’s calculations are done with (resolution and device dependent) pixels as units. Care must be taken by font designers to always calculate unsharped dimensions from sharped ones, and never the other way round, so as to keep roundoff errors or similar effects from influencing the tfm files to depend on resolution or device. Although type quality will be influenced only in minuscule ways, this is one of the more common reasons for checksum errors reported by printer drivers. Note that the only way to be sure that a TFM file is device-independent is to create the font in different modes and compare the resulting TFM’s, perhaps using tftopl. More detailed descriptions of tfm and gf files, and of proof mode, are found in Appendices F, G, and H, respectively of The METAFONT book. The TUG dvi Drivers Standard, Level 0, draft 0.05, includes precise definitions of the file structure of tfm metrics and of gf and pk bitmap fonts. That document is obtainable from CTAN (see section above) as the several files in the subdirectory: dviware/driv-standard/level-0 Related information is contained in the documents in the ‘sister’ directory dviware/driv-standard/papers 2 Getting METAFONT’s Attention 2.1 Typing at METAFONT’s ‘**’prompt If you type the name of the METAFONT program alone on the command line: mf then mf displays a ‘**’ prompt, which ‘is METAFONT’s way of asking you for an input file name’. (See The METAFONT book, Chapter 5: ‘Running METAFONT’.) Thus, to process a METAFONT file named fred.mf,youmaytype: fred Abackslash(‘\’) can also be typed here. This causes all subsequent commands at the prompt line to be interpreted as in a METAFONT file. (Concerning the backslash, see The META- FONT book, Chapter 20: ‘More About Macros’, pages 179 and 180 in the 1986 edition.) Thus we can respond to the ** prompt with: \ input fred 6 or even: \ ; input fred The backslash is useful because certain commands are often executed before a METAFONT file is input. In particular, quality printing (see subsection 3.4 below) requires the METAFONT command mode, and output magnification (subsection 4.5) employs the mag command. For example: \mode=localfont; mag=magstep(1); input fred

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    21 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us