Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant