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 319808 - Patch to let pango support artifical italic, bold and bold italic styles for the fonts which don't have these styles.
Patch to let pango support artifical italic, bold and bold italic styles for ...
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.10.x
Other Linux
: Normal normal
: ---
Assigned To: Behdad Esfahbod
pango-maint
Depends on:
Blocks:
 
 
Reported: 2005-10-26 02:34 UTC by James Su
Modified: 2007-09-29 03:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The patch against pango 1.10.1 (4.17 KB, patch)
2005-10-26 02:35 UTC, James Su
none Details | Review
sysprof log of gtkfontsel. (100.06 KB, application/x-bzip2)
2005-12-29 04:32 UTC, James Su
  Details
committed patch. (4.43 KB, patch)
2006-01-29 02:49 UTC, Behdad Esfahbod
committed Details | Review

Description James Su 2005-10-26 02:34:08 UTC
Many fonts, especially all CJK fonts, don't have italic, bold and bold italic
variants. However these styles are very useful for many users (especially CJK
users). Many users challenged us that our Linux system should support those
artifical styles when they start using Linux.

I'll attach a patch to let pango support those artifical styles for all fonts
which don't have these variants.

The underlying components, including fontconfig, freetype and cairo, support
this feature already.
Comment 1 James Su 2005-10-26 02:35:45 UTC
Created attachment 53895 [details] [review]
The patch against pango 1.10.1

See also bug report https://bugzilla.novell.com/show_bug.cgi?id=53228
Comment 2 Behdad Esfahbod 2005-11-23 17:57:53 UTC
The Novell bug is not public.
Comment 3 James Su 2005-12-29 04:32:53 UTC
Created attachment 56497 [details]
sysprof log of gtkfontsel.

You may find that it spent more than 60% time on calling FcFontSort. And it'll call FcFontSort multiple times for each font selection event.
Comment 4 James Su 2005-12-29 04:34:49 UTC
Comment on attachment 56497 [details]
sysprof log of gtkfontsel.

Sorry. Posted to wrong bug report. Please ignore this attachment.
Comment 5 James Su 2005-12-29 04:37:54 UTC
Do you have any update about this issue?
Comment 6 Federico Mena Quintero 2005-12-29 18:47:11 UTC
I'm not really familiar with the fontconfig API.  You'll have to run this one through Behdad/Owen.
Comment 7 Behdad Esfahbod 2006-01-16 09:51:04 UTC
Patch looks good to me.  Federico, can you test?
Comment 8 Behdad Esfahbod 2006-01-29 02:49:01 UTC
Created attachment 58306 [details] [review]
committed patch.

2006-01-28  Behdad Esfahbod  <behdad@gnome.org>

        * pangofc-fontmap.c: Create fake Bold, Italic, and Bold Italic faces
        for fonts that do not have one. (bug #319808, James Su)
Comment 9 Behdad Esfahbod 2006-01-29 02:49:27 UTC
Thanks.
Comment 10 Behdad Esfahbod 2006-01-29 03:07:50 UTC
Humm, seems like while fake Italic works all the time, fake Bold only works if embolden is set in the fontconfig config file for a family.  Not sure how to fix it...
Comment 11 Behdad Esfahbod 2006-01-29 03:55:30 UTC
Reverted. :(

Something is in the way of fake Bold working.  Couldn't figure out what...
This needs more testing before going in.
Comment 12 Behdad Esfahbod 2006-07-13 20:02:36 UTC
Red Hat bug: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=198730
Comment 13 Akira TAGOH 2006-10-20 06:30:33 UTC
how about just adding Bold and Italic only when the feature are enabled?
Comment 14 Behdad Esfahbod 2006-12-13 21:05:49 UTC
Ok, committing again.  Seems like cairo is fixed now, so all work for me.

2006-12-13  Behdad Esfahbod  <behdad@gnome.org>

        Bug 319808 – Patch to let pango support artifical italic, bold and
        bold italic styles for the fonts which don't have these styles.
        Patch from James Su

        * pango/pangofc-fontmap.c (pango_fc_face_describe), (create_face),
        (pango_fc_family_list_faces): Create fake Bold, Italic, and Bold
        Italic faces for fonts that do not have one.

Comment 15 LingNing Zhang 2007-09-29 03:15:39 UTC
behdad, could you please close the same bug in RedHat bugzilla ?
https://bugzilla.redhat.com/show_bug.cgi?id=198730
Thank you, :)