]> git.lyx.org Git - lyx.git/commitdiff
Fix handling of codepoints 9, 10, 12, 13
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 20 Nov 2022 19:48:35 +0000 (20:48 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 20 Nov 2022 19:53:55 +0000 (20:53 +0100)
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
lib/symbols
src/frontends/qt/GuiFontLoader.cpp

index d36c4ea736402fd8eb77fe91530a82b55ba48d1a..07cca2beeba5c5dec3fb0335b0b245bed74dd7e6 100644 (file)
@@ -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
 
index 8086d51306a8ac90b66cd520371851d4d29175b7..7fade7ed2d0b8b2ab001afb19711418f6bbd3e0a 100644 (file)
@@ -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
index d980dacb55ad52cd937b57efbf9c3bd25454637e..ea3f1965f2576876f067ba4e9a428c2a4e76a6b4 100644 (file)
@@ -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;
 }