Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

Table order in OTF fonts

52 sec read

As part of our TrueType to OpenType font conversion (we need this for PDF to HTML5 conversion to ensure fonts display on all browsers), I have been playing with lots of raw OpenType font data and tables.

In theory TrueType to OpenType should be easier than Postscript to OpenType as there are more similarities. OpenType is a ‘synthesis’ of TrueType and Postscript and has versions to support both. More of the TrueType data can be reused rather than having to be recalculated.

However, the OpenType tables do need to be arranged in a very specific order. In the actual Header table, the tables are all listed with their lengths and offset location in the OpenType font file. This list needs to be in CASE-SENSITIVE alphabetical order (so OS/2 comes before cmap).

By contrast, the actual order of tables in the File needs to be in a certain order (this is because some tables contain values used by other tables). Here is my current miminum table list for an OpenType font

“head”,
“hhea”,
“maxp”,
“OS/2”,
“hmtx”,
“cmap”,
“loca”,
“glyf”,
“name”,
“post”

When examining OpenType font files, there are several tools available which provide lots of useful information. The most useful I have found so far is the Microsoft Font Validator, although LCDF package contains a very useful otfinfo tool. Do you have a favourite tool for checking OpenType font files?

This post is part of our “Fonts Articles Index” in these articles we explore Fonts.



Converting PDF/ Office Documents to HTML?

Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

Leave a Reply

Your email address will not be published. Required fields are marked *

IDRsolutions Ltd 2021. All rights reserved.