GNOME Bugzilla – Bug 79754
Text tool should use gdk_fontset_load()
Last modified: 2003-05-11 00:17:48 UTC
In some case, I can't call Japanese font set when it pop up the message "Font 'foo' not found." although there are fonts in font list in text tool. So we apply this patch to call such font set.
Created attachment 7924 [details] [review] gimp-1.1.32-textfont.patch
I guess we should use gdk_fontset_load() for all platforms just as Tor suggests in a comment around line 627 in app/text_tool.c.
Some time ago I built a GIMP 1.2.2 RPM for SUSE. There was a gimp-fontset.patch included: --- app/text_tool.c.orig Sat Jan 27 16:29:16 2001 +++ app/text_tool.c Sat Jan 27 16:31:50 2001 @@ -607,7 +607,7 @@ gdk_error_warnings = 0; gdk_error_code = 0; #ifndef GDK_WINDOWING_WIN32 - font = gdk_font_load (fontname); + font = gdk_fontset_load (fontname); if (!font) { g_message (_("Font '%s' not found."), fontname); @@ -838,7 +838,7 @@ gdk_error_warnings = 0; gdk_error_code = 0; #ifndef GDK_WINDOWING_WIN32 - font = gdk_font_load (fontname); + font = gdk_fontset_load (fontname); if (!font) return FALSE; The problem was: It did not work. If I entered umlauts into the (dynamic) text tool, the text got truncated there (although they showed up fine in the preview). (I used the "C" locale, not de_DE or something). I talked a bit with Daniel Egger but we didn't come to a clear solution. If I find the time, I'll check out CVS today and give check whether the problem persists. I tracked down the problem to gdk_measure_text which called XmbTextExtens which in turn returned the wrong width (truncated at first umlaut). Fontset support might be a hairy issue and hard to get right.
I don't think you can expect umlauts (צה� ...) to work if you are using the C locale. Any character outside the 7bit ASCII range is undefined in the C locale and you can't expect any software to do the right thing with undefined values. If you want the user interface to be in english, use the en_US locale that defines the charset as ISO-8859-1 which even includes german umlauts.
I send e-mail to Khoming who posted the patch to GIMP bug report. The patch is applied in 2002-11-07. http://cvs.gnome.org/bonsai/cvsview2.cgi? diff_mode=context&whitespace_mode=show&file=gimptexttool.c&root=/cvs/g nome&subdir=gimp/app/tools&command=DIFF_FRAMESET&rev1=1.79&rev2=1.80 Khoming says: The original patch is in BSD port. There was a issue that I can't load non iso-8859-1 font e.g. some picture font (like Symbol font) if I replace gdk_font_load with gdk_fontset_load. In X Window with Japanese environment, we can use only Japanese font and iso-8859-1 as fontset. So it is faiure to load Symbol font what registry-encording is "adobe-fontspecific". Therefore I load the font using gdk_font_load, and reload font using gdk_fintset_load if font is multibyte. Hmm, applying this patch (gimp-1.1.32-textfont.patch) is not debug, isn't it?
I first tested with CVS-gimp without modifications (no fontsets used). Umlauts seem to work in the "C" (or no) locale - but only in built-in text-tool. gdyntext does not work. Setting the locale to "de" helped both tools. Now I tested with CVS-gimp with the above patch: Umlauts do not work any more (without locale) - neither in text-tool nor gdyntext. Changing the locale to en_US fixes things. Okay, maybe I'll simly set the default locale to en_US - I just don't like German error messages and therefore got rid of all LC_* and LANG env variables. From my point of view, the code is right and doesn't need to be changed.
> The patch is applied in 2002-11-07. I'm mistake: s/2002/2000/
Suggesting WONTFIX. At the very worst, the target should be bumped. Dave.