]> git.lyx.org Git - features.git/commitdiff
Fix bug #7954 (now really)
authorGeorg Baum <baum@lyx.org>
Fri, 14 Nov 2014 18:09:34 +0000 (19:09 +0100)
committerGeorg Baum <baum@lyx.org>
Fri, 14 Nov 2014 18:09:34 +0000 (19:09 +0100)
Thanks to maciejr we know now what the remaining problem was with bug 7954:
My unicode symbol fallback works fine, the problem was that a font named
"Symbol" is available on OS X, but it does not use the font-specific encoding
we expect: Almost all glyphs are at their unicode code point.
Therefore the bug is fixed by re-enabling the unicode workaround and blocking
the Symbol font on OS X.

lib/symbols
src/frontends/qt4/GuiFontLoader.cpp
src/mathed/MathFactory.cpp
src/mathed/MathSupport.cpp
status.21x

index 9f33433cdd3c7b2d0d433328f2f9b36b3a3399a1..2b5aea2febda97964281a37cbf2358a8d72ff531 100644 (file)
@@ -1173,6 +1173,8 @@ lyxsurd               cmsy        112 0 mathord  &radic;
 \def\surd{^\lyxsurd}
 \def\textdegree{\kern-1mu^{\circ}\kern-4mu}
 else
+# FIXME: These don't work on OS X, since the Symbol font uses a different
+#        encoding and is therefore disabled in FontLoader::available().
 cong               lyxsymbol             64  0 mathrel  &cong;
 surd               lyxsymbol             214 0 mathord  &radic;
 textdegree         lyxsymbol             176 0 mathord  &deg;
index 8081cd6dca7618573038f885a7949cb3cd6c8f6f..1a887ff07ab5b90c7ff0c6f6a80ac1c64b3234c9 100644 (file)
@@ -349,6 +349,16 @@ bool FontLoader::available(FontInfo const & f)
        static vector<int> cache(NUM_FAMILIES, false);
 
        FontFamily family = f.family();
+#ifdef Q_WS_MACX
+       // Apple ships a font name "Symbol", which has more or less the same
+       // glyphs as the original PostScript Symbol font, but it uses a different
+       // encoding (see https://en.wikipedia.org/wiki/Symbol_(typeface)#cite_note-2).
+       // Since we expect the font specific encoding of the original
+       // PostScript Symbol font, we can't use the one provided on OS X.
+       // See also the discussion in bug 7954.
+       if (f.family() == SYMBOL_FAMILY)
+               return false;
+#endif
        if (cache_set[family])
                return cache[family];
        cache_set[family] = true;
index d19899866fb25c7c8509107024a48ed168ef1704..961e70e9f459250191b717d16e5d228d006c76b1 100644 (file)
@@ -118,10 +118,8 @@ bool canBeDisplayed(char_type c)
 }
 
 
-bool isUnicodeSymbolAvailable(docstring const & /*name*/, char_type & /*c*/)
+bool isUnicodeSymbolAvailable(docstring const & name, char_type & c)
 {
-       // this is too fragile, e.g. prodes W instead of capital omega on OS X
-#if 0
        docstring cmd(from_ascii("\\") + name);
        bool is_combining;
        bool termination;
@@ -135,9 +133,6 @@ bool isUnicodeSymbolAvailable(docstring const & /*name*/, char_type & /*c*/)
                                                is_combining, termination);
        }
        return c != 0 && !is_combining;
-#else
-       return false;
-#endif
 }
 
 
index 21d41dd64e9ab6a4e4f4c090a95fd8a6501fdd49..1915e2b44c621fb4a24083d0dfc499490d88e588 100644 (file)
@@ -634,6 +634,9 @@ fontinfo fontinfos[] = {
        // LyX internal usage
        {"lyxtex",        inh_family, inh_series,
                          UP_SHAPE, Color_latex},
+       // FIXME: The following two don't work on OS X, since the Symbol font
+       //        uses a different encoding, and is therefore disabled in
+       //        FontLoader::available().
        {"lyxsymbol",     SYMBOL_FAMILY, inh_series,
                          inh_shape, Color_math},
        {"lyxboldsymbol", SYMBOL_FAMILY, BOLD_SERIES,
index e079e31b34f5fe97e8b33d8f6329a536a543fc35..ff2d217e7e06ecc322973dd8582f15b17029e492 100644 (file)
@@ -111,6 +111,8 @@ What's new
 
 - Fix computer algebra system computations in formulas with '=' signs.
 
+- Fix rendering of \varOmega on OS X (bug 7954).
+
 
 * INTERNALS