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 137624 - Font dialog preview strings should be customizable
Font dialog preview strings should be customizable
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Internationalisation
git master
Other All
: Normal enhancement
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
: 158152 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-03-18 19:44 UTC by Dov Grobgeld
Modified: 2006-05-20 23:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
First version of patch to HEAD (12.98 KB, patch)
2006-04-03 03:09 UTC, Tor Lillqvist
committed Details | Review

Description Dov Grobgeld 2004-03-18 19:44:33 UTC
The two font previews that are currently given in the font dialog are not
useful for non-latin text. The two previews are the "Aa" button, lets call
it the short preview, and the string that is shown when M1 is clicked on
the short prieview, let's call it the long preview.

The font dialog should add an interface that allows changing the contents
of both the long and the short previews. Changing them through the locale
is not an acceptable solution since during the same session of gimp I may
want to work with two different sub-groups of glyphs.

One less than optimal solution would be to change the strings somewhere in
the Preference dialog.
Comment 1 Sven Neumann 2004-11-13 13:15:52 UTC
*** Bug 158152 has been marked as a duplicate of this bug. ***
Comment 2 Tor Lillqvist 2006-04-02 23:49:11 UTC
Instead of, or in addition to, having the user being able to change the "Aa" it would be a good idea to use heuristics to find out what's the primary script for which the font is designed. For instance, if a font contains OpenType layout tables for the "beng" script, one can be pretty sure it is designed for Bengali, and it would be a good idea to use whatever would be the suitable Bengali alternative to "Aa".

If there are no OpenType layout tables, the next step could be to check the font's coverage. Presumably one could use the UnicodeRange and CodePageRange values for TrueType fonts and not have to calculate the exact coverage.

Or can this information be had through fontconfig in a simpler way?
Comment 3 Tor Lillqvist 2006-04-03 03:09:15 UTC
Created attachment 62650 [details] [review]
First version of patch to HEAD

This patch implements script-specific sample strings. It still needs a bit of work, because for fonts that cover lots of scripts (like Arial which covers Greek, Cyrillic, Arabic and Hebrew) it happens to choose the Arabic sample string. One probably should display the traditional Aa for fonts like that. Or maybe a sample string that corresponds to the user's locale? Or give scripts "weights", and add some heuristics.

I assume that for fonts that cover Chinese minority scripts like Tibetan (no political standpoint implied) it makes sense to display the Han sample string anyway, even if Tibetan is the more "rare" language? On the other hand, for a font that covers Thai and Latin (and nothing else), for instance, it's definitely the Thai sample string that should be displayed.
Comment 4 Sven Neumann 2006-04-03 06:31:30 UTC
The inclusion of PANGO_ENABLE_ENGINE could bite us later. But then, we are already doing that in the current code. I was hoping though that we could get rid of this by porting the GIMP text renderer to PangoRenderer. Anyway, this patch looks interesting and should go in as soon as the issue with fonts that cover lots of scripts has been addressed.
Comment 5 Tor Lillqvist 2006-04-03 15:56:13 UTC
Will work on this more this evening to resolve the pending issues and commit.
Comment 6 Tor Lillqvist 2006-04-03 23:06:14 UTC
Committed to HEAD:

2006-04-04  Tor Lillqvist  <tml@novell.com>

	* app/text/gimpfont.c (gimp_font_get_new_preview): Provide
	script-specific short sample strings instead of "Aa" for fonts
	that seem to be designed for some specific non-Latin
	script. Pending a complete redesign and reimplementation of font
	selection, this is at least an improvement, and a partial solution
	to #137624.
Comment 7 Sven Neumann 2006-04-04 07:39:35 UTC
I've done some minor cleanups to your code. Please review.

2006-04-04  Sven Neumann  <sven@gimp.org>

        * app/text/gimpfont.c: moved new code to a utility function. Avoid
        use of deprecated Pango API. Removed tabs and trailing whitespace.
Comment 8 weskaggs 2006-05-20 23:11:29 UTC
It looks to me appropriate to resolve this as FIXED, and have a new bug report for remaining issues.  Based on the comments here, there probably are some, but they are not easy to pick out.