After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 733832 - Improve fontchooser widgets display text
Improve fontchooser widgets display text
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFontChooser
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 734882
 
 
Reported: 2014-07-27 21:23 UTC by Behdad Esfahbod
Modified: 2014-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proof of concept (1.37 KB, patch)
2014-08-15 17:27 UTC, Behdad Esfahbod
committed Details | Review

Description Behdad Esfahbod 2014-07-27 21:23:55 UTC
I'll explain later.  Just opening so I don't forget.
Comment 1 Behdad Esfahbod 2014-08-08 16:46:35 UTC
Problem is, currently fontchooser widgets keep a PangoFontDescription internally and use the pango_font_description_to_string() return value for user display of the selected font.  However, this is less than ideal.

As an example, consider the Noto Sans CJK DemiLight font.  PangoFontDescription parses that, notices that DemiLight is another name for SemiLight, detects the font weight correctly, and then converts to text as Noto Sans CJK SemiLight, which is not the name of any font in existence.

The PangoFontFace has that correct name.  And the fontchooser used to use that.  I'll attach a patch for fontchooserwidget that resurrects that.  However, the bug will remain in fontbutton, and we can't fix it there because we don't have the PangoFontFace anymore.

So I think the correct way to fix this is to add new API to fontchooserwidget and fontchooserbutton to get/set strings, instead of PangoFontDescription.  And make fontchooserbutton use that new API of fontchooserwidget, to correctly retain the preferred name.

I'm not sure what else might need fixing, but this is a good start.
Comment 2 Matthias Clasen 2014-08-15 10:37:39 UTC
was there a patch coming, Behdad ?
Comment 3 Behdad Esfahbod 2014-08-15 17:27:14 UTC
Created attachment 283536 [details] [review]
proof of concept