|
From: Allin C. <cot...@wf...> - 2010-07-24 17:07:16
|
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 |