]> git.lyx.org Git - features.git/blobdiff - src/mathed/math_symbolinset.C
Few math fonts improvements (use cmr for uppercase greek, support for
[features.git] / src / mathed / math_symbolinset.C
index 9983df5dd6139c79ef4a55df1f33f196ca227ff5..cf39db7fc43d8f1034719ab7b2fdb154b4207b7f 100644 (file)
@@ -31,6 +31,8 @@ void MathSymbolInset::writeNormal(ostream & os) const
 MathTextCodes MathSymbolInset::code() const
 {
        switch(sym_->token) {
+       case LM_TK_CMR:
+               return LM_TC_CMR;
        case LM_TK_CMSY:
                return LM_TC_CMSY;
        case LM_TK_CMM:
@@ -46,6 +48,16 @@ MathTextCodes MathSymbolInset::code() const
        }
 }
 
+
+MathTextCodes MathSymbolInset::code2() const
+{
+       if (sym_->token == LM_TK_CMEX)
+               return LM_TC_BOLDSYMB;
+       else
+               return LM_TC_SYMB;
+}
+
+
 void MathSymbolInset::metrics(MathStyles st) const
 {
        size_ = st;
@@ -60,7 +72,7 @@ void MathSymbolInset::metrics(MathStyles st) const
                }
        } else if (sym_->id > 0 && sym_->id < 255 &&
                   math_font_available(LM_TC_SYMB)) {
-               mathed_char_dim(LM_TC_SYMB, size_, sym_->id,
+               mathed_char_dim(code2(), size_, sym_->id,
                                ascent_, descent_, width_);
        } else {
                mathed_string_dim(LM_TC_TEX, size_, sym_->name, ascent_, descent_, width_);
@@ -76,8 +88,8 @@ void MathSymbolInset::draw(Painter & pain, int x, int y) const
        if (sym_->latex_font_id > 0 && math_font_available(Code))
                drawChar(pain, Code, size_, x, y - h_, sym_->latex_font_id);
        else if (sym_->id > 0 && sym_->id < 255 &&
-                  math_font_available(LM_TC_SYMB))
-               drawChar(pain, LM_TC_SYMB, size_, x, y, sym_->id);
+                math_font_available(LM_TC_SYMB))
+               drawChar(pain, code2(), size_, x, y, sym_->id);
        else
                drawStr(pain, LM_TC_TEX, size_, x, y, sym_->name);
 }