Data Types

The following data types are used in the TrueType font file. All TrueType fonts use Motorola-style byte ordering (Big Endian):

Data type

Description

BYTE

8-bit unsigned integer.

CHAR

8-bit signed integer.

USHORT

16-bit unsigned integer.

SHORT

16-bit signed integer.

ULONG

32-bit unsigned integer.

LONG

32-bit signed integer.

FIXED

32-bit signed fixed-point number (16.16)

FUNIT

Smallest measurable distance in the em space.

FWORD

16-bit signed integer (SHORT) that describes a quantity in FUnits.

UFWORD

Unsigned 16-bit integer (USHORT) that describes a quantity in FUnits.

F2DOT14

16-bit signed fixed number with the low 14 bits of fraction (2.14).


Most tables have version numbers, and the version number for the entire font is contained in the Table Directory (see below). Note that there are two different version number types, each with its own numbering scheme. USHORT version numbers always start at zero (0). Fixed version numbers always start at one (1.0 or 0x00010000).

The Fixed point format consists of a signed, 2's complement mantissa and an unsigned fraction. To compute the actual value, take the mantissa and add the fraction. Examples of 2.14 values are:

Decimal Value

Hex Value

Mantissa

Fraction

1.999939

0x7fff

1

16383/16384

1.75

0x7000

1

0/16384

0.000061

0x0001

0

1/16384

0.0

0x0000

0

0/16384

-0.000061

0xffff

-1

16383/16384

-2.0

0x8000

-2

0/16384