Subject: Re: patch: (fixed) unicode fonts under Unix
From: Dom Lachowicz (cinamod@hotmail.com)
Date: Wed Jan 31 2001 - 11:26:00 CST
>I anticipated you would ask that :-) but could not come up with any
>other way to find out whether the given font is Unicode, than by
>testing the min_byte1 and max_byte1 elements of XFontStruct. In
>fact this it the way it is done inside Gdk. I will examine how it is
>done inside Gtk 2.0's gdk_draw_text when I can get to it, but if
>they do away with the GdkFontPrivate type, then we may need to
>use conditional compilation.
>
>I realise that it is messy, but it is not my mess, it is the 'unclean'
>way that gdk_draw_text handles its input that is to blame. Whoever
>produced the 16-bit string hack for this function did not appreciate
>that some people may want to draw with both 8 and 16 bit fonts
>without having to use 8-bit strings at all; GDK should have really
>provided gdk_draw_text and gdk_draw_text16, then under utf-8
>locale we would always use gdk_draw_text16 and would not have
>to worry whether the font is Unicode or not; I only need to know
>what type of font it is to predict what gdk will do with the input I
>pass to it, i.e., whether it will interpret it as a 8 bit string or 16 bit
>string.
Tomas,
I've done quite a bit of scouring through the GDK APIs and sources in my
day, and I came to the same conclusions that you do. I was thinking that
perhaps gdk_draw_text_wc might be used, since I think that the "wc" refers
to "Wide Char" which I understand to be 16 bits, but I've been wrong before.
Given the circumstances, I have no objections to using the X code. I'd
really prefer, however, if you split off the test of min_byte and max_byte
into a static function that returns gboolean or UT_Bool, and place that
function (and the #include gdk-private.h call) inside of an #if 1 construct,
so that we can just change that bit of code once someone starts work on the
GTK2.0 port of AbiWord. If you do this, it'll be a lot cleaner and I'll
happily commit this great patch :-)
Dom
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
This archive was generated by hypermail 2b25 : Wed Jan 31 2001 - 11:26:03 CST