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

head.checkSumAdjustment not set, always 0x0 #945

Open
anthrotype opened this issue Sep 6, 2024 · 3 comments
Open

head.checkSumAdjustment not set, always 0x0 #945

anthrotype opened this issue Sep 6, 2024 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@anthrotype
Copy link
Member

anthrotype commented Sep 6, 2024

fontc is not computing the head table's checkSumAdjustment field, so it defaults to 0x0.
And neither is write_fonts. Not sure whose responsibility it should be, whether the client (fontc) or write_fonts itself.
Probably the latter?

Anyway, ttx_diff.py currently erases the field altogether so we may get "fonts are identical" but actually the checkSumAdjustment is plain wrong.

Ok, you may argue it's garbage anyway and nobody should trust that, but if we want to be nice we should just compute that correctly, e.g. the same way fontmake/fonttools would, with all the "BiboAfba" and funny things like that:

https://github.com/fonttools/fonttools/blob/c2119229cfb02cdb7c5a63374ef29d3d514259e8/Lib/fontTools/ttLib/sfnt.py#L375-L406

@rsheeter
Copy link
Contributor

rsheeter commented Sep 6, 2024

https://github.com/googlefonts/fontations/blob/6d01f7425b52f06d23d8e24f433f09d2e3779ac5/write-fonts/src/font_builder.rs#L102 is computing table directory checksums and strikes me as the appropriate place to do it, update head if there is a head.

@rsheeter rsheeter added the bug Something isn't working label Sep 6, 2024
@anthrotype
Copy link
Member Author

sgtm. we could transfer the issue over to the fontations repo maybe

@rsheeter
Copy link
Contributor

rsheeter commented Sep 6, 2024

Maybe open a new one there and reference it? - it's still true that fontc has a bug so I think we shoudl keep this one even if the fix ends up just being an update to our fontations version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants