|
From: Shigeharu T. <sh...@ie...> - 2007-08-03 06:33:47
|
shige 08/03 2007 ---------------- Ethan Merritt wrote: > On my linux systems, the Japanese + cairopdf problem can be > solved by adding a call to > setlocale(LC_CTYPE,""); > on program entry. That may or may not be an acceptable change, however. > > Perhaps it would be better to make this part of the "set encoding" > command. For terminals such as cairopdf it would be sufficient > to add an option > set encoding locale > without actually adding to the internal table of known encodings. > I append a patch below that implements this. I tested your patch and it works fine on Solaris 9 and FreeBSD 5.4. http://takeno.iee.niit.ac.jp/~shige/unix/gnuplot/data/cairopdf-euc-1.pdf http://takeno.iee.niit.ac.jp/~shige/unix/gnuplot/data/cairopdf-utf-1.pdf are the result of the followings: set encoding locale set term cairopdf set out 'cairopdf.pdf' set title "ABCDE (jastring)" font "Sazanami Gothic,20" set xlabel "ABCDE (jastring)" font "IPAGothic,16" set ylabel "ABCDE (jastring)" font "IPAMincho,14" set label "ABCDE (jastring)" rotate by 60 \ font "Sazanami Mincho,24" tc lt 3 plot sin(x) set out > I was already planning to add utf8 (needed for png terminal + Adobe > symbol font, and for PostScript using patchset #1746352). > Perhaps we also should have some or all of > EUC-JP shift-jis ujis iso_2022_jp > But I really don't know how to support these for most terminal types. I think this is not so easy. For example, gdlib 2.X supports unicode encoding fonts and we can use UTF-8 string by gdImageStringTTF(). But for other encoding strings (EUC-JP, Shift_JIS, ISO-2022-JP), we must build the gdlib with the compilation flag -DJISX0208. That is, the treatment of Japanese encoding strings depends on the library itself. To give the EUC-JP strings to default gdlib, we must convert the string encoding to utf-8 in gnuplot (by iconv(3), for example). +========================================================+ Shigeharu TAKENO NIigata Institute of Technology kashiwazaki,Niigata 945-1195 JAPAN sh...@ie... TEL(&FAX): +81-257-22-8161 +========================================================+ |