Am 22.11.2010 um 12:50 schrieb Enrico Forestieri:

> On Mon, Nov 22, 2010 at 12:33:17PM +0100, Pavel Sanda wrote:
> 
>> Abdelrazak Younes wrote:
>>> On 11/22/2010 09:57 AM, you...@lyx.org wrote:
>>>> Author: younes
>>>> Date: Mon Nov 22 09:57:33 2010
>>>> New Revision: 36430
>>>> URL: http://www.lyx.org/trac/changeset/36430
>>>> 
>>>> Log:
>>>> Work around bug #6920. This disables ligatures with involving 'f'
>>>> character.
>>>> 
>>> 
>>> Bennett, Stefan, please check that.
>> 
>> its fixed here now. Juergen this problem is also in branch.
> 
> I cannot reproduce this bug with any font (including DejaVu) on Linux,
> Windows and Solaris, with or without this patch. I verified that the
> ligatures are present at U+FB00-U+FB04, so it cannot be due to their
> presence or absence (tested with Qt 4.6.3 and 4.7.0).
> So, what triggers it?

I don't know if you already have an answer.
I think the surprising fact is - it has nothing to do with unicode ligatures.

The problem is the "too clever" font rendering of Qt. Similar to the TeX engine.
E. g. you typeset the word "infinite". The "fi" ligature is rendered 
automatically
if the font has the appropriate capabilities.
Currently this happens only for rare circumstances.

Abdel's solution is like a hard coded ligature-break.
When "fi" is found LyX will render "f" and "i" instead.

Abdel, I'm sorry to say that, but I don't think it's sufficient.
This "fi" ligature is only one example. There are others, for sure.
And Bennett presented another incarnation of this bug in his mail today.
Please, correct me if I'm wrong...

I understand, it's very hard to solve correctly. 
I guess, the text metrics machinery of LyX is not ready to handle that.

Qt proposes the use of QTextLayout.

In QFontMetrics::width() one can read:

    \warning This function will produce incorrect results for Arabic
    characters or non-spacing marks in the middle of a string, as the
    glyph shaping and positioning of marks that happens when
    processing strings cannot be taken into account. When implementing
    an interactive text control, use QTextLayout instead.

Stephan

Reply via email to