Fix handling of \mathfrak font.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3207 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Dekel Tsur 2001-12-13 22:06:13 +00:00
parent 3677e0f57b
commit 1e7b5e1d99
2 changed files with 51 additions and 24 deletions

View File

@ -1,3 +1,7 @@
2001-12-14 Dekel Tsur <dekelts@tau.ac.il>
* math_support.C: Fix handling of \mathfrak font.
2001-12-10 Lars Gullik Bjønnes <larsbj@birdstep.com>
* math_iterator.C (nextInset): compilation fix.

View File

@ -67,8 +67,6 @@ enum MathFont {
FONT_SYMBOL,
FONT_SYMBOLI,
FONT_BF,
FONT_BB,
FONT_CAL,
FONT_TT,
FONT_RM,
FONT_SF,
@ -79,6 +77,9 @@ enum MathFont {
FONT_MSA,
FONT_MSB,
FONT_EUFRAK,
FONT_FAKEBB,
FONT_FAKECAL,
FONT_FAKEFRAK,
FONT_NUM
};
@ -100,16 +101,8 @@ void mathed_init_fonts()
MathFonts[FONT_BF].setSeries(LyXFont::BOLD_SERIES);
MathFonts[FONT_BB].setSeries(LyXFont::BOLD_SERIES);
MathFonts[FONT_BB].setFamily(LyXFont::TYPEWRITER_FAMILY);
MathFonts[FONT_CAL].setFamily(LyXFont::SANS_FAMILY);
MathFonts[FONT_CAL].setShape(LyXFont::ITALIC_SHAPE);
MathFonts[FONT_TT].setFamily(LyXFont::TYPEWRITER_FAMILY);
MathFonts[FONT_RM].setFamily(LyXFont::ROMAN_FAMILY);
MathFonts[FONT_SF].setFamily(LyXFont::SANS_FAMILY);
MathFonts[FONT_CMR].setFamily(LyXFont::CMR_FAMILY);
@ -120,12 +113,21 @@ void mathed_init_fonts()
MathFonts[FONT_MSB].setFamily(LyXFont::MSB_FAMILY);
MathFonts[FONT_EUFRAK].setFamily(LyXFont::EUFRAK_FAMILY);
MathFonts[FONT_FAKEBB].setFamily(LyXFont::TYPEWRITER_FAMILY);
MathFonts[FONT_FAKEBB].setSeries(LyXFont::BOLD_SERIES);
MathFonts[FONT_FAKECAL].setFamily(LyXFont::SANS_FAMILY);
MathFonts[FONT_FAKECAL].setShape(LyXFont::ITALIC_SHAPE);
MathFonts[FONT_FAKEFRAK].setFamily(LyXFont::SANS_FAMILY);
MathFonts[FONT_FAKEFRAK].setSeries(LyXFont::BOLD_SERIES);
for (int i = 0; i < LM_FONT_END; ++i)
font_available_initialized[i] = false;
}
LyXFont const & whichFontBase(MathTextCodes type)
LyXFont const & whichFontBaseIntern(MathTextCodes type)
{
if (!MathFonts)
mathed_init_fonts();
@ -143,16 +145,10 @@ LyXFont const & whichFontBase(MathTextCodes type)
return MathFonts[FONT_BF];
case LM_TC_BB:
if (math_font_available(LM_TC_MSB))
return MathFonts[FONT_MSB];
else
return MathFonts[FONT_BB];
return MathFonts[FONT_MSB];
case LM_TC_CAL:
if (math_font_available(LM_TC_CMSY))
return MathFonts[FONT_CMSY];
else
return MathFonts[FONT_CAL];
return MathFonts[FONT_CMSY];
case LM_TC_TT:
return MathFonts[FONT_TT];
@ -185,10 +181,7 @@ LyXFont const & whichFontBase(MathTextCodes type)
return MathFonts[FONT_MSB];
case LM_TC_EUFRAK:
if (math_font_available(LM_TC_EUFRAK))
return MathFonts[FONT_EUFRAK];
else
return MathFonts[FONT_BB];
return MathFonts[FONT_EUFRAK];
default:
break;
@ -196,6 +189,36 @@ LyXFont const & whichFontBase(MathTextCodes type)
return MathFonts[1];
}
LyXFont const & whichFontBase(MathTextCodes type)
{
if (!MathFonts)
mathed_init_fonts();
switch (type) {
case LM_TC_BB:
if (math_font_available(LM_TC_MSB))
return MathFonts[FONT_MSB];
else
return MathFonts[FONT_FAKEBB];
case LM_TC_CAL:
if (math_font_available(LM_TC_CMSY))
return MathFonts[FONT_CMSY];
else
return MathFonts[FONT_FAKECAL];
case LM_TC_EUFRAK:
if (math_font_available(LM_TC_EUFRAK))
return MathFonts[FONT_EUFRAK];
else
return MathFonts[FONT_FAKEFRAK];
default:
break;
}
return whichFontBaseIntern(type);
}
LyXFont whichFont(MathTextCodes type, MathMetricsInfo const & size)
{
@ -246,7 +269,7 @@ bool math_font_available(MathTextCodes type)
{
if (!font_available_initialized[type]) {
font_available_initialized[type] = true;
font_available[type] = fontloader.available(whichFontBase(type));
font_available[type] = fontloader.available(whichFontBaseIntern(type));
}
return font_available[type];
}