glayout

Font Requirements

This is really just speculation for now, as there is no code.

gLayout will need font services that provide the following information (at least).

Availability

glayout needs to be able to offer the user a choice of fonts based on format, character set and name. The user must be able to select whether to be offered the choice of all fonts, or on a per format basis: bitmap, Type 1, TrueType, Speedo, OpenType, etc. If the final output is PostScript, for example, we can only use PostScript fonts, unless they are converted to outlines with a loss of hinting.

glayout may also be given a list of font families and perform substitution of an entire family if a particular character set isn't available. Example: use a serif font with an expert set including the ffi, ffl, ct and st ligatures.

Metrics

For Type 1, need all the actual metrics from the AFM file, including kern pairs, tracking, ligatures, as well as per-glyph information. Want to be able to re-encode a Type 1 font to get at all the glyphs.

For TT fonts, need hinted metrics at a given size, as well as the virtual metrics, because of non-linear scaling.

Kern pairs
Need the kern pair information from the AFM/PFM file, not rounded to any particular resolution or size or ppem, because I will need to track exact rounding errors. I need the (left-glyph, right-glyph, hoffset) triplet (do you get voffsets in some fonts? I've never encountered it) triplet.
Ligatures and glyphs
I'll need to get at the complete glyph set for a font; ince Type 1 fonts don't tell you which glyphs are ligatures, I'm expecting to write code to handle that, probably with external ligature tables to handle fonts like Mrs Eaves. Note that the presence of a "tion" ligature in no way implies a "tio" ligature
per-font information
font bounding box, x-height, cap height, italic angle, default encoding, glyph set supported, as well as copyright and vendor information, possibly access to the font file (either a filename or by network), and for a TrueType font, access to all the tables.
per-glyph information
I will need the glyph bounding box at a particular ppem, as well as left and right side-bearings, baseline descent and characer advance (width and height, although I am not planning to do vertical text at first),

Outlines

Access to full outlines would be nice, including hints. At no stage is it acceptable to convert a font to outlines and lose hints.

Font Data

Need to be able to include PostScript Type 1 fonts in PS output.

Need to be able to render fonts to the screen, of course.

Want to render hinted fonts rotated or transformed linearly (ala PostScript). For non-linear transforms (e.g. perspective), will convert glyphs to outlines.

Need glyph subsets or lazy rendering.

Intellectal Property Rights

Must have access to the font's copyright statement, and embedding info where given. Want to include digital watermarking and other information in fonts too, and access it where present.