Why does Pango on Windows fail to open some fonts?

I’m experiencing some strange behaviour with Pango on Windows. Some standard Windows fonts fail to open with Pango while others work. For example, there’s no problem using Bauhaus 93, Calibri or Segoe UI with Pango. When trying to open Brush Script MT, however, I get the following error:

(process:928): Pango-WARNING **: 16:43:17.129: couldn't load font "Brush Script MT 144px", falling b
ack to "Sans 144px", expect ugly output.

The same happens with Algerian:

(process:928): Pango-WARNING **: 16:44:23.103: couldn't load font "Algerian 144px", falling b
ack to "Sans 144px", expect ugly output.

Why do some fonts work while others don’t? Doesn’t make sense to me. I use the Pango build provided by MSYS2 for MINGW64.

Hello @pangocoder! Could you share a link to the fonts?

Those are standard Windows fonts. They ship with every Windows 10 system but they are probably copyrighted by Microsoft so I can’t upload them here.

1 Like

Ah, true! :smile:

Actually I can see the fonts in GtkFontDialog. Try running gtk4-demo --run=pickers


Here’s the output from pango-list:

$ pango-list | grep -Ei "brush|algerian"
Brush Script MT 
  Italic:      Brush Script MT Italic
  Bold Italic: Brush Script MT Bold Italic
Algerian 
  Extra-Condensed:              Algerian Extra-Condensed
  Oblique Extra-Condensed:      Algerian Oblique Extra-Condensed
  Bold Extra-Condensed:         Algerian Bold Extra-Condensed
  Bold Oblique Extra-Condensed: Algerian Bold Oblique Extra-Condensed
1 Like

Ah, ok, so I have to use “Brush Script MT Italic” instead of “Brush Script MT” and “Algerian Extra-Condensed” instead of “Algerian”. Then Pango opens the fonts.

Still I find it a bit strange that Pango’s font matching falls back to “Sans” when passing “Brush Script MT”. Wouldn’t it make much more sense to fall back to “Brush Script MT Italic” in that case? The family name surely is Brush Script MT. Also, “Algerian” falls back to “Sans” as well. But I think it would be much more reasonable to fall back to “Algerian Extra-Condensed” then…

1 Like

Those are standard Windows fonts. They ship with every Windows 10 system but they are probably copyrighted by Microsoft so I can’t upload them here.

Assuming this answer still applies, that is not Pango’s fault:

Ok, so looks like it’s the Windows font mapper which is a bit pedantic and doesn’t accept “Brush Script MT” but only “Brush Script MT Italic”. When using the FT2 backend, which probably uses fontconfig, “Brush Script MT” works as well.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.