commit 7d196fea77e8412ff2c21ec0d818aabd1646db3e
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Sun Nov 20 20:48:35 2022 +0100

    Fix handling of codepoints 9, 10, 12, 13
    
    Qt >= 5 refuses to display them. We work around this in lib/symbols
    already, but make sure we do not try to display math glyphs at these
    code points anyway.
    
    Fixes bug #8493.
---
 TODO.killqt4                       |    1 -
 lib/symbols                        |    8 +++-----
 src/frontends/qt/GuiFontLoader.cpp |    9 +++++----
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/TODO.killqt4 b/TODO.killqt4
index d36c4ea..07cca2b 100644
--- a/TODO.killqt4
+++ b/TODO.killqt4
@@ -8,5 +8,4 @@ Things left to do after killing Qt4 (obtained by grepping for 
Qt4 and 'Qt 4'):
 * update or remove development/lyx.rpm.README
 * update or remove development/lyxserver/server_monitor.cpp
 * update or remove development/tools/count_total_lines_of_compiled_code.sh
-* check references to qt4 in lib/symbols
 
diff --git a/lib/symbols b/lib/symbols
index 8086d51..7fade7e 100644
--- a/lib/symbols
+++ b/lib/symbols
@@ -871,15 +871,13 @@ Ydown              stmry   5   0 mathbin    x  x  stmaryrd
 Yleft              stmry   6   0 mathbin    x  x  stmaryrd
 Yright             stmry   7   0 mathbin    x  x  stmaryrd
 varcurlyvee        stmry   8   0 mathbin    x  x  stmaryrd
-# qt4 does not display characters at the \t position (0x09)
-# therefore our .ttf font contains a copy at 170 (0xaa)
-#varcurlywedge      stmry   9   0 mathbin    x  x  stmaryrd
-#10,12,13 codepoints broken in qt5
+# qt does not display characters at codepoints 9, 10,12,13
+# therefore our copies of the TeX fonts have duplicate glyphs after 170
 varcurlywedge      stmry 170   0 mathbin    x  x  stmaryrd
 minuso             stmry 171   0 mathbin    x  x  stmaryrd
 baro               stmry  11   0 mathbin    x  x  stmaryrd
 sslash             stmry 172   0 mathbin    x  x  stmaryrd
-#for whatever reason qt5 refuses to display anything at position 173
+#for whatever reason qt refuses to display anything at position 173
 bbslash            stmry 174   0 mathbin    x  x  stmaryrd
 moo                stmry  14   0 mathbin    x  x  stmaryrd
 varotimes          stmry  15   0 mathbin    x  x  stmaryrd
diff --git a/src/frontends/qt/GuiFontLoader.cpp 
b/src/frontends/qt/GuiFontLoader.cpp
index d980dac..ea3f196 100644
--- a/src/frontends/qt/GuiFontLoader.cpp
+++ b/src/frontends/qt/GuiFontLoader.cpp
@@ -386,10 +386,11 @@ bool FontLoader::available(FontInfo const & f)
 
 bool FontLoader::canBeDisplayed(char_type c)
 {
-       // bug 8493
-       if (c == 0x0009)
-               // FIXME KILLQT4: get rid of this function if not needed anymore
-               // FIXME check whether this is still needed for Qt5
+       // bug 8493: with Qt5, characters with codepoints 9, 10, 12 and 13
+       // are rendered as spaces. We handle that in our TeX fonts by making
+       // copies of the glyphs elsewhere, but this may trigger if we are
+       // unlucky.
+       if (c == 0x0009 || c == 0x000a || c == 0x000c || c == 0x000d)
                return false;
        return true;
 }
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to