I've a pending patch to "fix" the drawing issues with Qt4.7 we have when fonts 
support kerning.
Until we provide a proper solution - not likely in LyX 2.0.0 - I propose to 
paint every character separately.

Stephan

Index: src/LyXRC.h
===================================================================
--- src/LyXRC.h (Revision 37639)
+++ src/LyXRC.h (Arbeitskopie)
@@ -79,6 +79,7 @@
                RC_EXAMPLEPATH,
                RC_EXPORT_OVERWRITE,
                RC_FONT_ENCODING,
+               RC_FORCE_PAINT_SINGLE_CHAR,
                RC_FILEFORMAT,
                RC_FORWARD_SEARCH_DVI,
                RC_FORWARD_SEARCH_PDF,
@@ -527,6 +528,8 @@
        };
        ///
        ScrollWheelZoom scroll_wheel_zoom;
+       ///
+       bool force_paint_single_char;
 };
 
 
Index: src/LyXRC.cpp
===================================================================
--- src/LyXRC.cpp       (Revision 37639)
+++ src/LyXRC.cpp       (Arbeitskopie)
@@ -99,6 +99,7 @@
        { "\\example_path", LyXRC::RC_EXAMPLEPATH },
        { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
        { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
+       { "\\force_paint_single_char", LyXRC::RC_FORCE_PAINT_SINGLE_CHAR },
        { "\\format", LyXRC::RC_FILEFORMAT },
        { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
        { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
@@ -422,6 +423,9 @@
        if (!lexrc.isOK())
                return ReadError;
 
+       // default for current rowpainter capabilities
+       force_paint_single_char = true;
+
        // format prior to 2.0 and introduction of format tag
        unsigned int format = 0;
 
@@ -523,6 +527,10 @@
                        lexrc >> fontenc;
                        break;
 
+               case RC_FORCE_PAINT_SINGLE_CHAR:
+                       lexrc >> force_paint_single_char;
+                       break;
+                               
                case RC_PRINTER:
                        lexrc >> printer;
                        break;
@@ -2180,6 +2188,14 @@
                if (tag != RC_LAST)
                        break;
 
+       case RC_FORCE_PAINT_SINGLE_CHAR:
+               if (ignore_system_lyxrc ||
+                   force_paint_single_char != 
system_lyxrc.force_paint_single_char) {
+                       os << "\\force_paint_single_char \"" << 
force_paint_single_char << "\"\n";
+               }
+               if (tag != RC_LAST)
+                       break;
+
                os << "\n#\n"
                   << "# FILE SECTION ######################################\n"
                   << "#\n\n";
@@ -2880,6 +2896,7 @@
        case LyXRC::RC_ESC_CHARS:
        case LyXRC::RC_EXAMPLEPATH:
        case LyXRC::RC_FONT_ENCODING:
+       case LyXRC::RC_FORCE_PAINT_SINGLE_CHAR:
        case LyXRC::RC_FILEFORMAT:
        case LyXRC::RC_GROUP_LAYOUTS:
        case LyXRC::RC_HUNSPELLDIR_PATH:
@@ -3122,6 +3139,10 @@
                str = _("The font encoding used for the LaTeX2e fontenc 
package. T1 is highly recommended for non-English languages.");
                break;
 
+       case RC_FORCE_PAINT_SINGLE_CHAR:
+               str = _("Disable any kerning and ligatures for text drawing on 
screen.");
+               break;
+
        case RC_FILEFORMAT:
                break;
 
Index: src/rowpainter.cpp
===================================================================
--- src/rowpainter.cpp  (Revision 37639)
+++ src/rowpainter.cpp  (Arbeitskopie)
@@ -261,9 +261,9 @@
                // Maybe a more general fix would be draw character by character
                // for some predefined fonts on some platform. In arabic and
                // Hebrew we already do paint this way.
-               if (prev_char == 'f')
+               if (prev_char == 'f' || lyxrc.force_paint_single_char)
                        break;
-               
+
                pos = bidi_.vis2log(vpos);
                if (pos < font_span.first || pos > font_span.last)
                        break;
Index: src/frontends/qt4/GuiApplication.cpp
===================================================================
--- src/frontends/qt4/GuiApplication.cpp        (Revision 37639)
+++ src/frontends/qt4/GuiApplication.cpp        (Arbeitskopie)
@@ -1839,6 +1839,13 @@
        if (d->global_menubar_)
                d->global_menubar_->releaseKeyboard();
 
+#if QT_VERSION < 0x040700
+       // the option to disable kerning in rowpainter
+       // is needed only with Qt4.7.0 or better
+       lyxrc.force_paint_single_char = false;
+       system_lyxrc.force_paint_single_char = false;
+#endif
+
        // create new view
        int id = view_id;
        while (d->views_.find(id) != d->views_.end())

Reply via email to