|
From: <tim...@en...> - 2006-04-17 03:35:45
|
> Two questions > > (1) > I've been poking about in the code, and so far as I can > see the code assumes that character strings passed to Pango > will be interpreted as UTF-8. E.g. the following comment: > > /* pango needs a string encoded in utf-8. We use g_convert from glib. > * gp_cairo_get_encoding() gives the encoding set via 'set enconding' > * memory allocated for enhanced_text_utf8 is freed at the end of > * gp_cairo_enhanced_flush */ > string_utf8 =3D g_convert(string, -1, "UTF-8", > gp_cairo_get_encoding(plot), NULL, NULL, NULL); > > But this doesn't happen. My machines are normally set to a UTF-8 locale= , > and all characters I type into gnuplot are UTF-8 encoded. > But the multibyte characters are mangled when displayed in the wxt plot > window. > The same strings are properly displayed in x11 (when set to multibyte > mode) > and in gd (which by default uses UTF-8). So I know they are correctly > stored inside gnuplot. What's going wrong in wxt? Thanks for digging on this side. Let me explain how it works currently : - if the user has used "set encoding ..." where "..." is something different from "default", the terminal converts from this encoding to utf= 8 - otherwise, it falls back to iso8859-1. That's why the terminal doesn't show your multibyte-utf8 characters. I can implement the following : - if the user has used "set encoding ..." where "..." is something different from "default", the terminal converts from this encoding to utf= 8 - otherwise, use the 'locale' to determine the input charset, and assume this is the input encoding for the conversion to utf8. However, I am still not clear on one thing : If you launch the demo 'charset.dem' : - with the current code, the wxt terminal will show all characters as iso8859-1 encoded. - with the new code falling back to the 'locale' charset, and if your locale charset is UTF-8, you won't see the last four lines, as the utf8 specification doesn't allow 8 bits characters where the upper bit is 1 (see http://en.wikipedia.org/wiki/UTF-8 for details on this specification= ) At the same time, the X11 terminal will show these lines !!! So my question is : what is the X11 terminal doing ?? Ethan, can you check on your box ? > > (2) > I happened across a page of sample plots from another plotting program, > and was struck by how useful transparency can be in some cases. > In particular in the case of overlapping histograms > http://sourceforge.net/project/screenshots.php?group_id=3D15494 > I think it would be possible to support this in gd.trm and svg.trm, > but I'm not sure about any other terminals. Do the Cairo graphics > primitives support an alpha channel, so that wxt.trm could use this als= o? > Chris has already answered, and I can only confirm. Cairo has definetely been designed with alpha transparency in mind. Regards, Timoth=E9e |