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

Setting font features and font variations. (#503) #506

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Martin-Eriksson
Copy link

Closes #503.

I've got some comments in there with questions about how to do certain things.

I had thought I could use hb_font_set_variations and it would be super easy,
barely an inconvenience, to support setting variations but it does nothing at all.
Instead I had to use FreeType directly, which took me a while to figure out how
to do. Do you think hb_font_set_variations is supposed to work? Or is it correct
that it does nothing when using FreeType, perhaps?

font->enable_kerning is not used at all anymore, TTF_SetFontFeatures and TTF_SetFontKerning
are completely independent. It ignores the font->enable_kerning value
if TTF_SetFontFeatures has been called with a non-null string. If TTF_SetFontFeatures
is called later with a null string, it starts using the font->enable_kerning value again.
Combining them is a bit complicated if we want to avoid doing more work in CollectGlyphsFromFont().

I've tried to run address sanitizer on the code but I haven't got it working yet.
It reports nothing even though I've commented out calls to free.

Until I've figured out how to get ASan working, and if hb_font_set_variations is supposed to work, I'm keeping this as
a draft PR

@Martin-Eriksson Martin-Eriksson changed the title Implemented setting font features and font variations. (#503) Setting font features and font variations. (#503) Feb 6, 2025
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.

[Feature request] Setting font features and font variations.
1 participant