Font conversion - what's this good for?

The native font format of Microsoft Windows is TrueType. The PostScript fonts are not very well supported on Windows and the Type 1 format has even been discontinued. On the other side some embedded computers of printing machines have troubles with TrueType fonts and prefer PostScript fonts. One approach to circumvent these problems is to convert the font to the desired format but this can be a challenge of its own.

Converting PostScript fonts from the Type 1 to the CFF format is not a challenge because both formats are conceptually identical. Whereas the Type 1 format uses to PostScript language to represent the font the CFF format is a compact binary representation of the same information. Although the CFF character strings use the enhanced and more space efficient Type 2 format the glyph description concept is still the same.

The conversion of PostScript to TrueType fonts requires much more effort, however. This is because of their particular and unique architecture. On one side TrueType fonts use quadratic bézier curves to describe the glyph outlines whereas PostScript fonts use cubic bézier curves. The main difference is the hinting system, however. TrueType fonts contain instructions (of a virtual processor) which are executed when the glyphs are rendered whereas PostScript fonts contain hints for the glyph rendering engine.

The main difference between both font formats could be put this way: TrueType fonts contain intelligent instructions for a relatively simple rendering engine whereas PostScript fonts contain simple hints for a relatively sophisticated rendering engine.

To convert a PostScript font to a TrueType font consists of two main tasks:
  1. Convert cubic bézier curves into quadratic ones: This is done by sub-dividing the curves and approximating them until the error is small enough. Although this requires some advanced mathematics it is not a big challenge.
  2. Convert the font and glyph level hints into instructions: This requires a deep understanding of both hinting systems. The main problem is that the function of the TrueType instructions are quite well defined whereas the function of the PostScript hints is not defined at all. But once the mapping is conceptually clear the creation of TrueType instruction is mere engineering task.
The opposite conversion of a TrueType font to a PostScript font is similar:
  1. Convert quadratic to cubic bézier curves: This is a trivial task since cubic curves are a super-set of quadratic ones.
  2. Convert the instructions in font and glyph level hints: This is virtually impossible and can be replaced by an auto-hinting mechanism. The font level hints (blue values, stem widths) can be derived from the geometries of some typical glyphs ("x", "e", etc.). The glyph level hints (vertical and horizontal alignments) require some more elaborate geometric analysis, however.
If you need more information on this topic please post a comment and I will be happy to add more information or post an in-depth article.

5 comments :

  1. then a question pops: is a PDF/A agnostic to font brands? can/may it embed both PS and TT fonts?.. thus requiring font conversion at the source or at the destination when printing an original document in a TT font converted to PDF/A...

    ReplyDelete
    Replies
    1. Dear Bernard,
      Thank you very much for your comment.
      From a standard point of view you can embedd TrueType, OpenType and Type 1 (PostScript) fonts without restriction.
      Only technical restrictions in your document processing chain may raise the need for converting fonts.

      Delete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. Hi Aeldra - thank you for your comment that you love it and our topics are interesting. But unfortunately we had to delete it as our policy doesn't allow for advertising.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete