Author: forenr
Date: Mon Jan 3 15:19:15 2011
New Revision: 37073
URL: http://www.lyx.org/trac/changeset/37073
Log:
Fix bug #4606 (\varPhi and similar characters not known by the LyX GUI)
Modified:
lyx-devel/branches/BRANCH_1_6_X/lib/symbols
lyx-devel/branches/BRANCH_1_6_X/src/mathed/InsetMathSymbol.cpp
lyx-devel/branches/BRANCH_1_6_X/status.16x
Modified: lyx-devel/branches/BRANCH_1_6_X/lib/symbols
==============================================================================
--- lyx-devel/branches/BRANCH_1_6_X/lib/symbols Mon Jan 3 15:12:53 2011
(r37072)
+++ lyx-devel/branches/BRANCH_1_6_X/lib/symbols Mon Jan 3 15:19:15 2011
(r37073)
@@ -679,6 +679,20 @@
#LEFTcircle {\hbox to 0pt{\wasyfamily\char71\hss}\hbox{\wasyfamily\char35}}
#RIGHTcircle{\hbox to 0pt{\wasyfamily\char72\hss}\hbox{\wasyfamily\char35}}
+# Defined by amsmath.sty
+
+varGamma cmm 161 0 mathord x amsmath
+varDelta cmm 162 0 mathord x amsmath
+varTheta cmm 163 0 mathord x amsmath
+varLambda cmm 164 0 mathord x amsmath
+varXi cmm 165 0 mathord x amsmath
+varPi cmm 166 0 mathord x amsmath
+varSigma cmm 167 0 mathord x amsmath
+varUpsilon cmm 168 0 mathord x amsmath
+varPhi cmm 169 0 mathord x amsmath
+varPsi cmm 170 0 mathord x amsmath
+varOmega cmm 173 0 mathord x amsmath
+
#
# wasy astronomy
#
Modified: lyx-devel/branches/BRANCH_1_6_X/src/mathed/InsetMathSymbol.cpp
==============================================================================
--- lyx-devel/branches/BRANCH_1_6_X/src/mathed/InsetMathSymbol.cpp Mon Jan
3 15:12:53 2011 (r37072)
+++ lyx-devel/branches/BRANCH_1_6_X/src/mathed/InsetMathSymbol.cpp Mon Jan
3 15:19:15 2011 (r37073)
@@ -60,8 +60,12 @@
// << "' drawn as: '" << sym_->draw
// << "'" << endl;
+ bool const italic_upcase_greek = sym_->inset == "cmr" &&
+ sym_->extra == "mathalpha" &&
+ mi.base.fontname == "mathit";
+ docstring const font = italic_upcase_greek ? from_ascii("cmm") :
sym_->inset;
int const em = mathed_char_width(mi.base.font, 'M');
- FontSetChanger dummy(mi.base, sym_->inset);
+ FontSetChanger dummy(mi.base, font);
mathed_string_dim(mi.base.font, sym_->draw, dim);
docstring::const_reverse_iterator rit = sym_->draw.rbegin();
kerning_ = mathed_char_kerning(mi.base.font, *rit);
@@ -91,13 +95,18 @@
// << "' in font: '" << sym_->inset
// << "' drawn as: '" << sym_->draw
// << "'" << endl;
+
+ bool const italic_upcase_greek = sym_->inset == "cmr" &&
+ sym_->extra == "mathalpha" &&
+ pi.base.fontname == "mathit";
+ docstring const font = italic_upcase_greek ? from_ascii("cmm") :
sym_->inset;
int const em = mathed_char_width(pi.base.font, 'M');
if (isRelOp())
x += static_cast<int>(0.25*em+0.5);
else
x += static_cast<int>(0.0833*em+0.5);
- FontSetChanger dummy(pi.base, sym_->inset.c_str());
+ FontSetChanger dummy(pi.base, font);
pi.draw(x, y - h_, sym_->draw);
}
Modified: lyx-devel/branches/BRANCH_1_6_X/status.16x
==============================================================================
--- lyx-devel/branches/BRANCH_1_6_X/status.16x Mon Jan 3 15:12:53 2011
(r37072)
+++ lyx-devel/branches/BRANCH_1_6_X/status.16x Mon Jan 3 15:19:15 2011
(r37073)
@@ -37,6 +37,9 @@
- Allow Ctrl+Arrow to move between table cells (bug 1839).
+- Add support for showing on screen italic uppercase Greek letters,
+ either inserted in a \mathit inset or through AMS macros (bug 4606).
+
* DOCUMENTATION AND LOCALIZATION