GNOME Bugzilla – Bug 319808
Patch to let pango support artifical italic, bold and bold italic styles for the fonts which don't have these styles.
Last modified: 2007-09-29 03:15:39 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.
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
The Novell bug is not public.
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 on attachment 56497 [details] sysprof log of gtkfontsel. Sorry. Posted to wrong bug report. Please ignore this attachment.
Do you have any update about this issue?
I'm not really familiar with the fontconfig API. You'll have to run this one through Behdad/Owen.
Patch looks good to me. Federico, can you test?
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)
Thanks.
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...
Reverted. :( Something is in the way of fake Bold working. Couldn't figure out what... This needs more testing before going in.
Red Hat bug: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=198730
how about just adding Bold and Italic only when the feature are enabled?
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.
behdad, could you please close the same bug in RedHat bugzilla ? https://bugzilla.redhat.com/show_bug.cgi?id=198730 Thank you, :)