|
From: Ethan M. <merritt@u.washington.edu> - 2005-07-05 17:16:29
|
On Tuesday 05 July 2005 09:26 am, Robert Hart wrote: > On Tue, 2005-07-05 at 08:48 -0700, Ethan A Merritt wrote: >=20 > > My machines all use UTF-8. It works fine. >=20 > Are you sure about this?=20 Well, it works for me. > I see two problems.=20 > 1) Inputting multibyte characters gives problems using backspace and/or > cursor keys to edit the command. I use SCIM for multibyte input. This interface is independent of the program being used. Yes, there are some operations that may not work the way you expect, but this has nothing in particular to do with gnuplot. You just have to learn the conventions of the input layer. > 2) Actual output shows incorrect characters. >=20 > e.g.: >=20 > set xlabel "=E1=E2=E3=E4" font "Verdana" > show xlabel Are you sure that you have a UTF-8 version of Verdana? Is your LC_CTYPE set to a UTF-8 language type appropriate for these letters? Which x11 terminal type are you using for input? The terminal you are running from needs to support multibyte x11 fonts in order for it to display properly. For me it works in nxterm, but not in many of the other xterm clones. But just because the terminal is too stupid to display it properly doesn't mean it is incorrectly stored in the program. > (note I'm trying to set the xlabel to contain greek characters in this > example) I cannot comment on this specifically. I have not tried using Greek in UTF-8, nor do I have any Greek fonts installed. (Note that the Adobe and MS Symbol fonts are *not* UTF-8 fonts). But I have successfully used Japanese UTF-8 fonts, following the guidelines of Shigeharu Takeno http://takeno.iee.niit.ac.jp/~shige/unix/gnuplot/gnuplot.html When I next get some time, I'll post some examples. However... I was wrong to imply that UTF-8 works equally well for all output terminals. Harald is correct in pointing out that UTF-8 output in PostScript is far more problematic than in x11 or via libgd. Harald Harders <h.h...@tu...> wrote > >> So my question: Is it possible to add UTF to "set encoding"? At >> least for the postscript terminal? What does the postscript >> standard say about UTF? > > Postscript can only handle 255 characters per font encoding. Thus, it does > not work with UTF-8. It may be possible to add a second and third encoding > that contains the encoding vectors for UTF-8 fonts. Thus, 255 characters > will be put into one font. E.g., /Times-Roman, /Times-Roman-1, > /Times-Roman-2. But this is just theoretical, not yet implemented in > gnuplot. It's a mess. PostScript 2015 (don't ask me why it seems to have appeared 10 years early :-) implements a two-layer font decoding mechanism. One layer is Adobe's own "CID-keyed font" 16-bit encoding, one is the native unicode or other multibyte font. The viewing device must arrange for=20 translation from one encoding to the other, or else the translation table and conversion routine must be included in the file itself. A general discussion, particularly with regard to ghostscript is here =20 http://www.cs.wisc.edu/~ghost/doc/gnu/7.05/CJK.htm =2D-=20 Ethan A Merritt merritt@u.washington.edu Biomolecular Structure Center Mailstop 357742 University of Washington, Seattle, WA 98195 |