[Gimp-developer] gimp-text-extents-fontname et unicode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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...


[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux