Skip to content

loca offsets are not multiple of 4? #203

Closed

Description

@anthrotype

I noticed a slight difference in the size of glyf tables compiled by fontTools and those compiled by other font editors (such as FontLab, for example).

fontTools-compiled glyf tables are usually smaller in size.

I believe the difference has to do with the fact that fontTools does not pad glyphs data to 4 byte boundaries, as specified in the loca section of the OT specs:

the local offsets should be long-aligned, i.e., multiples of 4. Offsets which are not long-aligned may seriously degrade performance of some processors.

In the table__g_l_y_f.compile method, extra padding only takes place for odd-lengthed glyphs, which are rounded up to make them fit in the "short" version of the loca table (provided they don't exceed the max size supported by the latter).

So I guess the assumption here is that such performance issues referred to by the specs are no longer relevant given current processors?

Activity

  1. behdad commented on Dec 9, 2014

    @behdad
    Member

    Yes, I believe that such handwavy arguments don't apply anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions