From fb63864d7afe2db89b69dcb2eecdbd87d3ba1aa7 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Wed, 2 Jun 2010 00:24:19 +0000 Subject: [PATCH] Fix bug #6745: Wrong fonts with \ensuremath git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@34584 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathEnsureMath.cpp | 9 ++++++--- status.16x | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mathed/InsetMathEnsureMath.cpp b/src/mathed/InsetMathEnsureMath.cpp index 9b29449048..3c63c26178 100644 --- a/src/mathed/InsetMathEnsureMath.cpp +++ b/src/mathed/InsetMathEnsureMath.cpp @@ -13,8 +13,9 @@ #include "InsetMathEnsureMath.h" -#include "MathStream.h" #include "MathData.h" +#include "MathStream.h" +#include "MathSupport.h" #include @@ -34,7 +35,8 @@ Inset * InsetMathEnsureMath::clone() const void InsetMathEnsureMath::metrics(MetricsInfo & mi, Dimension & dim) const { - FontSetChanger dummy(mi.base, "mathnormal"); + bool really_change_font = isTextFont(from_ascii(mi.base.fontname)); + FontSetChanger dummy(mi.base, "mathnormal", really_change_font); cell(0).metrics(mi, dim); metricsMarkers(dim); } @@ -42,7 +44,8 @@ void InsetMathEnsureMath::metrics(MetricsInfo & mi, Dimension & dim) const void InsetMathEnsureMath::draw(PainterInfo & pi, int x, int y) const { - FontSetChanger dummy(pi.base, "mathnormal"); + bool really_change_font = isTextFont(from_ascii(pi.base.fontname)); + FontSetChanger dummy(pi.base, "mathnormal", really_change_font); cell(0).draw(pi, x, y); drawMarkers(pi, x, y); } diff --git a/status.16x b/status.16x index b41d80de69..a776426495 100644 --- a/status.16x +++ b/status.16x @@ -118,7 +118,8 @@ What's new - Correctly paint the button for external material when the "Preview" attribute is not defined (bug 6677). -- Use right font for rendering the \underbar macro in math (bug 6729). +- Use right fonts for rendering the \underbar and \ensuremath macros in + math when they are nested in certain environments (bug 6729 and 6745). * DOCUMENTATION AND LOCALIZATION