Kaixo! On Fri, Jan 17, 2003 at 07:27:16PM +0100, Juliusz Chroboczek wrote:
> If you want to do the dirty thing, you XOpenQueryFont a > Unicode-encoded font instance (one whose name ends in ``iso10646-1''), > then you do a UTF-8 to UCS-2 conversion yourself, finally you do > XDrawString (or XDrawText16) at the resulting string. > > If you're using the XFree86 libs, an alternative is to use > Xutf8DrawText. But, unless I'm wrong, that only works for characters that have a 1-to-1 mapping to glyphs (that means no indic languages, no use of composing diacritics(*), no korean jamos,...) and that are written left ro rigth(**), and for characyers that actually have a glyph in the font. It may be enough for you (that still covers a lot: all latin and cyrillic languages; greek, armenian, georgian, chinese, corean, japanese, ethiopic languages, inuit, cree), but takes you out of all arabic script languages, hebrew, yiddish, all indic scripts languages, all scripts derived from indic scripts (in short, all native scripts of sothern Asia); yo uare also out of using composing chars (like you need a "v" with an "arrow on top" for example, it is possible to encode it in unicode, but it needs some smarter displaying mechanism) (*) it's possibleto cheat using glyphs with negative metrics (that is how Thai support worked for several years), but it isn't as beatiful as possible. (**) it is possible, but you have to do the reordering yourself. > I would strongly recommend that you port your application to Gtk+ 2. Gtk2 (trough pango) solves all those problems, it also allows getting missing glyphs from other fonts; in practice that means that programmers doesn't have to care at all about it, a text is just a text and displayed trough the text displaying function, all the dirty details are handled automagically (of course, if you are a nice programmer you also provide the user with the possibility to select the font he wants, size, etc;) -- Ki ça vos våye bén, Pablo Saratxaga http://chanae.walon.org/pablo/ PGP Key available, key ID: 0xD9B85466 [you can write me in Walloon, Spanish, French, English, Italian or Portuguese]
msg03794/pgp00000.pgp
Description: PGP signature