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 307985 - Bold text without a bold version of the font
Bold text without a bold version of the font
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
unspecified
Other All
: Normal enhancement
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
: 453788 592538 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-06-16 20:33 UTC by diana fong
Modified: 2010-02-26 00:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
use pango API to enumerate font faces (3.61 KB, patch)
2007-07-11 11:05 UTC, Sven Neumann
rejected Details | Review

Description diana fong 2005-06-16 20:33:32 UTC
Allow for text to be bolded without having a bold version of the font.
Comment 1 weskaggs 2005-06-16 20:44:56 UTC
Please explain why you think this would be possible.
Comment 2 Michael Schumacher 2005-06-17 08:44:01 UTC
Changed the summary.
Comment 3 Sven Neumann 2005-06-17 19:03:20 UTC

*** This bug has been marked as a duplicate of 122706 ***
Comment 4 Raphaël Quinet 2005-06-20 15:44:20 UTC
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.
Comment 5 Sven Neumann 2005-06-20 22:39:18 UTC
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.
Comment 6 Simos Xenitellis 2005-08-29 03:02:48 UTC
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.
Comment 7 Raphaël Quinet 2007-07-05 08:15:57 UTC
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.
Comment 8 Raphaël Quinet 2007-07-05 08:17:47 UTC
*** Bug 453788 has been marked as a duplicate of this bug. ***
Comment 9 Sven Neumann 2007-07-05 19:06:58 UTC
Raphael, can you please point us to the Pango API documentation that shows how to do this?
Comment 10 Sven Neumann 2007-07-11 11:05:42 UTC
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.
Comment 11 Sven Neumann 2007-07-11 11:09:14 UTC
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.
Comment 12 Sven Neumann 2007-07-11 11:34:05 UTC
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.
Comment 13 Simon Budig 2007-07-11 13:11:11 UTC
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.
Comment 14 Sven Neumann 2007-07-11 13:19:29 UTC
In the long run we should try to get such problems fixed in Pango instead of adding workarounds in GIMP.
Comment 15 Sven Neumann 2009-08-21 06:45:00 UTC
*** Bug 592538 has been marked as a duplicate of this bug. ***
Comment 16 Whistler 2009-08-24 05:24:25 UTC
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.
Comment 17 Michael Schumacher 2009-10-26 10:45:14 UTC
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?
Comment 18 Michael Natterer 2010-02-26 00:45:46 UTC
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(-)