|
From: Ethan M. <merritt@u.washington.edu> - 2007-01-13 01:04:26
|
I've been using the wxt terminal by default for so long now that I failed to notice breakage with the x11 terminal. Or perhaps it broke even longer ago and I just didn't notice. Here is the problem: When you specify a simple font name and size, for example set term x11 font "times,12" gnuplot_x11 eventually translates this into a full x11 font spec of the form -*-times-*-r-*-*-12-*-*-*-*-*-iso8859-15 Notice in particular those last two fields, which specify the desired character encoding. If you tell gnuplot "set encoding koi8r", or whatever, it will correctly fill in those last two fields accordingly. No problem there. The issue is what to do by default if no specific encoding has been specified by the user. The code currently fills the fields in with wild-cards: -*-times-*-r-*-*-12-*-*-*-*-*-*-* This used to work, or at least I convinced myself at one time that it was working. Now it doesn't. Perhaps this is because I now have newer versions of x11 (x.org); perhaps it is because I have a wider variety of fonts installed, including multibyte fonts; perhaps it is because I am now using a UTF-8 locale everywhere. I don't know. Because gnuplot_x11 tries very hard to fall back to something reasonable, in general you may not notice that you didn't get exactly what you asked for. But if you ask for something more exotic, like set term x11 font "french script mt,30" it becomes apparent that it isn't being correctly selected. I can fix this on my machines by changing the full wild-card *-* to the more restricted wild-card iso*-* but I have not tested it nearly as widely as I would like. Up until now I didn't even know you _could_ specify restricted wild-cards in an x11 font spec. I will put this change into cvs for additional testing. The real conundrum is what to do for 4.2 - Leave it as is? (broken on current machines) - Change the default to iso8859-1? (likely to work on the maximum number of machines, but unfortunate for those who don't use isolatin1) - Change the default to iso*-*? (works for me, and doesn't limit to isolatin1, but I have no idea how universally accepted this syntax is) - Make the default encoding an X-resource? (There would still have to be a default, with same concerns as above, but at least the end-user can be given instructions how to change it) Can someone confirm whether the current code really does work on older x11 setups? If it has been broken all along then I don't worry so much that a change to iso8859-1 or iso8859-* or iso*-* will be worse than the current code on some machines. If you want to experiment, the code at issue starts at gplt_x11.c line 5453 fontencoding = ( encoding == S_ENC_CP437 ? "dosencoding-cp437" : encoding == S_ENC_CP850 ? "dosencoding-cp850" : encoding == S_ENC_ISO8859_1 ? "iso8859-1" : encoding == S_ENC_ISO8859_2 ? "iso8859-2" : encoding == S_ENC_ISO8859_15 ? "iso8859-15" : encoding == S_ENC_KOI8_R ? "koi8-r" : encoding == S_ENC_KOI8_U ? "koi8-u" : "*-*" ) ; The proposed fix is to change that last line to "iso*-*" or "iso8859-*" I would have expected that latter change to potentially break UTF-8 setups, but it doesn't break mine so I may be worrying needlessly. |