]> git.lyx.org Git - features.git/commitdiff
Work around bug #6920. This disables ligatures with involving 'f'
authorAbdelrazak Younes <younes@lyx.org>
Mon, 22 Nov 2010 08:57:33 +0000 (08:57 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Mon, 22 Nov 2010 08:57:33 +0000 (08:57 +0000)
character.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36430 a592a061-630c-0410-9148-cb99ea01b6c8

src/rowpainter.cpp

index d92b6d84d3afbf2a6e90fd8080e83ff20af7bcbf..e1367a046d0a3b08006e95b1b7343bb6aa51fc96 100644 (file)
@@ -268,6 +268,17 @@ void RowPainter::paintChars(pos_type & vpos, FontInfo const & font,
                if (!isPrintableNonspace(c))
                        break;
 
+               // Work-around bug #6920
+               // The bug can be reproduced with DejaVu font under Linux.
+               // The issue is that we compute the metrics character by character
+               // in ParagraphMetrics::singleWidth(); but we paint word by word
+               // for performance reason.
+               // Maybe a more general fix would be draw character by character
+               // for some predefined fonts on some patform. In arabic and
+               // Hebrew we already do paint this way.
+               if (prev_char == 'f')
+                       break;
+
                /* Because we do our own bidi, at this point the strings are
                 * already in visual order. However, Qt also applies its own
                 * bidi algorithm to strings that it paints to the screen.