Jean-Marc Lasgouttes wrote:

> 03/03/2014 10:46, Juergen Spitzmueller:
>> diff --git a/src/frontends/qt4/GuiPainter.cpp
>> b/src/frontends/qt4/GuiPainter.cpp index ee0f65a..a1b0de0 100644
>> --- a/src/frontends/qt4/GuiPainter.cpp
>> +++ b/src/frontends/qt4/GuiPainter.cpp
>> @@ -352,6 +352,10 @@ int GuiPainter::text(int x, int y, docstring const &
>> s,
>>   // same as that of a soft-hyphen (0x00ad), unless it
>>   // occurs at a line-break. As a kludge, we force Qt to
>>   // render this glyph using a one-column line.
>> +    // FIXME In texted, this behaves differently depending
>> +    // on lyxrc.force_paint_single_char status.
>> +    // Should the soft hyphen char be displayed at all?
>> +    // I don't think so (i.e., Qt is correct here). /spitz
>>   if (s.size() == 1 && str[0].unicode() == 0x00ad) {
>>   setQPainterPen(computeColor(f.realColor()));
>>   QTextLayout adsymbol(str);
> 
> Since force_paint_single_char will eventually go away, we'll probably
> have to remove this code. OTOH, is it really the spirit of LyX to hide
> this soft-hyphen? At least if we do so, we should mark it as a line
> separator character...

We have to distinguish between text and math here. For text qt is probably 
right. For math we use a bad hack employing dangerous casts for symbol fonts 
(see the big comment at the beginning of GuiPainter::text()). This means 
e.g. that \Omega is mapped to the code point 0x00ad, and the hack is needed. 
OTOH, it is not sufficient, as http://www.lyx.org/trac/ticket/7954 shows. 
Until we have a real solution, please adjust the comment so that it applies 
to text only and it is clear that the hack is needed for math.

A rather easy workaround for the fonts we ship is to duplicate the symbols 
at other positions and then change the code point in lib/symbols. I did this 
e.g. for stmary10.ttf (duplicate instead of move so that people using the 
font for other purposes do not get surprised). However this does not work 
for fonts we do not ship. For these we should redesign how we handle symbol 
fonts, so that qt knows about the font encoding, and we do not need to use 
wrong unicode code points which trigger special treatment in qt.


Georg


Reply via email to