/// Math styles
enum MathStyle {
///
- FONT_STYLE_SCRIPTSCRIPT = 0,
+ LM_ST_SCRIPTSCRIPT = 0,
///
- FONT_STYLE_SCRIPT,
+ LM_ST_SCRIPT,
///
- FONT_STYLE_TEXT,
+ LM_ST_TEXT,
///
- FONT_STYLE_DISPLAY,
+ LM_ST_DISPLAY,
///
- FONT_STYLE_INHERIT,
+ LM_ST_INHERIT,
///
- FONT_STYLE_IGNORE,
+ LM_ST_IGNORE,
/// the text and display fonts are the same
- NUM_STYLE = FONT_STYLE_DISPLAY
+ NUM_STYLE = LM_ST_DISPLAY
};
MEDIUM_SERIES,
UP_SHAPE,
FONT_SIZE_NORMAL,
- FONT_STYLE_TEXT,
+ LM_ST_TEXT,
Color_none,
Color_background,
FONT_OFF,
INHERIT_SERIES,
INHERIT_SHAPE,
FONT_SIZE_INHERIT,
- FONT_STYLE_INHERIT,
+ LM_ST_INHERIT,
Color_inherit,
Color_inherit,
FONT_INHERIT,
IGNORE_SERIES,
IGNORE_SHAPE,
FONT_SIZE_IGNORE,
- FONT_STYLE_IGNORE,
+ LM_ST_IGNORE,
Color_ignore,
Color_ignore,
FONT_IGNORE,
// font packages. No attempt is made to implement the actual values from
// \DefineMathSizes.
switch (style()) {
- case FONT_STYLE_DISPLAY:
- case FONT_STYLE_TEXT:
- case FONT_STYLE_INHERIT:
- case FONT_STYLE_IGNORE:
+ case LM_ST_DISPLAY:
+ case LM_ST_TEXT:
+ case LM_ST_INHERIT:
+ case LM_ST_IGNORE:
break;
- case FONT_STYLE_SCRIPT:
+ case LM_ST_SCRIPT:
d *= .73;
break;
- case FONT_STYLE_SCRIPTSCRIPT:
+ case LM_ST_SCRIPTSCRIPT:
d *= .55;
break;
}
if (size_ == tmplt.size_)
size_ = FONT_SIZE_INHERIT;
if (style_ == tmplt.style_)
- style_ = FONT_STYLE_INHERIT;
+ style_ = LM_ST_INHERIT;
if (emph_ == tmplt.emph_)
emph_ = FONT_INHERIT;
if (underbar_ == tmplt.underbar_)
if (size_ == FONT_SIZE_INHERIT)
size_ = tmplt.size_;
- if (style_ == FONT_STYLE_INHERIT)
+ if (style_ == LM_ST_INHERIT)
style_ = tmplt.style_;
if (emph_ == FONT_INHERIT)
size_ = newfont.size_;
}
- if (newfont.style_ != FONT_STYLE_IGNORE) {
+ if (newfont.style_ != LM_ST_IGNORE) {
style_ = newfont.style_;
}
{
return (family_ != INHERIT_FAMILY && series_ != INHERIT_SERIES
&& shape_ != INHERIT_SHAPE && size_ != FONT_SIZE_INHERIT
- && style_ != FONT_STYLE_INHERIT
+ && style_ != LM_ST_INHERIT
&& emph_ != FONT_INHERIT && underbar_ != FONT_INHERIT
&& uuline_ != FONT_INHERIT && uwave_ != FONT_INHERIT
&& strikeout_ != FONT_INHERIT && xout_ != FONT_INHERIT
fi.setFamily(SYMBOL_FAMILY);
else
// Math style is only taken into account in the case of mu
- fi.setStyle(FONT_STYLE_TEXT);
+ fi.setStyle(LM_ST_TEXT);
return len.inPixels(textwidth, theFontMetrics(fi).em());
}
Changer MetricsBase::changeScript()
{
switch (font.style()) {
- case FONT_STYLE_DISPLAY:
- case FONT_STYLE_TEXT:
- return font.changeStyle(FONT_STYLE_SCRIPT);
- case FONT_STYLE_SCRIPT:
- case FONT_STYLE_SCRIPTSCRIPT:
- return font.changeStyle(FONT_STYLE_SCRIPTSCRIPT);
- case FONT_STYLE_INHERIT:
- case FONT_STYLE_IGNORE:
+ case LM_ST_DISPLAY:
+ case LM_ST_TEXT:
+ return font.changeStyle(LM_ST_SCRIPT);
+ case LM_ST_SCRIPT:
+ case LM_ST_SCRIPTSCRIPT:
+ return font.changeStyle(LM_ST_SCRIPTSCRIPT);
+ case LM_ST_INHERIT:
+ case LM_ST_IGNORE:
return Changer();
}
//remove Warning
Changer MetricsBase::changeFrac()
{
switch (font.style()) {
- case FONT_STYLE_DISPLAY:
- return font.changeStyle(FONT_STYLE_TEXT);
- case FONT_STYLE_TEXT:
- return font.changeStyle(FONT_STYLE_SCRIPT);
- case FONT_STYLE_SCRIPT:
- case FONT_STYLE_SCRIPTSCRIPT:
- return font.changeStyle(FONT_STYLE_SCRIPTSCRIPT);
- case FONT_STYLE_INHERIT:
- case FONT_STYLE_IGNORE:
+ case LM_ST_DISPLAY:
+ return font.changeStyle(LM_ST_TEXT);
+ case LM_ST_TEXT:
+ return font.changeStyle(LM_ST_SCRIPT);
+ case LM_ST_SCRIPT:
+ case LM_ST_SCRIPTSCRIPT:
+ return font.changeStyle(LM_ST_SCRIPTSCRIPT);
+ case LM_ST_INHERIT:
+ case LM_ST_IGNORE:
return Changer();
}
//remove Warning
Changer MetricsBase::changeArray()
{
- return (font.style() == FONT_STYLE_DISPLAY) ? font.changeStyle(FONT_STYLE_TEXT)
+ return (font.style() == LM_ST_DISPLAY) ? font.changeStyle(LM_ST_TEXT)
: Changer();
}
GuiFontInfo * & fontinfo_ptr(FontInfo const & f)
{
// The display font and the text font are the same
- size_t const style = (f.style() == FONT_STYLE_DISPLAY) ? FONT_STYLE_TEXT : f.style();
+ size_t const style = (f.style() == LM_ST_DISPLAY) ? LM_ST_TEXT : f.style();
return fontinfo_[f.family()][f.series()][f.realShape()][f.size()][style];
}
{
Changer dummy2 = mi.base.changeEnsureMath();
FontInfo & f = mi.base.font;
- Changer dummy = (f.style() == FONT_STYLE_DISPLAY) ? f.changeStyle(FONT_STYLE_TEXT)
+ Changer dummy = (f.style() == LM_ST_DISPLAY) ? f.changeStyle(LM_ST_TEXT)
: Changer();
InsetMathGrid::metrics(mi, dim);
}
{
Changer dummy2 = pi.base.changeEnsureMath();
FontInfo & f = pi.base.font;
- Changer dummy = (f.style() == FONT_STYLE_DISPLAY) ? f.changeStyle(FONT_STYLE_TEXT)
+ Changer dummy = (f.style() == LM_ST_DISPLAY) ? f.changeStyle(LM_ST_TEXT)
: Changer();
InsetMathGrid::draw(pi, x, y);
}
int const dy = axis_height(mi.base);
Changer dummy =
// \tfrac is always in text size
- (kind_ == TFRAC) ? mi.base.font.changeStyle(FONT_STYLE_SCRIPT) :
+ (kind_ == TFRAC) ? mi.base.font.changeStyle(LM_ST_SCRIPT) :
// \cfrac and \dfrac are always in display size
(kind_ == CFRAC
|| kind_ == CFRACLEFT
|| kind_ == CFRACRIGHT
- || kind_ == DFRAC) ? mi.base.font.changeStyle(FONT_STYLE_DISPLAY) :
+ || kind_ == DFRAC) ? mi.base.font.changeStyle(LM_ST_DISPLAY) :
// all others
mi.base.changeFrac();
Changer dummy2 = mi.base.changeEnsureMath();
int const dy = axis_height(pi.base);
Changer dummy =
// \tfrac is always in text size
- (kind_ == TFRAC) ? pi.base.font.changeStyle(FONT_STYLE_SCRIPT) :
+ (kind_ == TFRAC) ? pi.base.font.changeStyle(LM_ST_SCRIPT) :
// \cfrac and \dfrac are always in display size
(kind_ == CFRAC
|| kind_ == CFRACLEFT
|| kind_ == CFRACRIGHT
- || kind_ == DFRAC) ? pi.base.font.changeStyle(FONT_STYLE_DISPLAY) :
+ || kind_ == DFRAC) ? pi.base.font.changeStyle(LM_ST_DISPLAY) :
// all others
pi.base.changeFrac();
Dimension const dim1 = cell(1).dimension(*pi.base.bv);
Dimension dim0, dim1;
int const dy = axis_height(mi.base);
Changer dummy =
- (kind_ == DBINOM) ? mi.base.font.changeStyle(FONT_STYLE_DISPLAY) :
- (kind_ == TBINOM) ? mi.base.font.changeStyle(FONT_STYLE_SCRIPT) :
+ (kind_ == DBINOM) ? mi.base.font.changeStyle(LM_ST_DISPLAY) :
+ (kind_ == TBINOM) ? mi.base.font.changeStyle(LM_ST_SCRIPT) :
mi.base.changeFrac();
cell(0).metrics(mi, dim0);
cell(1).metrics(mi, dim1);
int m = x + dim.width() / 2;
{
Changer dummy =
- (kind_ == DBINOM) ? pi.base.font.changeStyle(FONT_STYLE_DISPLAY) :
- (kind_ == TBINOM) ? pi.base.font.changeStyle(FONT_STYLE_SCRIPT) :
+ (kind_ == DBINOM) ? pi.base.font.changeStyle(LM_ST_DISPLAY) :
+ (kind_ == TBINOM) ? pi.base.font.changeStyle(LM_ST_SCRIPT) :
pi.base.changeFrac();
// take dy both for the vertical alignment and for the spacing between
// cells
}
Changer dummy1 = mi.base.changeFontSet(standardFont());
- Changer dummy2 = mi.base.font.changeStyle(display() ? FONT_STYLE_DISPLAY
- : FONT_STYLE_TEXT);
+ Changer dummy2 = mi.base.font.changeStyle(display() ? LM_ST_DISPLAY
+ : LM_ST_TEXT);
// let the cells adjust themselves
InsetMathGrid::metrics(mi, dim);
Changer dummy0 = really_change_color ? pi.base.font.changeColor(color)
: Changer();
Changer dummy1 = pi.base.changeFontSet(standardFont());
- Changer dummy2 = pi.base.font.changeStyle(display() ? FONT_STYLE_DISPLAY
- : FONT_STYLE_TEXT);
+ Changer dummy2 = pi.base.font.changeStyle(display() ? LM_ST_DISPLAY
+ : LM_ST_TEXT);
int xmath = x;
BufferParams::MathNumber const math_number = buffer().params().getMathNumber();
void InsetMathMacroTemplate::metrics(MetricsInfo & mi, Dimension & dim) const
{
Changer dummy1 = mi.base.changeFontSet("mathnormal");
- Changer dummy2 = mi.base.font.changeStyle(FONT_STYLE_TEXT);
+ Changer dummy2 = mi.base.font.changeStyle(LM_ST_TEXT);
// valid macro?
MacroData const * macro = 0;
// FIXME: Calling Changer on the same object repeatedly is inefficient.
Changer dummy0 = pi.base.font.changeColor(Color_math);
Changer dummy1 = pi.base.changeFontSet("mathnormal");
- Changer dummy2 = pi.base.font.changeStyle(FONT_STYLE_TEXT);
+ Changer dummy2 = pi.base.font.changeStyle(LM_ST_TEXT);
Dimension const dim = dimension(*pi.base.bv);
Changer dummy = mi.base.changeEnsureMath();
Dimension dimr;
if (root) {
- Changer script = mi.base.font.changeStyle(FONT_STYLE_SCRIPTSCRIPT);
+ Changer script = mi.base.font.changeStyle(LM_ST_SCRIPTSCRIPT);
// make sure that the dim is high enough for any character
root->metrics(mi, dimr, false);
}
*/
int const t = mi.base.solidLineThickness();
int const x_height = mathed_font_x_height(mi.base.font);
- int const phi = (mi.base.font.style() == FONT_STYLE_DISPLAY) ? x_height : t;
+ int const phi = (mi.base.font.style() == LM_ST_DISPLAY) ? x_height : t;
// first part is the spacing, second part is the line width
// itself, and last one is the spacing above.
int const space_above = (t + phi / 4) + t + t;
int const wl = dim.width() - dimn.width();
// the "exponent"
if (root) {
- Changer script = pi.base.font.changeStyle(FONT_STYLE_SCRIPTSCRIPT);
+ Changer script = pi.base.font.changeStyle(LM_ST_SCRIPTSCRIPT);
Dimension const dimr = root->dimension(*pi.base.bv);
int const root_offset = wl - 3 * w / 8 - dimr.width();
root->draw(pi, x + root_offset, y + (d - a)/2);
}
// set scriptable_
scriptable_ = false;
- if (mi.base.font.style() == FONT_STYLE_DISPLAY)
+ if (mi.base.font.style() == LM_ST_DISPLAY)
if (sym_->inset == "cmex" || sym_->inset == "esint" ||
sym_->extra == "funclim" ||
(sym_->inset == "stmry" && sym_->extra == "mathop"))
// << "=" << spc_code << " @" << mb.style << endl;
if (spc_code < 0) {
switch (mb.font.style()) {
- case FONT_STYLE_DISPLAY:
- case FONT_STYLE_TEXT:
- case FONT_STYLE_IGNORE:
- case FONT_STYLE_INHERIT:
+ case LM_ST_DISPLAY:
+ case LM_ST_TEXT:
+ case LM_ST_IGNORE:
+ case LM_ST_INHERIT:
spc_code = abs(spc_code);
break;
- case FONT_STYLE_SCRIPT:
- case FONT_STYLE_SCRIPTSCRIPT:
+ case LM_ST_SCRIPT:
+ case LM_ST_SCRIPTSCRIPT:
spc_code = 0;
}
}