Replace ttf-parser with skrifa#4
Open
mkorje wants to merge 1 commit intotypst:mainfrom
Open
Conversation
laurmaedje
reviewed
Apr 28, 2026
Member
laurmaedje
left a comment
There was a problem hiding this comment.
I want to test this a bit more, but am leaving these comments already anyway.
6245d90 to
8bb3d77
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See typst/typst#8172.
I think I've done this all right. Please double-check though.
One difference I noticed:
ttf-parsersupports the tablesgvar,glyf,CFF,CFF2in that order.skrifaprioritiesglyf,CFF2,CCFin that order.Another thing:
The second commit might be worse performance wise, because we just end up doing the drawing twice. Here's the relevant
skrifacode:https://github.com/googlefonts/fontations/blob/fd0178ce4ea48301a7f06b35a6fce9879c102292/skrifa/src/metrics.rs#L348-L368
https://github.com/googlefonts/fontations/blob/fd0178ce4ea48301a7f06b35a6fce9879c102292/skrifa/src/metrics.rs#L384-L393
Here's the corresponding
ttf-parsercode:https://github.com/harfbuzz/ttf-parser/blob/6e75b3c539ef6bfbacb020aaa3226414ddea7ce5/src/lib.rs#L2115-L2196