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 131561 - condensed fonts can't be selected
condensed fonts can't be selected
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.3.x
Other All
: Normal normal
: 1.4.1
Assigned To: pango-maint
pango-maint
: 137194 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-01-15 14:10 UTC by Rich Williams
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Initial patch (6.56 KB, patch)
2004-02-21 18:35 UTC, Manish Singh
none Details | Review
Revised patch (9.43 KB, patch)
2004-02-23 01:35 UTC, Manish Singh
none Details | Review

Description Rich Williams 2004-01-15 14:10:44 UTC
I have a number of 'condensed' fonts installed. I can see them
with xlsfonts, and fc-list, and they worked fine in gimp1.2.
I've upgraded to the debian unstable gimp1.3 package, and now
I can't select them. 

The fonts seem to appear as duplicates in the font menu, but
selecting either variant seems to give me the 'normal' font, 
and I cannot select the condensed one. 

For example...

fc-list | grep 'Nimbus Sans L' 
Nimbus Sans L:style=Regular Italic
Nimbus Sans L:style=Bold
Nimbus Sans L:style=Regular
Nimbus Sans L:style=Bold Condensed
Nimbus Sans L:style=Bold Italic
Nimbus Sans L:style=Regular Condensed Italic
Nimbus Sans L:style=Regular Condensed
Nimbus Sans L:style=Bold Condensed Italic

... but the choices I get in GIMP are ...

Nimbus Sans L
Nimbus Sans L
Nimbus Sans L, Bold
Nimbus Sans L, Bold
Nimbus Sans L, Bold Italic
Nimbus Sans L, Bold Italic
Nimbus Sans L, Italic
Nimbus Sans L, Italic

Obviously, this is a bit of a limiting factor, and I'm
going to have to go back to gimp1.2 to work around it :-(
Comment 1 Manish Singh 2004-01-15 18:53:42 UTC
We're not handling the stretch property here. This might be able to be
worked around.

FWIW, you can't really use these fonts in any gtk2 xft app.
Comment 2 Manish Singh 2004-01-15 20:55:14 UTC
2004-01-15  Manish Singh  <yosh@gimp.org>
                                                                     
          
        * app/text/gimpfontlist.c: Set PangoStretch from FC_WIDTH. This
        partially addresses #131561 (namely, the gimp side).
Comment 3 Manish Singh 2004-01-15 21:03:22 UTC
Now pango needs to actually use the width property when querying
fontconfig. I'll do up a patch for that.

For the nimbus sans fonts specifically, you need a fontconfig 2.2.90
or higher, since the fonts themselves don't actually have any width
information, and the style string isn't parsed for these settings
until 2.2.90.
Comment 4 Manish Singh 2004-02-21 18:35:44 UTC
Created attachment 24632 [details] [review]
Initial patch
Comment 5 Manish Singh 2004-02-21 18:41:11 UTC
So even with this patch, fontconfig doesn't seem to correctly select
the condensed versions of the fonts the reporter was having trouble
with. I *think* the problem lies in fontconfig, but I haven't had a
chance to investigate further.

I also did a bit of cleanup/reorg, and I cased this on #ifdef FC_WIDTH
instead of a configure test.
Comment 6 Owen Taylor 2004-02-21 18:51:59 UTC
I guess I'd like to see this debugged in fontconfig before the
patch goes in, since without knowing what is going wrong I can't
tell if the patch is harmless or will trigger active misbehavior.

Detailed comments are:

+    case PANGO_STRETCH_NORMAL:
+      width = FC_WIDTH_NORMAL;
+      break;

I'd rather just see as:

       return FC_WIDTH_NORMAL;

saves a significant number of lines of space vertically.

And I rather see convert_width() #ifdef'ed out entirely
in the case of !FC_WIDTH. Seeing 

+  return 0;

in a function that is supposed to return an enumeration
bothers me.
Comment 7 Manish Singh 2004-02-23 00:06:03 UTC
Pretty sure there's a fontconfig bug:

http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=211
Comment 8 Manish Singh 2004-02-23 01:33:20 UTC
I've revised the patch, per owen's comments. I also made
pango_fc_font_description_from_pattern use helper functions too.
Comment 9 Manish Singh 2004-02-23 01:35:19 UTC
Created attachment 24679 [details] [review]
Revised patch
Comment 10 Manish Singh 2004-03-07 00:21:07 UTC
Ok, the bug is fixed in fontconfig cvs, it now simply defaults width
to normal if the font doesn't explictly specify it. With the patch to
pango here, one can use these fonts in gimp just fine.

Is this ok to commit now?
Comment 11 Manish Singh 2004-03-07 00:23:43 UTC
Also, there is no difference in behavior with or without this patch
with old fontconfigs, so there's no regressions.
Comment 12 Manish Singh 2004-03-12 01:53:38 UTC
Thu Mar 11 17:28:06 2004  Manish Singh  <yosh@gimp.org>
                                                                     
          
        * pango/pangofc-fontmap.c: Convert PangoStretch to and from
FC_WIDTH,
        so we can actually get fontconfig to match on condensed and
expanded
        versions of fonts, and have the info survive a
pango_fc_face_describe
        roundtrip. Fixes #131561.
                                                                     
          
        * pango/pangox-fontmap.c: Remove unused function
        free_coverages_foreach.
Comment 13 Sven Neumann 2004-03-14 21:56:57 UTC
*** Bug 137194 has been marked as a duplicate of this bug. ***