RSS/Atom feed Twitter
Site is read-only, email is disabled

gimp-text-extents-fontname et unicode

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

gimp-text-extents-fontname et unicode Jean-Christophe Dubacq 03 Oct 22:08
  gimp-text-extents-fontname et unicode Sven Neumann 05 Oct 03:18
Jean-Christophe Dubacq
2002-10-03 22:08:04 UTC (over 21 years ago)

gimp-text-extents-fontname et unicode

Hello,

I have found something quite strange. Using locale UTF-8, if I use gimp-text-extents-fontname, I find different results according to the encoding used.

My font is arial narrow (monotype), which comes as a TTF, and I use the native truetype interpreter of XFree (probably Freetype2).

When used with some sample string ("a") in iso8859-1 and 24 pixels: => (gimp-text-get-extents-fontname "a" 24 PIXELS "-monotype-arial-bold-r-condensed--0-0-0-0-p-0-iso8859-1")

(16 27 22 5)

=> (gimp-text-get-extents-fontname "a" 24 PIXELS "-monotype-arial-bold-r-condensed--0-0-0-0-p-0-iso10646-1")

(16 42 37 5)

This is all correct, except if antialiasing is chosen. If antialiasing is enabled, then the placement (and size) of the text is the same in both cases (try:
(gimp-text-fontname 0 -1 0 0 "a" -1 TRUE 24 PIXELS "-monotype-arial-bold-r-condensed--0-0-0-0-p-0-iso10646-1") and
(gimp-text-fontname 0 -1 0 0 "a" -1 TRUE 24 PIXELS "-monotype-arial-bold-r-condensed--0-0-0-0-p-0-iso8859-1") )

which is obviously somehow wrong, since this doesn't correspond any more to the extents data (especially when trying to underline some anti-aliased text in unicode :).

If anybody has an idea, I welcome it.

Btw, if anybody has anyway to use unicode fonts without using UTF-8 locale (example: utf8->wide char internal representation translator in SIOD, correct behaviour for unicode fonts in non-UTF-8 locales, etc.), I also welcome it. Meanwhile, I just set LANG the right way...

Sven Neumann
2002-10-05 03:18:45 UTC (over 21 years ago)

gimp-text-extents-fontname et unicode

Hi,

Jean-Christophe Dubacq writes:

I have found something quite strange. Using locale UTF-8, if I use gimp-text-extents-fontname, I find different results according to the encoding used.

My font is arial narrow (monotype), which comes as a TTF, and I use the native truetype interpreter of XFree (probably Freetype2).

When used with some sample string ("a") in iso8859-1 and 24 pixels: => (gimp-text-get-extents-fontname "a" 24 PIXELS "-monotype-arial-bold-r-condensed--0-0-0-0-p-0-iso8859-1")

(16 27 22 5)

=> (gimp-text-get-extents-fontname "a" 24 PIXELS "-monotype-arial-bold-r-condensed--0-0-0-0-p-0-iso10646-1")

(16 42 37 5)

This is all correct, except if antialiasing is chosen. If antialiasing is enabled, then the placement (and size) of the text is the same in both cases (try:
(gimp-text-fontname 0 -1 0 0 "a" -1 TRUE 24 PIXELS "-monotype-arial-bold-r-condensed--0-0-0-0-p-0-iso10646-1") and
(gimp-text-fontname 0 -1 0 0 "a" -1 TRUE 24 PIXELS "-monotype-arial-bold-r-condensed--0-0-0-0-p-0-iso8859-1") )

which is obviously somehow wrong, since this doesn't correspond any more to the extents data (especially when trying to underline some anti-aliased text in unicode :).

if you use antialiasing, gimp-1.2 requests a font three times as large as the one you specified and scales it down (in order to get some sort of cheap AA). Most probably the font server uses the same font for both requests at this size.

Salut, Sven