GNOME Bugzilla – Bug 307985
Bold text without a bold version of the font
Last modified: 2010-02-26 00:45:46 UTC
Allow for text to be bolded without having a bold version of the font.
Please explain why you think this would be possible.
Changed the summary.
*** This bug has been marked as a duplicate of 122706 ***
I don't think that this bug report is an exact duplicate of bug #122706, but rather a dependency. If I understood correctly, what is asked here is to be able to "fake" bold even if there is no bold version of a font (this can be very useful in some cases, especially for fantasy fonts that seldom come with bold or italics). But it is likely that fixing #122706 will require this feature to be implemented, so I am not reopening this bug report.
I am pretty sure that I won't add support for faking bold to GIMP. This belongs into the font rendering library and can hardly be implemented at the application level.
AFAIK, fontconfig supports this "faking" of a font to look bold, italic, etc, if there is no such version. Could someone show how this can be done in the code? It should be patch of a few lines.
I am re-opening this bug report because it was incorrectly marked as a duplicate. Regarding comment #5, support for generating bold or oblique versions of any font has been added some time ago to the libraries that we use. Most other applications such as Inkscape, OpenOffice.org Draw/Write or AbiWord already use this feature and allow the user to fake the missing fonts.
*** Bug 453788 has been marked as a duplicate of this bug. ***
Raphael, can you please point us to the Pango API documentation that shows how to do this?
Created attachment 91607 [details] [review] use pango API to enumerate font faces This patch removes code that we introduced to work around a performance problem in Pango. Without this code, synthesized font faces are listed in the GIMP font selector. If we can verify that this change doesn't reintroduce a performance problem, it should be applied. When Pango 1.8 is released, we can use the new API call pango_font_face_is_synthesized() to somehow inform the user about synthesized font faces or perhaps allow to exclude such faces from the font list.
The performance problem is described in bug #110798. Note than a lot has happened since then and we depend on newer versions of fontconfig and pango now which might have this problem sorted out. We could then safely remove our workaround.
I have run a quick test and it seems that the performance problem from bug #110798 still hasn't been addressed. With the patch applied gimp_font_list_load_names() takes unreasonably long to complete and this time seems to scale quadratically with the number of fonts. With the code currently used in GIMP the time to scan the fonts increases linearly with the number of fonts. I am using fontconfig 2.4.2 and pango 1.16.4.
Please also note, that switching to pango-only font enumeration would make a workaround around pango bug #341213 impossible. I have some half-assed workaround code, but this relies on fontconfig. Ceterum censeo faux bold esse delendam.
In the long run we should try to get such problems fixed in Pango instead of adding workarounds in GIMP.
*** Bug 592538 has been marked as a duplicate of this bug. ***
oops, looks like I should do some more search. Just a note: so far none of the CJK (Chinese/Japanese/Korean) fonts have bold/italic "clones" as the CJK characters are much different from Western languages, so this would be important for East-Asian users.
Looks like pango bug #341213 doesn't get much attention. But as this seems to be important for East-Asian users, maybe there will be someone from this region who'd like to contribute patches to Pango?
Apparently setting "bold" as a pango text attribute produces a bold version of just about any font, without GIMP having to care about native or generated, pango just does it. So the addition of text styles in its initial version fixes this bug: commit 9cff2365b10da6f68d8f5cc93bc2127a53223161 Author: Michael Natterer <mitch@gimp.org> Date: Fri Feb 26 01:36:31 2010 +0100 app: enable editing text styles - create a GimpTextStyleEditor on the canvas when editing text. - sync "text" and "markup" between proxy and text, not only "text. - connect to chages to text marks on the buffer. app/tools/gimptexttool-editor.c | 41 +++++++++++++++++++++++ app/tools/gimptexttool.c | 70 ++++++++++++++++++++++++++++++++------ app/tools/gimptexttool.h | 3 ++ 3 files changed, 103 insertions(+), 11 deletions(-)