freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fonts and PostScript [was: A DVI viewer with freetype2]


From: Juliusz Chroboczek
Subject: Re: Fonts and PostScript [was: A DVI viewer with freetype2]
Date: 08 Apr 2000 20:21:03 +0100

SS> Specifically, given a drawing kit which renders to postscript,
SS> would it be efficient to use FT2 to do the font management instead
SS> of postscript's own ?

Could I ask for an easier question instead?

As you probably know, PostScript is a very general Page Description
Language, and there are many strategies for typesetting text.  I'm
assuming that you're interested in generating proper PS, not
rasterising full-page bitmaps of your document at the device's
resolution and treating your PS printer as a dumb framebuffer device.

For Type 1 fonts (``PostScript fonts'', or ``ATM fonts''), you are
probably best served by downloading the fonts directly to the printer,
and using the proper PS typesetting primitives.  The only support that
FreeType can give you here is for determining glyph metrics, but
that's probably better done by parsing the font metrics files (AFMs).
You will probably not need to write the code yourself, as code to do
that has been made available by Adobe.

You will probably also be interested in typesetting using TrueType
fonts.  I can see at least the following strategies for dealing with
TrueType fonts in PS, which all have different tradeoffs.

1. Download the fonts to the printer using the Type 42 format,
supported by most recent printers.  This is very much preferable to
the alternatives if the targeted printer supports it, as it generates
resolution-independent PS, and preserves hinting.  (This strategy is
used by recent Windows and MacOS drivers when the printer supports
Type 42 fonts.)

2. Download the fonts to the printer after conversion to Type 1.  This
will generate resolution-independent PS that is portable to (almost)
all PS devices in existence, but will lose all hinting.  (This is the
strategy used by Windows and MacOS printer drivers at large point
sizes.)

3. Rasterise the fonts on the host, and download the fonts used as
Type 3 bitmap fonts at the device's resolution.  This generates
portable PS, but at the cost of making it resolution-dependent.  If
the resolution of the PS file and that of the device differ, the
results will not yield very good results; it will also make your PS
files unusable for conversion to PDF (which might or might not be an
issue for you).  (This is the strategy used by TeX's ``dvips'' driver
when using PK fonts, as well as by Windows and MacOS drivers at small
point sizes.)

As TrueType fonts often have large numbers of glyphs, in all cases you
will want to consider partial font downloading (only downloading the
glyphs in a font that are used by a document) and incremental download
(downloading an empty shell of a font, and adding glyphs to it as they
are needed; yes, this is supported by PS).

FreeType will be needed if you adopt strategy (3).  It should be
possible to use FreeType to help you with (2), but it might be simpler
to use the ``ttf2pt1' utility that has already been developed.  You
will find links to this utility, as well as links to a couple of
utilities for generating Type 42 fonts, on the page

  http://www.dcs.ed.ac.uk/home/jec/programs/xfsft/printing.html

I hope this helps,

                                        Juliusz Chroboczek


reply via email to

[Prev in Thread] Current Thread [Next in Thread]