Mark Stephens Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX. He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.

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.

Mark Stephens Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX. He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.

Converting your PDF files to HTML5 with BuildVuĀ 

Recently we announced our updated product range for 2018 and are rebranding some existing products, like JPDF2HTML5 which has been renamed to BuildVu. It...
Georgia Ingham
3 min read

Favourite resources from our HTML development team

As the web progresses and grows, so do the technologies that come along with it. Trying to keep on top of everything you need...
Ovidijus Okinskas
1 min read

How HTML5 Javadocs in Java 9 will make your…

Here at IDRsolutions we are very excited about Java 9 and have written a series of articles explaining some of the main features. In...
Rob
1 min read

Leave a Reply

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