Benjamin Piwowarski wrote:

> On the LyX-qt4/OSX build (OS X 10.9),
> 
> - maths symbols with codes 0x0009 and 0x00ad are not displayed.
> - The first line is a­ b

Thanks, so we do not need to care for 169.

> One question: why not switching to Stix for the symbols that cause a
> problem and in 2.2 switch all the other symbols? Even if this not look
> perfect, at least it is a workaround going in the right direction.

The problem is that this is not so easy: Our math font machinery does not 
contain these fonts, and adding new fonts in such a way that they are found 
by Qt has always been difficult in the past. I tried it, and although I have 
them installed systemwide, I cannot use them (LyX crashes somewhere in qt).

However, you got me thinking, and a rather ugly (but working) hack is 
attached: we can simply let qt choose a font that has the correct glyph. 
This won't look consistent on screen, but it is almost no code, and does not 
affect platforms which do not have the bug, and users can even disable the 
ugly bug fix without recompiling if they want.

What is better? This hack or the one which requires modifying the fonts? I 
think we have to fix this problem to avoid a regression on OS X.


Georg
diff --git a/lib/symbols b/lib/symbols
index 9f33433..672c6d8 100644
--- a/lib/symbols
+++ b/lib/symbols
@@ -261,7 +261,11 @@ Sigma              cmr         167  83 mathalpha  Σ
 Upsilon            cmr         168 161 mathalpha  ϒ
 Phi                cmr         169  70 mathalpha  Φ
 Psi                cmr         170  89 mathalpha  Ψ
+ifbug7954
+Omega              mathrm     2617  87 mathalpha  Ω
+else
 Omega              cmr         173  87 mathalpha  Ω
+endif
 aleph              cmsy         64 192 mathord  ℵ
 imath              cmm         123   0 mathord  ı
 jmath              cmm         124   0 mathord  ȷ
diff --git a/src/mathed/MathFactory.cpp b/src/mathed/MathFactory.cpp
index 151771d..2779619 100644
--- a/src/mathed/MathFactory.cpp
+++ b/src/mathed/MathFactory.cpp
@@ -137,6 +137,13 @@ void initSymbols()
 			docstring t = from_utf8(tmp);
 			skip = !isMathFontAvailable(t);
 			continue;
+		} else if (line.size() >= 9 && line.substr(0, 9) == "ifbug7954") {
+#ifdef USE_MACOSX_PACKAGING
+			skip = false;
+#else
+			skip = true;
+#endif
+			continue;
 		} else if (line.size() >= 4 && line.substr(0, 4) == "else") {
 			skip = !skip;
 			continue;

Reply via email to