Incorrect XFontStruct entries in an XFontSet
Ilya Anfimov
ilan at astelecom.ru
Mon May 23 13:24:22 UTC 2016
On Fri, May 20, 2016 at 09:33:01PM +0300, Andrey ``Bass'' Shcheglov wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,
>
> I've encountered a problem of XFontSet "expansion" in libX11.
>
> Consider the following C code:
> <https://gist.github.com/unix-junkie/45674ced6c6aa06209677bbbaa2d655f>
>
> In ru_RU.ISO-8859-5 locale,
[skipped]
> The practical effect of this behaviour is that Motif, for instance,
> refuses to draw a string at all (see this SO question for screenshots:
> <https://stackoverflow.com/questions/37255098>).
>
>
> I've run a research and found out different libX11 versions from
> different vendors exhibit different behaviour in ru_RU locale (in
Well, ru_RU locale in X11 is expanded to X11 locale rules ac-
cording to /usr/share/X11/locale/locale.alias
(or /usr/X11R6/lib/locale/locale.alias, or something similar,
determined by compile-time and usually according to local unix
version rules).
The X11 default was ru_RU.KOI8-R for a long time, and somewhere
in mid-2000 it changed to ru_RU.UTF-8. However, a packager defi-
nitely should change it to system value of ru_RU locale (proba-
bly, ru_RU.ISO8859-5 on Solaris).
If the X11 ru_RU points to ru_RU.UTF-8, and system one is
ru_RU.ISO8859-5, then your example should not display something,
really, as a russian text in ISO8859-5 is not a valid UTF-8
string, apart from spaces and puntuation.
And this is not an error of font list expandsion itself, it is
encoding error.
However I had found found that in stable Debian the ru_RU.UTF-8
in this example does not work either (both by full name and when
written by some alias). It looks like it just cuts off 8th bit of
text, displaying apostrophe and some other ascii letter for every
russian letter.
en_US.UTF-8 surprisingly does works, and when
/usr/share/X11/locale/en_US.UTF-8/XLC_LOCALE
is copied to /usr/share/X11/locale/ru_RU.UTF-8/XLC_LOCALE, the
ru_RU.UTF-8 starts working as needed.
The file itself looks generally OK.
Xaw widgets and Xlib XmbDrawText works just fine, so this is
probably some motif error. I am continuing investigation.
[skipped]
> Questions:
>
> - - Is this a known issue?
Probably not.
> - - How can I further diagnose it? Have taken a look at libX11 source
> code, but don't have a clue so far.
> - - Where should I report a bug? Particularly, which bugzilla project
> and component correspond to libX11?
at least ru_RU alias should be reported to you package maintainer.
More information about the xorg
mailing list