[Pkg-lyx-devel] Bug#274100: lyx-qt + russian locale + math symbols display

Nikita V. Youshchenko "Nikita V. Youshchenko" <yoush@cs.msu.su>, 274100@bugs.debian.org
Thu, 30 Sep 2004 15:03:17 +0400


> Nikita> LC_TIME=C lyx-qt
>
> I have to admit that I thought at first that LC_TIME was a typo and
> that I went to check the sources :) I can see now that
> QFont::initialize() in qfont_x11.cpp does use the LC_TIME locale to
> determine some locale characteristics.
>
> Do you understand what this code does? Should LyX set LC_TIME to C
> unconditionally, or would that disable some interesting feature?
>
> That's very weird.

One day (several months ago) I was tired with lyx-qt math editor being 
unusable in russian locale, and tried to dig into. I wrote to 
latex-xft-fonts package creators, asking for details. I got the following 
reply:

> > Hello.
> >
> > From README of latex-xft-fonts tarball:
> > > If you're using a locale such as LANG=ru_RU, and some others,
> > > these fonts will not load in Qt. This is a Qt bug that Troll
> > > Tech refuse to fix.
> >
> > Could you please provide more information on this, or point me to such
> > information if it is available?
>
> Troll Tech assigned it a number of N19481, said they'd fixed it, and
> when they hadn't, stated they would not.
>
> Basically, the XFT fonts have a particular encoding, and it does not
> match that requested by Qt when it's looking for a font suitable for
> Cyrillic (even though there is no Cyrillic glyph used for the math
> symbols).
>
> It might be possible to produce a set of math XFT fonts with a matching
> encoding, but my attempts using pfaedit have so far failed.
>
> regards
> john

Then I looked at qt sources, and found all that things in qfont_x11.cpp
I failed to understand why the do so, and decided to give up (noting in my 
todo that one day I should think more).
Yesterday I found that todo, and realized that I may fool Qt by resetting 
LC_TIME. Not much things actually use LC_TIME, so I hope it should not 
break anything. I tried it, and it worked.
So I wrote to several lists about it, and enabled workaround on systems 
that I administer (our users use lyx sometimes; until now they had to use 
either xforms version or qt version without russian locale).
Unfortunately, today one of our users reported that lyx-qt (installed from 
debian binary package 1.3.4-2) crashes every other minute for him, until 
restarted with LC_ALL=C.
I was not able to reproduce crashes (however, I can't say I tried very 
hard). I don't know if it related to running lyx-qt in a "mixed" locale, 
or just to running it in russian locale, or completely unrelated (e.g. it 
crashes on user's particular document).
Currently I'm rebuilding the package with debugging symbols enabled; I'll 
ask the user to try this version and try to get a coredump of the crash.
I'll report the results.