www.delorie.com/gnu/docs/fontutils/fontu_10.html   search  
Buy GNU books!

Font utilities

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.2.1 Font creation example

This section gives a real-life example of font creation for the Garamond roman typeface, which we worked on concomitantly with developing the programs. We started from a scanned type specimen of 30 point Monotype Garamond, scanned using a Xerox 9700 scanner loaned to us from Interleaf, Inc. (Thanks to Paul English and others at Interleaf for this loan.)

    To begin, we used Imageto as follows to look at the image file we had scanned (see section 6.1.1 Viewing an image). Each line is a separate command.
    imageto -strips ggmr.img
    fontconvert -tfm ggmrsp.1200
    echo ggmrsp | tex strips.tex
    xdvi -p 1200 -s 10 strips.dvi
  1. Next, we created the file `ggmr.ifi' (distributed in the `data' directory), listing the characters in the order they appeared in the image, guessing at baseline offsets and (if necessary) including bounding box counts. Then we ran Imageto again, this time to get information about the baselines and spurious blotches in the image. We use the `-encoding' option since some of the characters in the image are not in the default ASCII encoding.
    imageto -print-guidelines -print-clean-info -encoding=gnulatin ggmr.img

  2. Based on the information gleaned from that run, we decided on the final baselines, adjusted the bounding box counts for broken-up characters, and extracted the font (see section 6.1.2 Image to font conversion). (In truth, this took several iterations.) The design size of the original image was stated in the book to be 30pt. We noticed several blotches in the image we needed to ignore, and so we added .notdef lines to `ggmr.ifi' as appropriate.
    imageto -verbose -baselines=121,130,120 \
      -designsize=30 -encoding=gnulatin ggmr.img

  3. To smooth some of the rough edges caused by the scanner's rasterization errors, we filtered the bitmaps with Fontconvert (see section 8. Fontconvert).
    fontconvert -verbose -gf -tfm -filter-passes=3 -filter-size=3 \
      ggmr30.1200 -output=ggmr30a

  4. For a first attempt at intercharacter and interword spacing, we created `ggmr.1200cmi' (also distributed in the `data' directory) and ran Charspace (see section 9. Charspace), producing `ggmr30b.1200gf' and `ggmr30b.tfm'. To see the results, we ran `ggmr30b' through `testfont.tex', modified the CMI file, reran Charspace, etc., until the output was somewhat reasonable. We didn't try to fine-tune the spacing here, since we knew the following steps would affect the character shapes, which in turn would affect the spacing.
    charspace -verbose -cmi=ggmr.1200cmi ggmr30a.1200 -output=ggmr30b

  5. Next we ran `ggmr30b.1200gf', created by Charspace, through Limn to produce the outline font in BZR form, `ggmr30b.bzr'. We couldn't know what the best values of all the fitting parameters were the first time, so we just increased the ones which are relative to the resolution.
    limn -verbose -corner-surround=4 -filter-surround=6 \
      -filter-alternative-surround=3 -subdivide-surround=6 \
      -tangent-surround=6 ggmr30b.1200

  6. Then we converted `ggmr30b.bzr' to a Metafont program using BZRto (see section 11. BZRto), and then ran Metafont to create TFM and GF files we could typeset with (see section 11.1 Metafont and BZRto). In order to keep the Metafont-generated files distinct from the original TFM and GF files, we use the output stem `ggmr30B'. To see the results at the usual 10pt, we then ran the Metafont output through `sample.tex' (a one-line wrapper for `testfont.tex': `\input testfont \sample \end').
    bzrto -verbose -metafont ggmr30b -output=ggmr30B
    mf '\mode:=localfont; input ggmr30B'
    echo ggmr30B | tex sample
    dvips sample

  7. This 10pt output looked too small to us. So we changed the design size to 26pt (finding the value took several iterations) with Fontconvert (see section 8. Fontconvert), then reran Charspace, Limn, BZRto, Metafont, etc., as above. We only show the Fontconvert step here; the others have only the filenames changed from the invocations above.
    fontconvert -verbose -gf -tfm -designsize=26 ggmr30b.1200 -output=ggmr26c

  8. After this, the real work begins. We ran the Metafont program `ggmr26D.mf' in proof mode, followed by GFtoDVI, so we could see how well Limn did at choosing the control points for the outlines. See section 11.1.2 Proofing with Metafont. (The nodisplays tells Metafont not to bother displaying each character in a window online.)
    mf '\mode:=proof; nodisplays; input ggmr26D'
    gftodvi ggmr26D.3656gf

  9. From this, we went and hand-edited the font `ggmr26d.1200gf' with XBfe (see section 13. XBfe), and/or tinkered with the options to Limn, trying to make the outlines reasonable. We still haven't finished ...

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003