mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Rename LM_ST_* to *_STYLE and FONT_SIZE_* to *_SIZE
This makes code more uniform. This is typically something that is done at end of cycle to limit backport issues later.
This commit is contained in:
parent
f12e796999
commit
2b1515a936
@ -361,7 +361,7 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
|
||||
count += 6;
|
||||
env = true; //We have opened a new environment
|
||||
}
|
||||
if (f.size() != FONT_SIZE_INHERIT) {
|
||||
if (f.size() != INHERIT_SIZE) {
|
||||
// If we didn't open an environment above, we open one here
|
||||
if (!env) {
|
||||
os << '{';
|
||||
@ -459,7 +459,7 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
|
||||
++count;
|
||||
env = true; // Size change need not bother about closing env.
|
||||
}
|
||||
if (f.size() != FONT_SIZE_INHERIT) {
|
||||
if (f.size() != INHERIT_SIZE) {
|
||||
// We only have to close if only size changed
|
||||
if (!env) {
|
||||
if (needPar && !closeLanguage) {
|
||||
|
@ -97,35 +97,35 @@ enum FontShape {
|
||||
///
|
||||
enum FontSize {
|
||||
///
|
||||
FONT_SIZE_TINY = 0,
|
||||
TINY_SIZE = 0,
|
||||
///
|
||||
FONT_SIZE_SCRIPT,
|
||||
SCRIPT_SIZE,
|
||||
///
|
||||
FONT_SIZE_FOOTNOTE,
|
||||
FOOTNOTE_SIZE,
|
||||
///
|
||||
FONT_SIZE_SMALL,
|
||||
SMALL_SIZE,
|
||||
///
|
||||
FONT_SIZE_NORMAL,
|
||||
NORMAL_SIZE,
|
||||
///
|
||||
FONT_SIZE_LARGE,
|
||||
LARGE_SIZE,
|
||||
///
|
||||
FONT_SIZE_LARGER,
|
||||
LARGER_SIZE,
|
||||
///
|
||||
FONT_SIZE_LARGEST,
|
||||
LARGEST_SIZE,
|
||||
///
|
||||
FONT_SIZE_HUGE,
|
||||
HUGE_SIZE,
|
||||
///
|
||||
FONT_SIZE_HUGER,
|
||||
HUGER_SIZE,
|
||||
///
|
||||
FONT_SIZE_INCREASE,
|
||||
INCREASE_SIZE,
|
||||
///
|
||||
FONT_SIZE_DECREASE,
|
||||
DECREASE_SIZE,
|
||||
///
|
||||
FONT_SIZE_INHERIT,
|
||||
INHERIT_SIZE,
|
||||
///
|
||||
FONT_SIZE_IGNORE,
|
||||
IGNORE_SIZE,
|
||||
///
|
||||
NUM_SIZE = FONT_SIZE_INCREASE
|
||||
NUM_SIZE = INCREASE_SIZE
|
||||
};
|
||||
|
||||
/// Used for emph, underbar, noun and latex toggles
|
||||
@ -146,19 +146,19 @@ enum FontState {
|
||||
/// Math styles
|
||||
enum MathStyle {
|
||||
///
|
||||
LM_ST_SCRIPTSCRIPT = 0,
|
||||
SCRIPTSCRIPT_STYLE = 0,
|
||||
///
|
||||
LM_ST_SCRIPT,
|
||||
SCRIPT_STYLE,
|
||||
///
|
||||
LM_ST_TEXT,
|
||||
TEXT_STYLE,
|
||||
///
|
||||
LM_ST_DISPLAY,
|
||||
DISPLAY_STYLE,
|
||||
///
|
||||
LM_ST_INHERIT,
|
||||
INHERIT_STYLE,
|
||||
///
|
||||
LM_ST_IGNORE,
|
||||
IGNORE_STYLE,
|
||||
/// the text and display fonts are the same
|
||||
NUM_STYLE = LM_ST_DISPLAY
|
||||
NUM_STYLE = DISPLAY_STYLE
|
||||
};
|
||||
|
||||
|
||||
|
150
src/FontInfo.cpp
150
src/FontInfo.cpp
@ -87,8 +87,8 @@ FontInfo const sane_font(
|
||||
ROMAN_FAMILY,
|
||||
MEDIUM_SERIES,
|
||||
UP_SHAPE,
|
||||
FONT_SIZE_NORMAL,
|
||||
LM_ST_TEXT,
|
||||
NORMAL_SIZE,
|
||||
TEXT_STYLE,
|
||||
Color_none,
|
||||
Color_background,
|
||||
FONT_OFF,
|
||||
@ -105,8 +105,8 @@ FontInfo const inherit_font(
|
||||
INHERIT_FAMILY,
|
||||
INHERIT_SERIES,
|
||||
INHERIT_SHAPE,
|
||||
FONT_SIZE_INHERIT,
|
||||
LM_ST_INHERIT,
|
||||
INHERIT_SIZE,
|
||||
INHERIT_STYLE,
|
||||
Color_inherit,
|
||||
Color_inherit,
|
||||
FONT_INHERIT,
|
||||
@ -123,8 +123,8 @@ FontInfo const ignore_font(
|
||||
IGNORE_FAMILY,
|
||||
IGNORE_SERIES,
|
||||
IGNORE_SHAPE,
|
||||
FONT_SIZE_IGNORE,
|
||||
LM_ST_IGNORE,
|
||||
IGNORE_SIZE,
|
||||
IGNORE_STYLE,
|
||||
Color_ignore,
|
||||
Color_ignore,
|
||||
FONT_IGNORE,
|
||||
@ -148,27 +148,27 @@ FontInfo::FontInfo()
|
||||
FontInfo & FontInfo::decSize()
|
||||
{
|
||||
switch (size_) {
|
||||
case FONT_SIZE_HUGER: size_ = FONT_SIZE_HUGE; break;
|
||||
case FONT_SIZE_HUGE: size_ = FONT_SIZE_LARGEST; break;
|
||||
case FONT_SIZE_LARGEST: size_ = FONT_SIZE_LARGER; break;
|
||||
case FONT_SIZE_LARGER: size_ = FONT_SIZE_LARGE; break;
|
||||
case FONT_SIZE_LARGE: size_ = FONT_SIZE_NORMAL; break;
|
||||
case FONT_SIZE_NORMAL: size_ = FONT_SIZE_SMALL; break;
|
||||
case FONT_SIZE_SMALL: size_ = FONT_SIZE_FOOTNOTE; break;
|
||||
case FONT_SIZE_FOOTNOTE: size_ = FONT_SIZE_SCRIPT; break;
|
||||
case FONT_SIZE_SCRIPT: size_ = FONT_SIZE_TINY; break;
|
||||
case FONT_SIZE_TINY: break;
|
||||
case FONT_SIZE_INCREASE:
|
||||
LYXERR0("Can't FontInfo::decSize on FONT_SIZE_INCREASE");
|
||||
case HUGER_SIZE: size_ = HUGE_SIZE; break;
|
||||
case HUGE_SIZE: size_ = LARGEST_SIZE; break;
|
||||
case LARGEST_SIZE: size_ = LARGER_SIZE; break;
|
||||
case LARGER_SIZE: size_ = LARGE_SIZE; break;
|
||||
case LARGE_SIZE: size_ = NORMAL_SIZE; break;
|
||||
case NORMAL_SIZE: size_ = SMALL_SIZE; break;
|
||||
case SMALL_SIZE: size_ = FOOTNOTE_SIZE; break;
|
||||
case FOOTNOTE_SIZE: size_ = SCRIPT_SIZE; break;
|
||||
case SCRIPT_SIZE: size_ = TINY_SIZE; break;
|
||||
case TINY_SIZE: break;
|
||||
case INCREASE_SIZE:
|
||||
LYXERR0("Can't FontInfo::decSize on INCREASE_SIZE");
|
||||
break;
|
||||
case FONT_SIZE_DECREASE:
|
||||
LYXERR0("Can't FontInfo::decSize on FONT_SIZE_DECREASE");
|
||||
case DECREASE_SIZE:
|
||||
LYXERR0("Can't FontInfo::decSize on DECREASE_SIZE");
|
||||
break;
|
||||
case FONT_SIZE_INHERIT:
|
||||
LYXERR0("Can't FontInfo::decSize on FONT_SIZE_INHERIT");
|
||||
case INHERIT_SIZE:
|
||||
LYXERR0("Can't FontInfo::decSize on INHERIT_SIZE");
|
||||
break;
|
||||
case FONT_SIZE_IGNORE:
|
||||
LYXERR0("Can't FontInfo::decSize on FONT_SIZE_IGNORE");
|
||||
case IGNORE_SIZE:
|
||||
LYXERR0("Can't FontInfo::decSize on IGNORE_SIZE");
|
||||
break;
|
||||
}
|
||||
return *this;
|
||||
@ -179,27 +179,27 @@ FontInfo & FontInfo::decSize()
|
||||
FontInfo & FontInfo::incSize()
|
||||
{
|
||||
switch (size_) {
|
||||
case FONT_SIZE_HUGER: break;
|
||||
case FONT_SIZE_HUGE: size_ = FONT_SIZE_HUGER; break;
|
||||
case FONT_SIZE_LARGEST: size_ = FONT_SIZE_HUGE; break;
|
||||
case FONT_SIZE_LARGER: size_ = FONT_SIZE_LARGEST; break;
|
||||
case FONT_SIZE_LARGE: size_ = FONT_SIZE_LARGER; break;
|
||||
case FONT_SIZE_NORMAL: size_ = FONT_SIZE_LARGE; break;
|
||||
case FONT_SIZE_SMALL: size_ = FONT_SIZE_NORMAL; break;
|
||||
case FONT_SIZE_FOOTNOTE: size_ = FONT_SIZE_SMALL; break;
|
||||
case FONT_SIZE_SCRIPT: size_ = FONT_SIZE_FOOTNOTE; break;
|
||||
case FONT_SIZE_TINY: size_ = FONT_SIZE_SCRIPT; break;
|
||||
case FONT_SIZE_INCREASE:
|
||||
LYXERR0("Can't FontInfo::incSize on FONT_SIZE_INCREASE");
|
||||
case HUGER_SIZE: break;
|
||||
case HUGE_SIZE: size_ = HUGER_SIZE; break;
|
||||
case LARGEST_SIZE: size_ = HUGE_SIZE; break;
|
||||
case LARGER_SIZE: size_ = LARGEST_SIZE; break;
|
||||
case LARGE_SIZE: size_ = LARGER_SIZE; break;
|
||||
case NORMAL_SIZE: size_ = LARGE_SIZE; break;
|
||||
case SMALL_SIZE: size_ = NORMAL_SIZE; break;
|
||||
case FOOTNOTE_SIZE: size_ = SMALL_SIZE; break;
|
||||
case SCRIPT_SIZE: size_ = FOOTNOTE_SIZE; break;
|
||||
case TINY_SIZE: size_ = SCRIPT_SIZE; break;
|
||||
case INCREASE_SIZE:
|
||||
LYXERR0("Can't FontInfo::incSize on INCREASE_SIZE");
|
||||
break;
|
||||
case FONT_SIZE_DECREASE:
|
||||
LYXERR0("Can't FontInfo::incSize on FONT_SIZE_DECREASE");
|
||||
case DECREASE_SIZE:
|
||||
LYXERR0("Can't FontInfo::incSize on DECREASE_SIZE");
|
||||
break;
|
||||
case FONT_SIZE_INHERIT:
|
||||
LYXERR0("Can't FontInfo::incSize on FONT_SIZE_INHERIT");
|
||||
case INHERIT_SIZE:
|
||||
LYXERR0("Can't FontInfo::incSize on INHERIT_SIZE");
|
||||
break;
|
||||
case FONT_SIZE_IGNORE:
|
||||
LYXERR0("Can't FontInfo::incSize on FONT_SIZE_IGNORE");
|
||||
case IGNORE_SIZE:
|
||||
LYXERR0("Can't FontInfo::incSize on IGNORE_SIZE");
|
||||
break;
|
||||
}
|
||||
return *this;
|
||||
@ -214,20 +214,20 @@ double FontInfo::realSize() const
|
||||
// font packages. No attempt is made to implement the actual values from
|
||||
// \DefineMathSizes.
|
||||
switch (style()) {
|
||||
case LM_ST_DISPLAY:
|
||||
case LM_ST_TEXT:
|
||||
case LM_ST_INHERIT:
|
||||
case LM_ST_IGNORE:
|
||||
case DISPLAY_STYLE:
|
||||
case TEXT_STYLE:
|
||||
case INHERIT_STYLE:
|
||||
case IGNORE_STYLE:
|
||||
break;
|
||||
case LM_ST_SCRIPT:
|
||||
case SCRIPT_STYLE:
|
||||
d *= .73;
|
||||
break;
|
||||
case LM_ST_SCRIPTSCRIPT:
|
||||
case SCRIPTSCRIPT_STYLE:
|
||||
d *= .55;
|
||||
break;
|
||||
}
|
||||
// Never go below the smallest size
|
||||
return max(d, convert<double>(lyxrc.font_sizes[FONT_SIZE_TINY]));
|
||||
return max(d, convert<double>(lyxrc.font_sizes[TINY_SIZE]));
|
||||
}
|
||||
|
||||
|
||||
@ -241,9 +241,9 @@ void FontInfo::reduce(FontInfo const & tmplt)
|
||||
if (shape_ == tmplt.shape_)
|
||||
shape_ = INHERIT_SHAPE;
|
||||
if (size_ == tmplt.size_)
|
||||
size_ = FONT_SIZE_INHERIT;
|
||||
size_ = INHERIT_SIZE;
|
||||
if (style_ == tmplt.style_)
|
||||
style_ = LM_ST_INHERIT;
|
||||
style_ = INHERIT_STYLE;
|
||||
if (emph_ == tmplt.emph_)
|
||||
emph_ = FONT_INHERIT;
|
||||
if (underbar_ == tmplt.underbar_)
|
||||
@ -284,10 +284,10 @@ FontInfo & FontInfo::realize(FontInfo const & tmplt)
|
||||
if (shape_ == INHERIT_SHAPE)
|
||||
shape_ = tmplt.shape_;
|
||||
|
||||
if (size_ == FONT_SIZE_INHERIT)
|
||||
if (size_ == INHERIT_SIZE)
|
||||
size_ = tmplt.size_;
|
||||
|
||||
if (style_ == LM_ST_INHERIT)
|
||||
if (style_ == INHERIT_STYLE)
|
||||
style_ = tmplt.style_;
|
||||
|
||||
if (emph_ == FONT_INHERIT)
|
||||
@ -402,16 +402,16 @@ void FontInfo::update(FontInfo const & newfont, bool toggleall)
|
||||
shape_ = newfont.shape_;
|
||||
// else it's IGNORE_SHAPE
|
||||
|
||||
if (newfont.size_ != FONT_SIZE_IGNORE) {
|
||||
if (newfont.size_ == FONT_SIZE_INCREASE)
|
||||
if (newfont.size_ != IGNORE_SIZE) {
|
||||
if (newfont.size_ == INCREASE_SIZE)
|
||||
incSize();
|
||||
else if (newfont.size_ == FONT_SIZE_DECREASE)
|
||||
else if (newfont.size_ == DECREASE_SIZE)
|
||||
decSize();
|
||||
else
|
||||
size_ = newfont.size_;
|
||||
}
|
||||
|
||||
if (newfont.style_ != LM_ST_IGNORE) {
|
||||
if (newfont.style_ != IGNORE_STYLE) {
|
||||
style_ = newfont.style_;
|
||||
}
|
||||
|
||||
@ -440,8 +440,8 @@ void FontInfo::update(FontInfo const & newfont, bool toggleall)
|
||||
bool FontInfo::resolved() const
|
||||
{
|
||||
return (family_ != INHERIT_FAMILY && series_ != INHERIT_SERIES
|
||||
&& shape_ != INHERIT_SHAPE && size_ != FONT_SIZE_INHERIT
|
||||
&& style_ != LM_ST_INHERIT
|
||||
&& shape_ != INHERIT_SHAPE && size_ != INHERIT_SIZE
|
||||
&& style_ != INHERIT_STYLE
|
||||
&& emph_ != FONT_INHERIT && underbar_ != FONT_INHERIT
|
||||
&& uuline_ != FONT_INHERIT && uwave_ != FONT_INHERIT
|
||||
&& strikeout_ != FONT_INHERIT && xout_ != FONT_INHERIT
|
||||
@ -546,29 +546,29 @@ string getShapeCSS(FontShape const & s)
|
||||
string getSizeCSS(FontSize const & s)
|
||||
{
|
||||
switch (s) {
|
||||
case FONT_SIZE_TINY:
|
||||
case TINY_SIZE:
|
||||
return "xx-small";
|
||||
case FONT_SIZE_SCRIPT:
|
||||
case SCRIPT_SIZE:
|
||||
return "x-small";
|
||||
case FONT_SIZE_FOOTNOTE:
|
||||
case FONT_SIZE_SMALL:
|
||||
case FOOTNOTE_SIZE:
|
||||
case SMALL_SIZE:
|
||||
return "small";
|
||||
case FONT_SIZE_NORMAL:
|
||||
case NORMAL_SIZE:
|
||||
return "medium";
|
||||
case FONT_SIZE_LARGE:
|
||||
case LARGE_SIZE:
|
||||
return "large";
|
||||
case FONT_SIZE_LARGER:
|
||||
case FONT_SIZE_LARGEST:
|
||||
case LARGER_SIZE:
|
||||
case LARGEST_SIZE:
|
||||
return "x-large";
|
||||
case FONT_SIZE_HUGE:
|
||||
case FONT_SIZE_HUGER:
|
||||
case HUGE_SIZE:
|
||||
case HUGER_SIZE:
|
||||
return "xx-large";
|
||||
case FONT_SIZE_INCREASE:
|
||||
case INCREASE_SIZE:
|
||||
return "larger";
|
||||
case FONT_SIZE_DECREASE:
|
||||
case DECREASE_SIZE:
|
||||
return "smaller";
|
||||
case FONT_SIZE_IGNORE:
|
||||
case FONT_SIZE_INHERIT:
|
||||
case IGNORE_SIZE:
|
||||
case INHERIT_SIZE:
|
||||
break;
|
||||
}
|
||||
return "";
|
||||
@ -604,7 +604,7 @@ docstring const FontInfo::stateText(bool const terse) const
|
||||
os << _(GUISeriesNames[series()]) << ", ";
|
||||
if (shape() != INHERIT_SHAPE && (!terse || shape() != IGNORE_SHAPE))
|
||||
os << _(GUIShapeNames[shape()]) << ", ";
|
||||
if (size() != FONT_SIZE_INHERIT && (!terse || size() != FONT_SIZE_IGNORE))
|
||||
if (size() != INHERIT_SIZE && (!terse || size() != IGNORE_SIZE))
|
||||
os << _(GUISizeNames[size()]) << ", ";
|
||||
// FIXME: shall style be handled there? Probably not.
|
||||
if (color() != Color_inherit && (!terse || color() != Color_ignore))
|
||||
@ -819,7 +819,7 @@ void lyxWrite(ostream & os, FontInfo const & f, string const & start, int level)
|
||||
if (f.shape() != INHERIT_SHAPE)
|
||||
oss << indent << "\tShape " << LyXShapeNames[f.shape()]
|
||||
<< '\n';
|
||||
if (f.size() != FONT_SIZE_INHERIT)
|
||||
if (f.size() != INHERIT_SIZE)
|
||||
oss << indent << "\tSize " << LyXSizeNames[f.size()]
|
||||
<< '\n';
|
||||
//FIXME: shall style be handled here? Probably not.
|
||||
|
@ -477,16 +477,16 @@ LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
|
||||
break;
|
||||
|
||||
case RC_SCREEN_FONT_SIZES:
|
||||
lexrc >> font_sizes[FONT_SIZE_TINY];
|
||||
lexrc >> font_sizes[FONT_SIZE_SCRIPT];
|
||||
lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
|
||||
lexrc >> font_sizes[FONT_SIZE_SMALL];
|
||||
lexrc >> font_sizes[FONT_SIZE_NORMAL];
|
||||
lexrc >> font_sizes[FONT_SIZE_LARGE];
|
||||
lexrc >> font_sizes[FONT_SIZE_LARGER];
|
||||
lexrc >> font_sizes[FONT_SIZE_LARGEST];
|
||||
lexrc >> font_sizes[FONT_SIZE_HUGE];
|
||||
lexrc >> font_sizes[FONT_SIZE_HUGER];
|
||||
lexrc >> font_sizes[TINY_SIZE];
|
||||
lexrc >> font_sizes[SCRIPT_SIZE];
|
||||
lexrc >> font_sizes[FOOTNOTE_SIZE];
|
||||
lexrc >> font_sizes[SMALL_SIZE];
|
||||
lexrc >> font_sizes[NORMAL_SIZE];
|
||||
lexrc >> font_sizes[LARGE_SIZE];
|
||||
lexrc >> font_sizes[LARGER_SIZE];
|
||||
lexrc >> font_sizes[LARGEST_SIZE];
|
||||
lexrc >> font_sizes[HUGE_SIZE];
|
||||
lexrc >> font_sizes[HUGER_SIZE];
|
||||
break;
|
||||
|
||||
case RC_SCREEN_FONT_SCALABLE:
|
||||
@ -1721,40 +1721,40 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
|
||||
// fall through
|
||||
case RC_SCREEN_FONT_SIZES:
|
||||
if (ignore_system_lyxrc ||
|
||||
font_sizes[FONT_SIZE_TINY]
|
||||
!= system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
|
||||
font_sizes[FONT_SIZE_SCRIPT]
|
||||
!= system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
|
||||
font_sizes[FONT_SIZE_FOOTNOTE]
|
||||
!= system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
|
||||
font_sizes[FONT_SIZE_SMALL]
|
||||
!= system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
|
||||
font_sizes[FONT_SIZE_NORMAL]
|
||||
!= system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
|
||||
font_sizes[FONT_SIZE_LARGE]
|
||||
!= system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
|
||||
font_sizes[FONT_SIZE_LARGER]
|
||||
!= system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
|
||||
font_sizes[FONT_SIZE_LARGEST]
|
||||
!= system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
|
||||
font_sizes[FONT_SIZE_HUGE]
|
||||
!= system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
|
||||
font_sizes[FONT_SIZE_HUGER]
|
||||
!= system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
|
||||
font_sizes[TINY_SIZE]
|
||||
!= system_lyxrc.font_sizes[TINY_SIZE] ||
|
||||
font_sizes[SCRIPT_SIZE]
|
||||
!= system_lyxrc.font_sizes[SCRIPT_SIZE] ||
|
||||
font_sizes[FOOTNOTE_SIZE]
|
||||
!= system_lyxrc.font_sizes[FOOTNOTE_SIZE] ||
|
||||
font_sizes[SMALL_SIZE]
|
||||
!= system_lyxrc.font_sizes[SMALL_SIZE] ||
|
||||
font_sizes[NORMAL_SIZE]
|
||||
!= system_lyxrc.font_sizes[NORMAL_SIZE] ||
|
||||
font_sizes[LARGE_SIZE]
|
||||
!= system_lyxrc.font_sizes[LARGE_SIZE] ||
|
||||
font_sizes[LARGER_SIZE]
|
||||
!= system_lyxrc.font_sizes[LARGER_SIZE] ||
|
||||
font_sizes[LARGEST_SIZE]
|
||||
!= system_lyxrc.font_sizes[LARGEST_SIZE] ||
|
||||
font_sizes[HUGE_SIZE]
|
||||
!= system_lyxrc.font_sizes[HUGE_SIZE] ||
|
||||
font_sizes[HUGER_SIZE]
|
||||
!= system_lyxrc.font_sizes[HUGER_SIZE]) {
|
||||
streamsize old_prec = os.precision();
|
||||
os.setf(ios::fixed);
|
||||
os.precision(2);
|
||||
os << "\\screen_font_sizes"
|
||||
<< ' ' << font_sizes[FONT_SIZE_TINY]
|
||||
<< ' ' << font_sizes[FONT_SIZE_SCRIPT]
|
||||
<< ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
|
||||
<< ' ' << font_sizes[FONT_SIZE_SMALL]
|
||||
<< ' ' << font_sizes[FONT_SIZE_NORMAL]
|
||||
<< ' ' << font_sizes[FONT_SIZE_LARGE]
|
||||
<< ' ' << font_sizes[FONT_SIZE_LARGER]
|
||||
<< ' ' << font_sizes[FONT_SIZE_LARGEST]
|
||||
<< ' ' << font_sizes[FONT_SIZE_HUGE]
|
||||
<< ' ' << font_sizes[FONT_SIZE_HUGER]
|
||||
<< ' ' << font_sizes[TINY_SIZE]
|
||||
<< ' ' << font_sizes[SCRIPT_SIZE]
|
||||
<< ' ' << font_sizes[FOOTNOTE_SIZE]
|
||||
<< ' ' << font_sizes[SMALL_SIZE]
|
||||
<< ' ' << font_sizes[NORMAL_SIZE]
|
||||
<< ' ' << font_sizes[LARGE_SIZE]
|
||||
<< ' ' << font_sizes[LARGER_SIZE]
|
||||
<< ' ' << font_sizes[LARGEST_SIZE]
|
||||
<< ' ' << font_sizes[HUGE_SIZE]
|
||||
<< ' ' << font_sizes[HUGER_SIZE]
|
||||
<< '\n';
|
||||
os.precision(old_prec);
|
||||
os.unsetf(ios::fixed);
|
||||
|
@ -107,7 +107,7 @@ int MetricsBase::inPixels(Length const & len) const
|
||||
fi.setFamily(SYMBOL_FAMILY);
|
||||
else
|
||||
// Math style is only taken into account in the case of mu
|
||||
fi.setStyle(LM_ST_TEXT);
|
||||
fi.setStyle(TEXT_STYLE);
|
||||
return len.inPixels(textwidth, theFontMetrics(fi).em());
|
||||
}
|
||||
|
||||
@ -186,14 +186,14 @@ Color PainterInfo::textColor(Color const & color) const
|
||||
Changer MetricsBase::changeScript()
|
||||
{
|
||||
switch (font.style()) {
|
||||
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:
|
||||
case DISPLAY_STYLE:
|
||||
case TEXT_STYLE:
|
||||
return font.changeStyle(SCRIPT_STYLE);
|
||||
case SCRIPT_STYLE:
|
||||
case SCRIPTSCRIPT_STYLE:
|
||||
return font.changeStyle(SCRIPTSCRIPT_STYLE);
|
||||
case INHERIT_STYLE:
|
||||
case IGNORE_STYLE:
|
||||
return Changer();
|
||||
}
|
||||
//remove Warning
|
||||
@ -204,15 +204,15 @@ Changer MetricsBase::changeScript()
|
||||
Changer MetricsBase::changeFrac()
|
||||
{
|
||||
switch (font.style()) {
|
||||
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:
|
||||
case DISPLAY_STYLE:
|
||||
return font.changeStyle(TEXT_STYLE);
|
||||
case TEXT_STYLE:
|
||||
return font.changeStyle(SCRIPT_STYLE);
|
||||
case SCRIPT_STYLE:
|
||||
case SCRIPTSCRIPT_STYLE:
|
||||
return font.changeStyle(SCRIPTSCRIPT_STYLE);
|
||||
case INHERIT_STYLE:
|
||||
case IGNORE_STYLE:
|
||||
return Changer();
|
||||
}
|
||||
//remove Warning
|
||||
@ -222,7 +222,7 @@ Changer MetricsBase::changeFrac()
|
||||
|
||||
Changer MetricsBase::changeArray()
|
||||
{
|
||||
return (font.style() == LM_ST_DISPLAY) ? font.changeStyle(LM_ST_TEXT)
|
||||
return (font.style() == DISPLAY_STYLE) ? font.changeStyle(TEXT_STYLE)
|
||||
: Changer();
|
||||
}
|
||||
|
||||
|
@ -3020,7 +3020,7 @@ docstring Paragraph::simpleLyXHTMLOnePar(Buffer const & buf,
|
||||
|
||||
FontShape curr_fs = INHERIT_SHAPE;
|
||||
FontFamily curr_fam = INHERIT_FAMILY;
|
||||
FontSize curr_size = FONT_SIZE_INHERIT;
|
||||
FontSize curr_size = INHERIT_SIZE;
|
||||
|
||||
string const default_family =
|
||||
buf.masterBuffer()->params().fonts_default_family;
|
||||
@ -3185,41 +3185,41 @@ docstring Paragraph::simpleLyXHTMLOnePar(Buffer const & buf,
|
||||
if (old_size != curr_size) {
|
||||
if (size_flag) {
|
||||
switch (old_size) {
|
||||
case FONT_SIZE_TINY:
|
||||
case TINY_SIZE:
|
||||
tagsToClose.push_back(html::EndFontTag(html::FT_SIZE_TINY));
|
||||
break;
|
||||
case FONT_SIZE_SCRIPT:
|
||||
case SCRIPT_SIZE:
|
||||
tagsToClose.push_back(html::EndFontTag(html::FT_SIZE_SCRIPT));
|
||||
break;
|
||||
case FONT_SIZE_FOOTNOTE:
|
||||
case FOOTNOTE_SIZE:
|
||||
tagsToClose.push_back(html::EndFontTag(html::FT_SIZE_FOOTNOTE));
|
||||
break;
|
||||
case FONT_SIZE_SMALL:
|
||||
case SMALL_SIZE:
|
||||
tagsToClose.push_back(html::EndFontTag(html::FT_SIZE_SMALL));
|
||||
break;
|
||||
case FONT_SIZE_LARGE:
|
||||
case LARGE_SIZE:
|
||||
tagsToClose.push_back(html::EndFontTag(html::FT_SIZE_LARGE));
|
||||
break;
|
||||
case FONT_SIZE_LARGER:
|
||||
case LARGER_SIZE:
|
||||
tagsToClose.push_back(html::EndFontTag(html::FT_SIZE_LARGER));
|
||||
break;
|
||||
case FONT_SIZE_LARGEST:
|
||||
case LARGEST_SIZE:
|
||||
tagsToClose.push_back(html::EndFontTag(html::FT_SIZE_LARGEST));
|
||||
break;
|
||||
case FONT_SIZE_HUGE:
|
||||
case HUGE_SIZE:
|
||||
tagsToClose.push_back(html::EndFontTag(html::FT_SIZE_HUGE));
|
||||
break;
|
||||
case FONT_SIZE_HUGER:
|
||||
case HUGER_SIZE:
|
||||
tagsToClose.push_back(html::EndFontTag(html::FT_SIZE_HUGER));
|
||||
break;
|
||||
case FONT_SIZE_INCREASE:
|
||||
case INCREASE_SIZE:
|
||||
tagsToClose.push_back(html::EndFontTag(html::FT_SIZE_INCREASE));
|
||||
break;
|
||||
case FONT_SIZE_DECREASE:
|
||||
case DECREASE_SIZE:
|
||||
tagsToClose.push_back(html::EndFontTag(html::FT_SIZE_DECREASE));
|
||||
break;
|
||||
case FONT_SIZE_INHERIT:
|
||||
case FONT_SIZE_NORMAL:
|
||||
case INHERIT_SIZE:
|
||||
case NORMAL_SIZE:
|
||||
break;
|
||||
default:
|
||||
// the other tags are for internal use
|
||||
@ -3229,52 +3229,52 @@ docstring Paragraph::simpleLyXHTMLOnePar(Buffer const & buf,
|
||||
size_flag = false;
|
||||
}
|
||||
switch (curr_size) {
|
||||
case FONT_SIZE_TINY:
|
||||
case TINY_SIZE:
|
||||
tagsToOpen.push_back(html::FontTag(html::FT_SIZE_TINY));
|
||||
size_flag = true;
|
||||
break;
|
||||
case FONT_SIZE_SCRIPT:
|
||||
case SCRIPT_SIZE:
|
||||
tagsToOpen.push_back(html::FontTag(html::FT_SIZE_SCRIPT));
|
||||
size_flag = true;
|
||||
break;
|
||||
case FONT_SIZE_FOOTNOTE:
|
||||
case FOOTNOTE_SIZE:
|
||||
tagsToOpen.push_back(html::FontTag(html::FT_SIZE_FOOTNOTE));
|
||||
size_flag = true;
|
||||
break;
|
||||
case FONT_SIZE_SMALL:
|
||||
case SMALL_SIZE:
|
||||
tagsToOpen.push_back(html::FontTag(html::FT_SIZE_SMALL));
|
||||
size_flag = true;
|
||||
break;
|
||||
case FONT_SIZE_LARGE:
|
||||
case LARGE_SIZE:
|
||||
tagsToOpen.push_back(html::FontTag(html::FT_SIZE_LARGE));
|
||||
size_flag = true;
|
||||
break;
|
||||
case FONT_SIZE_LARGER:
|
||||
case LARGER_SIZE:
|
||||
tagsToOpen.push_back(html::FontTag(html::FT_SIZE_LARGER));
|
||||
size_flag = true;
|
||||
break;
|
||||
case FONT_SIZE_LARGEST:
|
||||
case LARGEST_SIZE:
|
||||
tagsToOpen.push_back(html::FontTag(html::FT_SIZE_LARGEST));
|
||||
size_flag = true;
|
||||
break;
|
||||
case FONT_SIZE_HUGE:
|
||||
case HUGE_SIZE:
|
||||
tagsToOpen.push_back(html::FontTag(html::FT_SIZE_HUGE));
|
||||
size_flag = true;
|
||||
break;
|
||||
case FONT_SIZE_HUGER:
|
||||
case HUGER_SIZE:
|
||||
tagsToOpen.push_back(html::FontTag(html::FT_SIZE_HUGER));
|
||||
size_flag = true;
|
||||
break;
|
||||
case FONT_SIZE_INCREASE:
|
||||
case INCREASE_SIZE:
|
||||
tagsToOpen.push_back(html::FontTag(html::FT_SIZE_INCREASE));
|
||||
size_flag = true;
|
||||
break;
|
||||
case FONT_SIZE_DECREASE:
|
||||
case DECREASE_SIZE:
|
||||
tagsToOpen.push_back(html::FontTag(html::FT_SIZE_DECREASE));
|
||||
size_flag = true;
|
||||
break;
|
||||
case FONT_SIZE_NORMAL:
|
||||
case FONT_SIZE_INHERIT:
|
||||
case NORMAL_SIZE:
|
||||
case INHERIT_SIZE:
|
||||
break;
|
||||
default:
|
||||
// the other tags are for internal use
|
||||
|
@ -1971,7 +1971,7 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type const pit, int const
|
||||
static int count = 0;
|
||||
++count;
|
||||
FontInfo fi(sane_font);
|
||||
fi.setSize(FONT_SIZE_TINY);
|
||||
fi.setSize(TINY_SIZE);
|
||||
fi.setColor(Color_red);
|
||||
pi.pain.text(row_x, y, convert<docstring>(count), fi);
|
||||
#endif
|
||||
|
@ -62,20 +62,20 @@ static QList<ShapePair> shapeData()
|
||||
static QList<SizePair> sizeData()
|
||||
{
|
||||
QList<SizePair> sizes;
|
||||
sizes << SizePair(qt_("No change"), FONT_SIZE_IGNORE);
|
||||
sizes << SizePair(qt_("Default"), FONT_SIZE_INHERIT);
|
||||
sizes << SizePair(qt_("Tiny"), FONT_SIZE_TINY);
|
||||
sizes << SizePair(qt_("Smallest"), FONT_SIZE_SCRIPT);
|
||||
sizes << SizePair(qt_("Smaller"), FONT_SIZE_FOOTNOTE);
|
||||
sizes << SizePair(qt_("Small"), FONT_SIZE_SMALL);
|
||||
sizes << SizePair(qt_("Normal"), FONT_SIZE_NORMAL);
|
||||
sizes << SizePair(qt_("Large"), FONT_SIZE_LARGE);
|
||||
sizes << SizePair(qt_("Larger"), FONT_SIZE_LARGER);
|
||||
sizes << SizePair(qt_("Largest"), FONT_SIZE_LARGEST);
|
||||
sizes << SizePair(qt_("Huge"), FONT_SIZE_HUGE);
|
||||
sizes << SizePair(qt_("Huger"), FONT_SIZE_HUGER);
|
||||
sizes << SizePair(qt_("Increase"), FONT_SIZE_INCREASE);
|
||||
sizes << SizePair(qt_("Decrease"), FONT_SIZE_DECREASE);
|
||||
sizes << SizePair(qt_("No change"), IGNORE_SIZE);
|
||||
sizes << SizePair(qt_("Default"), INHERIT_SIZE);
|
||||
sizes << SizePair(qt_("Tiny"), TINY_SIZE);
|
||||
sizes << SizePair(qt_("Smallest"), SCRIPT_SIZE);
|
||||
sizes << SizePair(qt_("Smaller"), FOOTNOTE_SIZE);
|
||||
sizes << SizePair(qt_("Small"), SMALL_SIZE);
|
||||
sizes << SizePair(qt_("Normal"), NORMAL_SIZE);
|
||||
sizes << SizePair(qt_("Large"), LARGE_SIZE);
|
||||
sizes << SizePair(qt_("Larger"), LARGER_SIZE);
|
||||
sizes << SizePair(qt_("Largest"), LARGEST_SIZE);
|
||||
sizes << SizePair(qt_("Huge"), HUGE_SIZE);
|
||||
sizes << SizePair(qt_("Huger"), HUGER_SIZE);
|
||||
sizes << SizePair(qt_("Increase"), INCREASE_SIZE);
|
||||
sizes << SizePair(qt_("Decrease"), DECREASE_SIZE);
|
||||
return sizes;
|
||||
}
|
||||
|
||||
@ -455,7 +455,7 @@ void GuiCharacter::checkRestoreDefaults()
|
||||
family[familyCO->currentIndex()].second != INHERIT_FAMILY
|
||||
|| series[seriesCO->currentIndex()].second != INHERIT_SERIES
|
||||
|| shape[shapeCO->currentIndex()].second != INHERIT_SHAPE
|
||||
|| size[sizeCO->currentIndex()].second != FONT_SIZE_INHERIT
|
||||
|| size[sizeCO->currentIndex()].second != INHERIT_SIZE
|
||||
|| setMarkupState(emphCB->checkState()) != FONT_OFF
|
||||
|| setMarkupState(nounCB->checkState()) != FONT_OFF
|
||||
|| setMarkupState(nospellcheckCB->checkState()) != FONT_OFF
|
||||
@ -468,7 +468,7 @@ void GuiCharacter::checkRestoreDefaults()
|
||||
family[familyCO->currentIndex()].second != IGNORE_FAMILY
|
||||
|| series[seriesCO->currentIndex()].second != IGNORE_SERIES
|
||||
|| shape[shapeCO->currentIndex()].second != IGNORE_SHAPE
|
||||
|| size[sizeCO->currentIndex()].second != FONT_SIZE_IGNORE
|
||||
|| size[sizeCO->currentIndex()].second != IGNORE_SIZE
|
||||
|| setMarkupState(emphCB->checkState()) != FONT_IGNORE
|
||||
|| setMarkupState(nounCB->checkState()) != FONT_IGNORE
|
||||
|| setMarkupState(nospellcheckCB->checkState()) != FONT_IGNORE
|
||||
@ -506,7 +506,7 @@ void GuiCharacter::updateContents()
|
||||
if (fi.shape() != tmp.fontInfo().shape())
|
||||
font.fontInfo().setShape(IGNORE_SHAPE);
|
||||
if (fi.size() != tmp.fontInfo().size())
|
||||
font.fontInfo().setSize(FONT_SIZE_IGNORE);
|
||||
font.fontInfo().setSize(IGNORE_SIZE);
|
||||
if (fi.emph() != tmp.fontInfo().emph())
|
||||
font.fontInfo().setEmph(FONT_IGNORE);
|
||||
if (fi.noun() != tmp.fontInfo().noun())
|
||||
@ -662,7 +662,7 @@ bool GuiCharacter::initialiseParams(string const &)
|
||||
if (fi.family() != IGNORE_FAMILY
|
||||
|| fi.series() != IGNORE_SERIES
|
||||
|| fi.shape() != IGNORE_SHAPE
|
||||
|| fi.size() != FONT_SIZE_IGNORE
|
||||
|| fi.size() != IGNORE_SIZE
|
||||
|| getBar(fi) != IGNORE
|
||||
|| fi.color() != Color_ignore
|
||||
|| font_.language() != ignore_language)
|
||||
|
@ -94,7 +94,7 @@ fontinfo_[NUM_FAMILIES][NUM_SERIES][NUM_SHAPE][NUM_SIZE][NUM_STYLE];
|
||||
GuiFontInfo * & fontinfo_ptr(FontInfo const & f)
|
||||
{
|
||||
// The display font and the text font are the same
|
||||
size_t const style = (f.style() == LM_ST_DISPLAY) ? LM_ST_TEXT : f.style();
|
||||
size_t const style = (f.style() == DISPLAY_STYLE) ? TEXT_STYLE : f.style();
|
||||
return fontinfo_[f.family()][f.series()][f.realShape()][f.size()][style];
|
||||
}
|
||||
|
||||
|
@ -982,16 +982,16 @@ void PrefScreenFonts::applyRC(LyXRC & rc) const
|
||||
rc.typewriter_font_name, rc.typewriter_font_foundry);
|
||||
|
||||
rc.defaultZoom = screenZoomSB->value();
|
||||
rc.font_sizes[FONT_SIZE_TINY] = widgetToDoubleStr(screenTinyED);
|
||||
rc.font_sizes[FONT_SIZE_SCRIPT] = widgetToDoubleStr(screenSmallestED);
|
||||
rc.font_sizes[FONT_SIZE_FOOTNOTE] = widgetToDoubleStr(screenSmallerED);
|
||||
rc.font_sizes[FONT_SIZE_SMALL] = widgetToDoubleStr(screenSmallED);
|
||||
rc.font_sizes[FONT_SIZE_NORMAL] = widgetToDoubleStr(screenNormalED);
|
||||
rc.font_sizes[FONT_SIZE_LARGE] = widgetToDoubleStr(screenLargeED);
|
||||
rc.font_sizes[FONT_SIZE_LARGER] = widgetToDoubleStr(screenLargerED);
|
||||
rc.font_sizes[FONT_SIZE_LARGEST] = widgetToDoubleStr(screenLargestED);
|
||||
rc.font_sizes[FONT_SIZE_HUGE] = widgetToDoubleStr(screenHugeED);
|
||||
rc.font_sizes[FONT_SIZE_HUGER] = widgetToDoubleStr(screenHugerED);
|
||||
rc.font_sizes[TINY_SIZE] = widgetToDoubleStr(screenTinyED);
|
||||
rc.font_sizes[SCRIPT_SIZE] = widgetToDoubleStr(screenSmallestED);
|
||||
rc.font_sizes[FOOTNOTE_SIZE] = widgetToDoubleStr(screenSmallerED);
|
||||
rc.font_sizes[SMALL_SIZE] = widgetToDoubleStr(screenSmallED);
|
||||
rc.font_sizes[NORMAL_SIZE] = widgetToDoubleStr(screenNormalED);
|
||||
rc.font_sizes[LARGE_SIZE] = widgetToDoubleStr(screenLargeED);
|
||||
rc.font_sizes[LARGER_SIZE] = widgetToDoubleStr(screenLargerED);
|
||||
rc.font_sizes[LARGEST_SIZE] = widgetToDoubleStr(screenLargestED);
|
||||
rc.font_sizes[HUGE_SIZE] = widgetToDoubleStr(screenHugeED);
|
||||
rc.font_sizes[HUGER_SIZE] = widgetToDoubleStr(screenHugerED);
|
||||
}
|
||||
|
||||
|
||||
@ -1015,16 +1015,16 @@ void PrefScreenFonts::updateRC(LyXRC const & rc)
|
||||
|
||||
void PrefScreenFonts::updateScreenFontSizes(LyXRC const & rc)
|
||||
{
|
||||
doubleToWidget(screenTinyED, rc.font_sizes[FONT_SIZE_TINY]);
|
||||
doubleToWidget(screenSmallestED, rc.font_sizes[FONT_SIZE_SCRIPT]);
|
||||
doubleToWidget(screenSmallerED, rc.font_sizes[FONT_SIZE_FOOTNOTE]);
|
||||
doubleToWidget(screenSmallED, rc.font_sizes[FONT_SIZE_SMALL]);
|
||||
doubleToWidget(screenNormalED, rc.font_sizes[FONT_SIZE_NORMAL]);
|
||||
doubleToWidget(screenLargeED, rc.font_sizes[FONT_SIZE_LARGE]);
|
||||
doubleToWidget(screenLargerED, rc.font_sizes[FONT_SIZE_LARGER]);
|
||||
doubleToWidget(screenLargestED, rc.font_sizes[FONT_SIZE_LARGEST]);
|
||||
doubleToWidget(screenHugeED, rc.font_sizes[FONT_SIZE_HUGE]);
|
||||
doubleToWidget(screenHugerED, rc.font_sizes[FONT_SIZE_HUGER]);
|
||||
doubleToWidget(screenTinyED, rc.font_sizes[TINY_SIZE]);
|
||||
doubleToWidget(screenSmallestED, rc.font_sizes[SCRIPT_SIZE]);
|
||||
doubleToWidget(screenSmallerED, rc.font_sizes[FOOTNOTE_SIZE]);
|
||||
doubleToWidget(screenSmallED, rc.font_sizes[SMALL_SIZE]);
|
||||
doubleToWidget(screenNormalED, rc.font_sizes[NORMAL_SIZE]);
|
||||
doubleToWidget(screenLargeED, rc.font_sizes[LARGE_SIZE]);
|
||||
doubleToWidget(screenLargerED, rc.font_sizes[LARGER_SIZE]);
|
||||
doubleToWidget(screenLargestED, rc.font_sizes[LARGEST_SIZE]);
|
||||
doubleToWidget(screenHugeED, rc.font_sizes[HUGE_SIZE]);
|
||||
doubleToWidget(screenHugerED, rc.font_sizes[HUGER_SIZE]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -276,7 +276,7 @@ private:
|
||||
}
|
||||
|
||||
qreal fontSize() const {
|
||||
return toqstr(lyxrc.font_sizes[FONT_SIZE_NORMAL]).toDouble();
|
||||
return toqstr(lyxrc.font_sizes[NORMAL_SIZE]).toDouble();
|
||||
}
|
||||
|
||||
QPointF textPosition(bool const heading) const {
|
||||
|
@ -165,14 +165,14 @@ void RenderGraphic::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
// FIXME UNICODE
|
||||
docstring const justname = from_utf8(params_.filename.onlyFileName());
|
||||
if (!justname.empty()) {
|
||||
msgFont.setSize(FONT_SIZE_FOOTNOTE);
|
||||
msgFont.setSize(FOOTNOTE_SIZE);
|
||||
font_width = theFontMetrics(msgFont).width(justname);
|
||||
font_height = theFontMetrics(msgFont).maxHeight();
|
||||
}
|
||||
|
||||
docstring const msg = statusMessage(params_, loader_.status());
|
||||
if (!msg.empty()) {
|
||||
msgFont.setSize(FONT_SIZE_TINY);
|
||||
msgFont.setSize(TINY_SIZE);
|
||||
font_width = max(font_width,
|
||||
theFontMetrics(msgFont).width(msg));
|
||||
font_height += theFontMetrics(msgFont).maxAscent();
|
||||
@ -209,7 +209,7 @@ void RenderGraphic::draw(PainterInfo & pi, int x, int y) const
|
||||
string const justname = params_.filename.onlyFileName();
|
||||
|
||||
if (!justname.empty()) {
|
||||
msgFont.setSize(FONT_SIZE_FOOTNOTE);
|
||||
msgFont.setSize(FOOTNOTE_SIZE);
|
||||
pi.pain.text(x1 + 6, y - theFontMetrics(msgFont).maxAscent() - 4,
|
||||
from_utf8(justname), msgFont);
|
||||
}
|
||||
@ -217,7 +217,7 @@ void RenderGraphic::draw(PainterInfo & pi, int x, int y) const
|
||||
// Print the message.
|
||||
docstring const msg = statusMessage(params_, loader_.status());
|
||||
if (!msg.empty()) {
|
||||
msgFont.setSize(FONT_SIZE_TINY);
|
||||
msgFont.setSize(TINY_SIZE);
|
||||
pi.pain.text(x1 + 6, y - 4, msg, msgFont);
|
||||
}
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ void RenderPreview::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
|
||||
FontInfo font(mi.base.font);
|
||||
font.setFamily(SANS_FAMILY);
|
||||
font.setSize(FONT_SIZE_FOOTNOTE);
|
||||
font.setSize(FOOTNOTE_SIZE);
|
||||
docstring const stat = statusMessage(mi.base.bv, snippet_);
|
||||
dim.wid = 15 + theFontMetrics(font).width(stat);
|
||||
}
|
||||
@ -176,7 +176,7 @@ void RenderPreview::draw(PainterInfo & pi, int x, int y) const
|
||||
|
||||
FontInfo font(pi.base.font);
|
||||
font.setFamily(SANS_FAMILY);
|
||||
font.setSize(FONT_SIZE_FOOTNOTE);
|
||||
font.setSize(FOOTNOTE_SIZE);
|
||||
|
||||
docstring const stat = statusMessage(pi.base.bv, snippet_);
|
||||
pi.pain.text(x + offset + 6,
|
||||
|
@ -50,7 +50,7 @@ void InsetMathDiagram::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
{
|
||||
Changer dummy2 = mi.base.changeEnsureMath();
|
||||
FontInfo & f = mi.base.font;
|
||||
Changer dummy = (f.style() == LM_ST_DISPLAY) ? f.changeStyle(LM_ST_TEXT)
|
||||
Changer dummy = (f.style() == DISPLAY_STYLE) ? f.changeStyle(TEXT_STYLE)
|
||||
: Changer();
|
||||
InsetMathGrid::metrics(mi, dim);
|
||||
}
|
||||
@ -60,7 +60,7 @@ void InsetMathDiagram::draw(PainterInfo & pi, int x, int y) const
|
||||
{
|
||||
Changer dummy2 = pi.base.changeEnsureMath();
|
||||
FontInfo & f = pi.base.font;
|
||||
Changer dummy = (f.style() == LM_ST_DISPLAY) ? f.changeStyle(LM_ST_TEXT)
|
||||
Changer dummy = (f.style() == DISPLAY_STYLE) ? f.changeStyle(TEXT_STYLE)
|
||||
: Changer();
|
||||
InsetMathGrid::draw(pi, x, y);
|
||||
}
|
||||
|
@ -243,12 +243,12 @@ void InsetMathFrac::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
int const dy = axis_height(mi.base);
|
||||
Changer dummy =
|
||||
// \tfrac is always in text size
|
||||
(kind_ == TFRAC) ? mi.base.font.changeStyle(LM_ST_SCRIPT) :
|
||||
(kind_ == TFRAC) ? mi.base.font.changeStyle(SCRIPT_STYLE) :
|
||||
// \cfrac and \dfrac are always in display size
|
||||
(kind_ == CFRAC
|
||||
|| kind_ == CFRACLEFT
|
||||
|| kind_ == CFRACRIGHT
|
||||
|| kind_ == DFRAC) ? mi.base.font.changeStyle(LM_ST_DISPLAY) :
|
||||
|| kind_ == DFRAC) ? mi.base.font.changeStyle(DISPLAY_STYLE) :
|
||||
// all others
|
||||
mi.base.changeFrac();
|
||||
Changer dummy2 = mi.base.changeEnsureMath();
|
||||
@ -325,12 +325,12 @@ void InsetMathFrac::draw(PainterInfo & pi, int x, int y) const
|
||||
int const dy = axis_height(pi.base);
|
||||
Changer dummy =
|
||||
// \tfrac is always in text size
|
||||
(kind_ == TFRAC) ? pi.base.font.changeStyle(LM_ST_SCRIPT) :
|
||||
(kind_ == TFRAC) ? pi.base.font.changeStyle(SCRIPT_STYLE) :
|
||||
// \cfrac and \dfrac are always in display size
|
||||
(kind_ == CFRAC
|
||||
|| kind_ == CFRACLEFT
|
||||
|| kind_ == CFRACRIGHT
|
||||
|| kind_ == DFRAC) ? pi.base.font.changeStyle(LM_ST_DISPLAY) :
|
||||
|| kind_ == DFRAC) ? pi.base.font.changeStyle(DISPLAY_STYLE) :
|
||||
// all others
|
||||
pi.base.changeFrac();
|
||||
Dimension const dim1 = cell(1).dimension(*pi.base.bv);
|
||||
@ -649,8 +649,8 @@ void InsetMathBinom::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
Dimension dim0, dim1;
|
||||
int const dy = axis_height(mi.base);
|
||||
Changer dummy =
|
||||
(kind_ == DBINOM) ? mi.base.font.changeStyle(LM_ST_DISPLAY) :
|
||||
(kind_ == TBINOM) ? mi.base.font.changeStyle(LM_ST_SCRIPT) :
|
||||
(kind_ == DBINOM) ? mi.base.font.changeStyle(DISPLAY_STYLE) :
|
||||
(kind_ == TBINOM) ? mi.base.font.changeStyle(SCRIPT_STYLE) :
|
||||
mi.base.changeFrac();
|
||||
cell(0).metrics(mi, dim0);
|
||||
cell(1).metrics(mi, dim1);
|
||||
@ -676,8 +676,8 @@ void InsetMathBinom::draw(PainterInfo & pi, int x, int y) const
|
||||
int m = x + dim.width() / 2;
|
||||
{
|
||||
Changer dummy =
|
||||
(kind_ == DBINOM) ? pi.base.font.changeStyle(LM_ST_DISPLAY) :
|
||||
(kind_ == TBINOM) ? pi.base.font.changeStyle(LM_ST_SCRIPT) :
|
||||
(kind_ == DBINOM) ? pi.base.font.changeStyle(DISPLAY_STYLE) :
|
||||
(kind_ == TBINOM) ? pi.base.font.changeStyle(SCRIPT_STYLE) :
|
||||
pi.base.changeFrac();
|
||||
// take dy both for the vertical alignment and for the spacing between
|
||||
// cells
|
||||
|
@ -549,8 +549,8 @@ void InsetMathHull::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
}
|
||||
|
||||
Changer dummy1 = mi.base.changeFontSet(standardFont());
|
||||
Changer dummy2 = mi.base.font.changeStyle(display() ? LM_ST_DISPLAY
|
||||
: LM_ST_TEXT);
|
||||
Changer dummy2 = mi.base.font.changeStyle(display() ? DISPLAY_STYLE
|
||||
: TEXT_STYLE);
|
||||
|
||||
// let the cells adjust themselves
|
||||
InsetMathGrid::metrics(mi, dim);
|
||||
@ -653,8 +653,8 @@ void InsetMathHull::draw(PainterInfo & pi, int x, int y) const
|
||||
Changer dummy0 = really_change_color ? pi.base.font.changeColor(color)
|
||||
: Changer();
|
||||
Changer dummy1 = pi.base.changeFontSet(standardFont());
|
||||
Changer dummy2 = pi.base.font.changeStyle(display() ? LM_ST_DISPLAY
|
||||
: LM_ST_TEXT);
|
||||
Changer dummy2 = pi.base.font.changeStyle(display() ? DISPLAY_STYLE
|
||||
: TEXT_STYLE);
|
||||
|
||||
int xmath = x;
|
||||
BufferParams::MathNumber const math_number = buffer().params().getMathNumber();
|
||||
|
@ -126,7 +126,7 @@ void InsetLabelBox::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
if (parent_.editing(mi.base.bv) && label_.length() > 0) {
|
||||
// grey
|
||||
FontInfo font = sane_font;
|
||||
font.setSize(FONT_SIZE_TINY);
|
||||
font.setSize(TINY_SIZE);
|
||||
font.setColor(Color_mathmacrolabel);
|
||||
|
||||
// make space for label and box
|
||||
@ -156,7 +156,7 @@ void InsetLabelBox::draw(PainterInfo & pi, int x, int y) const
|
||||
if (parent_.editing(pi.base.bv) && label_.length() > 0) {
|
||||
// grey
|
||||
FontInfo font = sane_font;
|
||||
font.setSize(FONT_SIZE_TINY);
|
||||
font.setSize(TINY_SIZE);
|
||||
font.setColor(Color_mathmacrolabel);
|
||||
|
||||
// make space for label and box
|
||||
@ -545,7 +545,7 @@ void InsetMathMacroTemplate::createLook(int args) const
|
||||
void InsetMathMacroTemplate::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
{
|
||||
Changer dummy1 = mi.base.changeFontSet("mathnormal");
|
||||
Changer dummy2 = mi.base.font.changeStyle(LM_ST_TEXT);
|
||||
Changer dummy2 = mi.base.font.changeStyle(TEXT_STYLE);
|
||||
|
||||
// valid macro?
|
||||
MacroData const * macro = 0;
|
||||
@ -587,7 +587,7 @@ void InsetMathMacroTemplate::draw(PainterInfo & pi, int x, int y) const
|
||||
// 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(LM_ST_TEXT);
|
||||
Changer dummy2 = pi.base.font.changeStyle(TEXT_STYLE);
|
||||
|
||||
Dimension const dim = dimension(*pi.base.bv);
|
||||
|
||||
|
@ -47,7 +47,7 @@ void mathed_root_metrics(MetricsInfo & mi, MathData const & nucleus,
|
||||
Changer dummy = mi.base.changeEnsureMath();
|
||||
Dimension dimr;
|
||||
if (root) {
|
||||
Changer script = mi.base.font.changeStyle(LM_ST_SCRIPTSCRIPT);
|
||||
Changer script = mi.base.font.changeStyle(SCRIPTSCRIPT_STYLE);
|
||||
// make sure that the dim is high enough for any character
|
||||
root->metrics(mi, dimr, false);
|
||||
}
|
||||
@ -70,7 +70,7 @@ void mathed_root_metrics(MetricsInfo & mi, MathData const & nucleus,
|
||||
*/
|
||||
int const t = mi.base.solidLineThickness();
|
||||
int const x_height = mathed_font_x_height(mi.base.font);
|
||||
int const phi = (mi.base.font.style() == LM_ST_DISPLAY) ? x_height : t;
|
||||
int const phi = (mi.base.font.style() == DISPLAY_STYLE) ? 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;
|
||||
@ -105,7 +105,7 @@ void mathed_draw_root(PainterInfo & pi, int x, int y, MathData const & nucleus,
|
||||
int const wl = dim.width() - dimn.width();
|
||||
// the "exponent"
|
||||
if (root) {
|
||||
Changer script = pi.base.font.changeStyle(LM_ST_SCRIPTSCRIPT);
|
||||
Changer script = pi.base.font.changeStyle(SCRIPTSCRIPT_STYLE);
|
||||
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);
|
||||
|
@ -72,7 +72,7 @@ void InsetMathSymbol::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
}
|
||||
// set scriptable_
|
||||
scriptable_ = false;
|
||||
if (mi.base.font.style() == LM_ST_DISPLAY)
|
||||
if (mi.base.font.style() == DISPLAY_STYLE)
|
||||
if (sym_->inset == "cmex" || sym_->inset == "esint" ||
|
||||
sym_->extra == "funclim" ||
|
||||
(sym_->inset == "stmry" && sym_->extra == "mathop"))
|
||||
|
@ -147,14 +147,14 @@ int class_spacing(MathClass const mc1, MathClass const mc2,
|
||||
// << "=" << spc_code << " @" << mb.style << endl;
|
||||
if (spc_code < 0) {
|
||||
switch (mb.font.style()) {
|
||||
case LM_ST_DISPLAY:
|
||||
case LM_ST_TEXT:
|
||||
case LM_ST_IGNORE:
|
||||
case LM_ST_INHERIT:
|
||||
case DISPLAY_STYLE:
|
||||
case TEXT_STYLE:
|
||||
case IGNORE_STYLE:
|
||||
case INHERIT_STYLE:
|
||||
spc_code = abs(spc_code);
|
||||
break;
|
||||
case LM_ST_SCRIPT:
|
||||
case LM_ST_SCRIPTSCRIPT:
|
||||
case SCRIPT_STYLE:
|
||||
case SCRIPTSCRIPT_STYLE:
|
||||
spc_code = 0;
|
||||
}
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ void afterMetricsMarkers(MetricsInfo const & , MathRow::Element & e,
|
||||
break;
|
||||
case InsetMath::BOX_MARKER:
|
||||
FontInfo font;
|
||||
font.setSize(FONT_SIZE_TINY);
|
||||
font.setSize(TINY_SIZE);
|
||||
Dimension namedim;
|
||||
mathed_string_dim(font, e.inset->name(), namedim);
|
||||
int const namewid = 1 + namedim.wid + 1;
|
||||
@ -109,7 +109,7 @@ void drawMarkers(PainterInfo const & pi, MathRow::Element const & e,
|
||||
if (e.marker == InsetMath::BOX_MARKER) {
|
||||
// draw header and rectangle around
|
||||
FontInfo font;
|
||||
font.setSize(FONT_SIZE_TINY);
|
||||
font.setSize(TINY_SIZE);
|
||||
font.setColor(Color_mathmacrolabel);
|
||||
Dimension namedim;
|
||||
mathed_string_dim(font, e.inset->name(), namedim);
|
||||
|
Loading…
Reference in New Issue
Block a user