]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_charinset.C
preview as preview can...
[lyx.git] / src / mathed / math_charinset.C
index 2d6ea5e72636af30901b93be6e6f2aeda196772e..a212db15e7e356c3e8851de0fe1ecd7a73cf2b68 100644 (file)
@@ -39,7 +39,7 @@ namespace {
        bool slanted(char c)
        {
                //if (strchr("0123456789;:!|[]().,?+/-*<>=", c)
-               return isalpha(c);
+               return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z');
        }
 
 }
@@ -60,7 +60,7 @@ MathInset * MathCharInset::clone() const
 void MathCharInset::metrics(MathMetricsInfo & mi) const
 {
 #if 1
-       if (slanted(char_) && !mi.base.fontinset) {
+       if (slanted(char_) && mi.base.fontname == "mathnormal") {
                MathShapeChanger dummy(mi.base.font, LyXFont::ITALIC_SHAPE);
                mathed_char_dim(mi.base.font, char_, ascent_, descent_, width_);
        } else {
@@ -79,11 +79,11 @@ void MathCharInset::metrics(MathMetricsInfo & mi) const
 
 void MathCharInset::draw(MathPainterInfo & pi, int x, int y) const
 {
-       //lyxerr << "drawing '" << char_ << "' code: " << pi.code << endl;
+       //lyxerr << "drawing '" << char_ << "' font: " << pi.base.fontname << endl;
        if (isBinaryOp(char_))
                x += font_metrics::width(' ', pi.base.font);
 #if 1
-       if (slanted(char_) && !pi.base.fontinset) {
+       if (slanted(char_) && pi.base.fontname == "mathnormal") {
                MathShapeChanger dummy(pi.base.font, LyXFont::ITALIC_SHAPE);
                pi.draw(x, y, char_);
        } else {
@@ -122,6 +122,12 @@ void MathCharInset::normalize(NormalStream & os) const
 }
 
 
+void MathCharInset::octavize(OctaveStream & os) const
+{
+       os << char_;
+}
+
+
 bool MathCharInset::isRelOp() const
 {
        return char_ == '=' || char_ == '<' || char_ == '>';