|
From: Shigeharu T. <sh...@ie...> - 2005-01-28 12:11:24
|
shige 01/28 2005 ---------------- I made patches for using multi byte fonts in x11 terminal, by modifying the patch code included in Yamaga's gnuplot+ patch. He kindly accepted to use it and hoped it will be included in gnuplot-current CVS tree. The patches are the followings: http://takeno.iee.niit.ac.jp/~shige/unix/gnuplot/data/gplt-mbfont9.diff http://takeno.iee.niit.ac.jp/~shige/unix/gnuplot/data/gplt-mbfont10.diff The two patches are almost the same, but the latter one uses wrapper functions absorbing the differences of treating single byte fonts and multi byte fonts. Under the patch the multi byte extension is done in gnuplot by specifying the prefix "mbfont:" on the font name. For example, set term x11 font 'mbfont:kana14;k14' # "kana14" is alias name of a single byte font "*-jisx0201.1976-0", # "k14" is of multi byte font "*-jisx0208.1983-0", # and ';' is the separator of font names. set term x11 font 'mbfont:fixed,16,r,medium' # the patch also support <font>,<size>,<slant>,<weight> form Since it uses the function XmbDrawString() which require setlocale() and XLOCALE, I think the feature should be enable if the option like "--enable-x11-multibyte" is specified to the configure script for the definition of "USEXMULTIBYTE". The multi byte extension is not only for Japanese, I tested it on some multi byte locales: ja_JP.EUC (Japanese), ko_KR.EUC (Korean), zh_CN.EUC (Chinese). It seems to work fine under the appropriate locale setting (for example, "setenv LC_ALL ko_KR.EUC"). The function XmbDrawString() use XFontSet which includes several fonts: for ja_JP.EUC: *-jisx0201.1976-0 (single byte font) *-jisx0208.1983-0 (multi byte font) for ko_KR.EUC: *-ksc5636-0 or *-iso8859-1 (single byte font) *-ksc5601.1987-0 (multi byte font) for zh_CN.EUC: *-gb1988.1989-0 or *-iso8859-1 (single byte font) *-gb2312.1980-0 (multi byte font) So, we need the separator ';' to specify several font names and could not realize by using gnuplot's feature 'set encoding'. Some sample scripts and images are on the following page (but, the page is written in Japanese, sorry): http://takeno.iee.niit.ac.jp/~shige/unix/gnuplot/gnuplot.html The patch also supports two special font names "Ryumin-Light" and "GothicBBB-Medium" (the advice from N.Matsuda) which are the Japanese standard PostScript font names. These fonts can be used without the prefix "mbfont:". +========================================================+ Shigeharu TAKENO NIigata Institute of Technology kashiwazaki,Niigata 945-1195 JAPAN sh...@ie... TEL(&FAX): +81-257-22-8161 +========================================================+ |