fix display "'" vs "\ni"

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2534 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2001-08-17 15:47:02 +00:00
parent 71d514f39e
commit f149653927
4 changed files with 15 additions and 11 deletions

View File

@ -16,21 +16,22 @@
MathCharInset::MathCharInset(char c)
: char_(c), code_(nativeCode(c))
{
if (isalpha(c))
code_ = LM_TC_VAR;
//lyxerr << "creating char '" << char_ << "' with code " << int(code_) << endl;
}
MathCharInset::MathCharInset(char c, MathTextCodes t)
: char_(c), code_((t == LM_TC_MIN) ? nativeCode(c) : t)
{}
{
//lyxerr << "creating char '" << char_ << "' with code " << int(code_) << endl;
}
MathTextCodes MathCharInset::nativeCode(char c) const
{
if (isalpha(c))
return LM_TC_VAR;
return LM_TC_MIN;
return LM_TC_CONST;
}
@ -68,6 +69,7 @@ void MathCharInset::draw(Painter & pain, int x, int y) const
{
xo(x);
yo(y);
//lyxerr << "drawing '" << char_ << "' code: " << code_ << endl;
drawChar(pain, code_, size_, x, y, char_);
}

View File

@ -58,6 +58,8 @@ enum MathTextCodes {
/// Internal code for variables
LM_TC_VAR,
///
LM_TC_CONST,
///
LM_TC_RM,
///
LM_TC_CAL,

View File

@ -118,9 +118,6 @@ inline CatCode catcode(unsigned char c)
}
const unsigned char LM_TK_OPEN = '{';
const unsigned char LM_TK_CLOSE = '}';
enum {
FLAG_BRACE = 1 << 0, // an opening brace needed
FLAG_BRACE_LAST = 1 << 1, // last closing brace ends the parsing process
@ -440,10 +437,12 @@ void Parser::tokenize(string const & buffer)
}
}
//lyxerr << "\nTokens: ";
//for (unsigned i = 0; i < tokens_.size(); ++i)
// lyxerr << tokens_[i];
//lyxerr << "\n";
#if 0
lyxerr << "\nTokens: ";
for (unsigned i = 0; i < tokens_.size(); ++i)
lyxerr << tokens_[i];
lyxerr << "\n";
#endif
}

View File

@ -167,6 +167,7 @@ LyXFont WhichFont(MathTextCodes type, MathStyles size)
case LM_TC_SPECIAL: //f = Math_Fonts[0]; break;
case LM_TC_TEXTRM:
case LM_TC_CONST:
case LM_TC_TEX:
case LM_TC_RM:
f = Math_Fonts[6];