Skip to content

Conversation

LaurenzV
Copy link
Collaborator

@LaurenzV LaurenzV commented Aug 9, 2025

Still needs more testing, docs, etc., but I from playing around with it a bit I think this could be made to work. I tried to design the whole thing so it requires as few changes to the existing logic as possible, to hopefully prevent new bugs. Something that's probably worth measuring is whether the overhead from dynamic dispatch is very high.

@LaurenzV LaurenzV marked this pull request as draft August 9, 2025 15:51
@LaurenzV LaurenzV changed the title Add support for instancing TTF fonts Add support for variable fonts Aug 14, 2025
@LaurenzV LaurenzV marked this pull request as ready for review August 14, 2025 17:52
@LaurenzV
Copy link
Collaborator Author

@laurmaedje WDYT? See here for example images: https://github.com/LaurenzV/krilla/pull/247/files

Obviously should go through a round of manual testing with lots of fonts in Typst before actually landing, but it seems to work.

@LaurenzV
Copy link
Collaborator Author

I should also note that CFF2 fonts are incredibly rare, thought judging by the Typst issue tracker it seems like at least on NixOS they are used.

Copy link
Member

@laurmaedje laurmaedje left a comment

Choose a reason for hiding this comment

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

The approach looks solid to me! Very cool stuff. :)

I just have a few comments.

@LaurenzV LaurenzV merged commit 02ad2a4 into main Aug 15, 2025
4 checks passed
@LaurenzV LaurenzV deleted the variable branch August 15, 2025 19:56
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.

2 participants