|
From: Allin C. <cot...@wf...> - 2010-07-20 04:23:03
|
I'm trying to help someone who wants to get traditional Chinese characters into plots. This works fine for the gnuplot terminals that natively support UTF-8 (e.g. the pango/cairo based ones), but is not so easy with EPS and EMF. Does anyone have any experience with this and have any pointers to share? Thanks. -- Allin Cottrell Department of Economics Wake Forest University |
|
From: Ethan A M. <merritt@u.washington.edu> - 2010-07-20 04:42:03
|
On Tue, 20 Jul 2010, Allin Cottrell wrote:
>
> I'm trying to help someone who wants to get traditional Chinese
> characters into plots. This works fine for the gnuplot terminals
> that natively support UTF-8 (e.g. the pango/cairo based ones), but
> is not so easy with EPS and EMF.
>
> Does anyone have any experience with this and have any pointers to
> share? Thanks.
Definitely not possible in the current EMF terminal; it would have to
be re-written to use wide characters.
EPS is possible, sort of, but IMHO it is far too much trouble to be
worth it. Sketchy instructions for creating code mappings for PostScript
are in .../term/PostScript/unicode_maps.README. This mechanism does
work, painfully, but it can only handle a limited number of character
codes. Using it for CJK character sets is a nightmare.
My advice would be to use pdfcairo and then convert from PDF
to EPS afterward.
Ethan
>
> --
> Allin Cottrell
> Department of Economics
> Wake Forest University
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> gnuplot-beta mailing list
> gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
>
|
|
From: Allin C. <cot...@wf...> - 2010-07-20 12:53:16
|
On Mon, 19 Jul 2010, Ethan A Merritt wrote: > On Tue, 20 Jul 2010, Allin Cottrell wrote: > > > > I'm trying to help someone who wants to get traditional Chinese > > characters into plots. This works fine for the gnuplot terminals > > that natively support UTF-8 (e.g. the pango/cairo based ones), but > > is not so easy with EPS and EMF. > > > > Does anyone have any experience with this and have any pointers to > > share? Thanks. > > Definitely not possible in the current EMF terminal; it would have to > be re-written to use wide characters. > > EPS is possible, sort of, but IMHO it is far too much trouble to be > worth it... Thanks, Ethan, this has saved me from wasting a good deal of time! -- Allin Cottrell Department of Economics Wake Forest University |
|
From: Allin C. <cot...@wf...> - 2010-07-20 17:13:34
|
On Mon, 19 Jul 2010, Ethan A Merritt wrote: > On Tue, 20 Jul 2010, Allin Cottrell wrote: > > > > I'm trying to help someone who wants to get traditional Chinese > > characters into plots. This works fine for the gnuplot terminals > > that natively support UTF-8 (e.g. the pango/cairo based ones), but > > is not so easy with EPS and EMF. > > > > Does anyone have any experience with this and have any pointers to > > share? Thanks. > > Definitely not possible in the current EMF terminal; it would have to > be re-written to use wide characters... One more thought on this. My understanding is that the MS wide-character function ExtTextOutW is for use with UTF-16 (only?). But what if you encoded Chinese strings in a plot file as CP950? I notice that the symbol CHINESEBIG5_CHARSET (=136) seems to be defined in connection with EMF files. Gnuplot could support that quite easily, in the minimal sense of offering a "cp950" encoding option and, in case that is in force, setting the charset byte in EMF output to CHINESEBIG5_CHARSET. I gather that unlike UTF-16, text in CP950 doesn't contain any embedded NULs so maybe it could be handled by ExtTextOutA? Under what conditions (if any) EMF files created in this way would display correctly, I'm not sure, but it might be worth a go. Allin Cottrell |
|
From: Allin C. <cot...@wf...> - 2010-07-20 19:52:00
Attachments:
cp950.diff
|
On Tue, 20 Jul 2010, Allin Cottrell wrote: > [W]hat if you encoded Chinese strings in a plot file as CP950? I > notice that the symbol CHINESEBIG5_CHARSET (=136) seems to be > defined in connection with EMF files. Gnuplot could support that > quite easily, in the minimal sense of offering a "cp950" > encoding option and, in case that is in force, setting the > charset byte in EMF output to CHINESEBIG5_CHARSET. This seems to work. I made an EMF file with this recipe, encoding to cp950 and using a Big5 font: set term emf font "AR PL Mingti2L Big5,12" set encoding cp950 The Chinese characters display correctly using the freeware EMF viewer eview.exe under Wine. (Unfortunately the EMF crashes OpenOffice on Linux; I'm not sure whose fault that is.) In case it's of interest I'm attaching my patch. Allin Cottrell |
|
From: sfeam (E. Merritt) <eam...@gm...> - 2010-07-24 16:39:46
|
On Tuesday 20 July 2010, Allin Cottrell wrote: > On Tue, 20 Jul 2010, Allin Cottrell wrote: > > > [W]hat if you encoded Chinese strings in a plot file as CP950? I > > notice that the symbol CHINESEBIG5_CHARSET (=136) seems to be > > defined in connection with EMF files. Gnuplot could support that > > quite easily, in the minimal sense of offering a "cp950" > > encoding option and, in case that is in force, setting the > > charset byte in EMF output to CHINESEBIG5_CHARSET. > > This seems to work. I made an EMF file with this recipe, encoding > to cp950 and using a Big5 font: > > set term emf font "AR PL Mingti2L Big5,12" > set encoding cp950 That's really interesting. I had interpreted the EMF documentation differently; wherever it refers to "unicode", I had understood that to mean "any multibyte encoding" and thus concluded that the wide character versions of all the text routines were necessary. But hey, if it works - that's great. > The Chinese characters display correctly using the freeware EMF > viewer eview.exe under Wine. (Unfortunately the EMF crashes > OpenOffice on Linux; I'm not sure whose fault that is.) Seems only fair. Until recently the EMF output was interpreted fine under linux but crashed the Windows viewer :-) Could you send me a sample EMF file that OpenOffice has troubles with? I have a couple of other EMF viewers that I run under linux and I'm curious what they think about it. > In case it's of interest I'm attaching my patch. Do you know if the various other terminal types do anything reasonable with CP950 fonts? That is, should we add this to the list of supported encodings in the "set encoding" command? Ethan |
|
From: Allin C. <cot...@wf...> - 2010-07-24 17:07:16
Attachments:
yinung.emf
|
On Sat, 24 Jul 2010, sfeam (Ethan Merritt) wrote: > On Tuesday 20 July 2010, Allin Cottrell wrote: > > On Tue, 20 Jul 2010, Allin Cottrell wrote: > > > > > [W]hat if you encoded Chinese strings in a plot file as CP950? I > > > notice that the symbol CHINESEBIG5_CHARSET (=136) seems to be > > > defined in connection with EMF files. Gnuplot could support that > > > quite easily, in the minimal sense of offering a "cp950" > > > encoding option and, in case that is in force, setting the > > > charset byte in EMF output to CHINESEBIG5_CHARSET. > > > > This seems to work. I made an EMF file with this recipe, encoding > > to cp950 and using a Big5 font: > > > > set term emf font "AR PL Mingti2L Big5,12" > > set encoding cp950 > > That's really interesting. I had interpreted the EMF documentation > differently; wherever it refers to "unicode", I had understood that > to mean "any multibyte encoding" and thus concluded that the wide > character versions of all the text routines were necessary. > But hey, if it works - that's great. The docs are not very clear, but I did come across some references to double-byte characters in the context of ExtTextOutA. I think that ExtTextOutW is strictly for use with UTF-16LE. > > The Chinese characters display correctly using the freeware EMF > > viewer eview.exe under Wine. (Unfortunately the EMF crashes > > OpenOffice on Linux; I'm not sure whose fault that is.) > > Seems only fair. Until recently the EMF output was interpreted > fine under linux but crashed the Windows viewer :-) > Could you send me a sample EMF file that OpenOffice has troubles > with? I have a couple of other EMF viewers that I run under linux > and I'm curious what they think about it. Sure, I'm attaching a sample. I tried it with a different Windows viewer (irfanview, under wine) and again it was OK. I've also inspected the file with the program "printemf" (from the libEMF package) and I can't see anything wrong with it. > > In case it's of interest I'm attaching my patch. > > Do you know if the various other terminal types do anything > reasonable with CP950 fonts? That is, should we add this to the > list of supported encodings in the "set encoding" command? Hmm, I'm not aware of another terminal type that could handle Big5-encoded input, but then my knowledge is mostly restricted to png, pdf, postscript and emf. Allin Cottrell |