GNOME Bugzilla – Bug 762873
OS X fails to support comma-separated font list
Last modified: 2018-05-22 13:16:57 UTC
On OS X, if one passes a string containing a comma-separated font list to pango_font_description_set_family, the result is no font matches. Passing the members one at a time shows that each individual name is recognized and used properly. For example: pango-view --no-display --output out1.png --text '0123456789 - @ The lazy fox something something' --font "Anonymous Pro Minus, monospace" renders an image using a proportional sans-serif font (not monospace). pango-view --no-display --output out2.png --text '0123456789 - @ The lazy fox something something' --font "Anonymous Pro Minus" renders using Anonymous. pango-view --no-display --output out3.png --text '0123456789 - @ The lazy fox something something' --font "monospace" renders using a monospace font that is not Anonymous. pango-view --no-display --output out4.png --text '0123456789 - @ The lazy fox something something' --font "QuuxXyzzy" renders identically to the first one. QuuxXyzzy is a made up string that does not match any font on my system.
Created attachment 332369 [details] [review] Adds support for commas in the font description's family name on OS X I noticed this too and I just finished a draft of a patch to pango_core_text_fontset_new to fix it. The behavior when a font family has no comma should be completely identical to what it was before the patch. When there is a comma, if certain families don't have matches it'll pick the first match I deleted best_description because I could't find any evidence of it being useful, and the corresponding argument in find_best_match could probably be deleted too (only the face seems to be relevant)
Would anyone be able to find time to review my patch to this? It's causing a bug in our font API in node-canvas. I had one other macOS patch get accepted, if that helps!
lgtm
Matthias might be able to test and commit this...
Created attachment 361522 [details] [review] Add comma support for font selections on macOS Thanks, Behdad. There were some recent changes to pango_core_text_fontset_new so I'm attaching the updated patch that I've been using for a couple of days.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pango/issues/252.