X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathEnsureMath.cpp;h=8bd685c5a0c6181290d2261da91b7634439f5d81;hb=999831043e6da50b3095a2dfec7000d4209e586c;hp=a4070265905f54b0574eaf837d6b81d96d3d1b00;hpb=740e89de178ed13513c8ce4a048463140b9f02e4;p=lyx.git diff --git a/src/mathed/InsetMathEnsureMath.cpp b/src/mathed/InsetMathEnsureMath.cpp index a407026590..8bd685c5a0 100644 --- a/src/mathed/InsetMathEnsureMath.cpp +++ b/src/mathed/InsetMathEnsureMath.cpp @@ -13,11 +13,13 @@ #include "InsetMathEnsureMath.h" -#include "LaTeXFeatures.h" #include "MathData.h" #include "MathStream.h" #include "MathSupport.h" +#include "LaTeXFeatures.h" +#include "MetricsInfo.h" + #include @@ -36,19 +38,15 @@ Inset * InsetMathEnsureMath::clone() const void InsetMathEnsureMath::metrics(MetricsInfo & mi, Dimension & dim) const { - bool really_change_font = isTextFont(from_ascii(mi.base.fontname)); - FontSetChanger dummy(mi.base, "mathnormal", really_change_font); + Changer dummy = mi.base.changeEnsureMath(); cell(0).metrics(mi, dim); - metricsMarkers(dim); } void InsetMathEnsureMath::draw(PainterInfo & pi, int x, int y) const { - bool really_change_font = isTextFont(from_ascii(pi.base.fontname)); - FontSetChanger dummy(pi.base, "mathnormal", really_change_font); + Changer dummy = pi.base.changeEnsureMath(); cell(0).draw(pi, x, y); - drawMarkers(pi, x, y); } @@ -101,13 +99,9 @@ void InsetMathEnsureMath::validate(LaTeXFeatures & features) const // It'd be better to be able to get this from an InsetLayout, but at present // InsetLayouts do not seem really to work for things that aren't InsetTexts. if (features.runparams().math_flavor == OutputParams::MathAsMathML) - features.addPreambleSnippet(""); + features.addCSSSnippet("mstyle.math { font-style: italic; }"); else if (features.runparams().math_flavor == OutputParams::MathAsHTML) - features.addPreambleSnippet(""); + features.addCSSSnippet("span.mathbox { font-style: italic; }"); InsetMathNest::validate(features); }