Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loca offsets are not multiple of 4? #203

Closed
anthrotype opened this issue Dec 8, 2014 · 1 comment
Closed

loca offsets are not multiple of 4? #203

anthrotype opened this issue Dec 8, 2014 · 1 comment

Comments

@anthrotype
Copy link
Member

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?

@behdad
Copy link
Member

behdad commented Dec 9, 2014

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants