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 734882 - Improve fontchooserwidget API and fontchooserbutton display text
Improve fontchooserwidget API and fontchooserbutton display text
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFontChooser
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on: 733832
Blocks:
 
 
Reported: 2014-08-15 18:40 UTC by Behdad Esfahbod
Modified: 2014-12-28 03:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Behdad Esfahbod 2014-08-15 18:40:41 UTC
+++ This bug was initially created as a clone of Bug #733832 +++

Forking from bug 733832 to track the parts not fixed in that bug.

Copying:

============================================================================
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.
============================================================================

Matthias committed the patch there to fix the fontchooserwidget.  But now when you choose "Noto Sans CJK DemiLight" and close the dialog, the fontchooserbutton shows "Noto Sans CJK SemiLight".  The last paragraph above is what this bug tracks.
Comment 1 Matthias Clasen 2014-08-15 19:04:52 UTC
I actually pushed a followup commit that was supposed to fix the font button.
Let me know if that doesn't work