Flagstone Software

12776. NAME block in TrueType fonts is not decoded correctly.

The NAME block in TrueType fonts which contains all the strings associated with a font (font name, copyright notice, localization strings, etc.) is not decode correctly. Specifically an offset to the start of the strings is assumed to be at an absolute position in the file rather than relative to the start of the NAME block..

Root Cause

Programming error.

Workaround?

There is no workaround however changing he source code is simple. In FSTextConstructor.java change lines 1477-1479:

int format = coder.readWord(2, false);
int numberOfNameRecords = coder.readWord(2, false);
int stringTable = coder.readWord(2, false);

so the start of the stringTable is relative to the start of the NAME block:

int stringTableBase = coder.getPointer() >>> 3;
    	
int format = coder.readWord(2, false);
int numberOfNameRecords = coder.readWord(2, false);
int stringTable = coder.readWord(2, false) + stringTableBase;

When will it be fixed?

This was fixed in Transform 2.1.6 released on 31-Dec-2007