Author: forenr
Date: Wed Jun  2 02:24:19 2010
New Revision: 34584
URL: http://www.lyx.org/trac/changeset/34584

Log:
Fix bug #6745: Wrong fonts with \ensuremath

Modified:
   lyx-devel/branches/BRANCH_1_6_X/src/mathed/InsetMathEnsureMath.cpp
   lyx-devel/branches/BRANCH_1_6_X/status.16x

Modified: lyx-devel/branches/BRANCH_1_6_X/src/mathed/InsetMathEnsureMath.cpp
==============================================================================
--- lyx-devel/branches/BRANCH_1_6_X/src/mathed/InsetMathEnsureMath.cpp  Tue Jun 
 1 18:13:54 2010        (r34583)
+++ lyx-devel/branches/BRANCH_1_6_X/src/mathed/InsetMathEnsureMath.cpp  Wed Jun 
 2 02:24:19 2010        (r34584)
@@ -13,8 +13,9 @@
 
 #include "InsetMathEnsureMath.h"
 
-#include "MathStream.h"
 #include "MathData.h"
+#include "MathStream.h"
+#include "MathSupport.h"
 
 #include <ostream>
 
@@ -34,7 +35,8 @@
 
 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::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);
 }

Modified: lyx-devel/branches/BRANCH_1_6_X/status.16x
==============================================================================
--- lyx-devel/branches/BRANCH_1_6_X/status.16x  Tue Jun  1 18:13:54 2010        
(r34583)
+++ lyx-devel/branches/BRANCH_1_6_X/status.16x  Wed Jun  2 02:24:19 2010        
(r34584)
@@ -118,7 +118,8 @@
 - 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

Reply via email to