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.

Do you need to process or display PDF files?

Find out why you should be using IDRSolutions software

Table order in OTF fonts

49 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?



Our software libraries allow you to

Convert PDF files to HTML
Use PDF Forms in a web browser
Convert PDF Documents to an image
Work with PDF Documents in Java
Read and write HEIC and other Image formats in Java
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.