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

Add support for .ttc font collection #249

Merged
merged 3 commits into from
Feb 16, 2022

Conversation

dhanusaputra
Copy link
Contributor

Close #228

@coveralls
Copy link

coveralls commented Feb 9, 2022

Coverage Status

Coverage remained the same at 96.407% when pulling db31bd8 on dhanusaputra:master into ac65698 on gabriel-vasile:master.

Copy link
Owner

@gabriel-vasile gabriel-vasile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, looks good but there is an improvement we can add.

Right now, a text file containing just the text ttcf will be detected as font.

To fix this, we can also check the TTC majorVersion and minorVersion bytes. Bytes at index 4, 5, 6, 7 contain the TTC version as a big endian uint16 number.

Here is the documentation for the format.
The way this helps with the issue is because text files can never contain bytes values 0x00, 0x01 or 0x02.

@gabriel-vasile gabriel-vasile merged commit c6adf9a into gabriel-vasile:master Feb 16, 2022
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

Successfully merging this pull request may close these issues.

Add support for .ttc font collection
3 participants