* src/mathes/InsetMathUnknown.cpp (metrics, draw):

- set correct font shape (bug 2594).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@25400 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2008-06-28 08:59:07 +00:00
parent f45d15be2f
commit 89496dd922
2 changed files with 14 additions and 3 deletions

View File

@ -55,9 +55,14 @@ void InsetMathUnknown::normalize(NormalStream & os) const
bool InsetMathUnknown::metrics(MetricsInfo & mi, Dimension & dim) const bool InsetMathUnknown::metrics(MetricsInfo & mi, Dimension & dim) const
{ {
Font tmpfont = mi.base.font;
mi.base.font = Font(Font::ALL_INHERIT);
mi.base.font.setShape(Font::UP_SHAPE);
mi.base.font.realize(tmpfont);
mathed_string_dim(mi.base.font, name_, dim); mathed_string_dim(mi.base.font, name_, dim);
docstring::const_reverse_iterator rit = name_.rbegin(); docstring::const_reverse_iterator rit = name_.rbegin();
kerning_ = mathed_char_kerning(mi.base.font, *rit); kerning_ = mathed_char_kerning(mi.base.font, *rit);
mi.base.font = tmpfont;
if (dim_ == dim) if (dim_ == dim)
return false; return false;
dim_ = dim; dim_ = dim;
@ -67,11 +72,16 @@ bool InsetMathUnknown::metrics(MetricsInfo & mi, Dimension & dim) const
void InsetMathUnknown::draw(PainterInfo & pi, int x, int y) const void InsetMathUnknown::draw(PainterInfo & pi, int x, int y) const
{ {
Font tmpfont = pi.base.font;
pi.base.font = Font(Font::ALL_INHERIT);
pi.base.font.setShape(Font::UP_SHAPE);
pi.base.font.realize(tmpfont);
if (black_) if (black_)
drawStrBlack(pi, x, y, name_); drawStrBlack(pi, x, y, name_);
else else
drawStrRed(pi, x, y, name_); drawStrRed(pi, x, y, name_);
setPosCache(pi, x, y); setPosCache(pi, x, y);
pi.base.font = tmpfont;
} }

View File

@ -54,9 +54,6 @@ What's new
- Reenable quote display code, which was not working since 1.5.0. - Reenable quote display code, which was not working since 1.5.0.
- Fix shape of braces, '$', '%', '&', and '#', which where incorrectly shown
in italic in mathed (bug 4320).
* WINDOWS INSTALLER * WINDOWS INSTALLER
@ -99,7 +96,11 @@ What's new
- Use appropriate font in notes and ERT insets in section headings - Use appropriate font in notes and ERT insets in section headings
(bug 2477). (bug 2477).
- Fix shape of braces, '$', '%', '&', and '#', which where incorrectly
shown in italics in mathed (bug 4320).
- Fix display of unknown math macros, which were incorrectly shown in
italics (bug 2594).
* DOCUMENTATION AND LOCALIZATION * DOCUMENTATION AND LOCALIZATION