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

Font families (with multiple names) have unexpected names and render using incorrect font #733

Open
handerss-spotfire opened this issue Dec 20, 2021 · 0 comments

Comments

@handerss-spotfire
Copy link

(This is using libgdiplus built from main with Pango as backend)

GdipGetFamilyName is different between libgdiplus and GDI+ for fonts which define multiple family names. One such example is the Roboto font family (available here: https://fonts.google.com/specimen/Roboto) where all Roboto fonts use "Roboto" as the first family value. So the font "Roboto-Black.ttf" shows up as "Roboto Black" on GDI+, and as "Roboto" on libgdiplus.

A possible solution may be to always pick the final FC_FAMILY value?

Another related issue is that while GdipCreateFontFamilyFromName("Roboto Black", nil, &ff) does find the correct font, however it is later passed to the pango backend via pango_font_description_set_family (font->pango, (char *)font->face);, which results in the incorrect font being used since font->face is "Roboto". If Pango is 1.4 or above pango_fc_font_description_from_pattern could be used instead ensure that the same font is used. However, I'm guessing that fixing the issue with the incorrect font name alleviates this second issue.

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

No branches or pull requests

1 participant