]> git.lyx.org Git - lyx.git/blobdiff - src/MetricsInfo.cpp
Fix #10778 (issue with CJK and language nesting)
[lyx.git] / src / MetricsInfo.cpp
index 2b954d3ed96d12926f78963c9f84cfb74587c6aa..71d7a39de1a75c4e356d1967a9fc3093d284bc11 100644 (file)
@@ -244,7 +244,8 @@ FontSetChanger::FontSetChanger(MetricsBase & mb, char const * name,
                ColorCode oldcolor = save_.font.color();
                docstring const oldname = from_ascii(save_.fontname);
                mb.fontname = name;
-               mb.font = sane_font;
+               if (isMathFont(from_ascii(name)) || isMathFont(oldname))
+                       mb.font = sane_font;
                augmentFont(mb.font, from_ascii(name));
                mb.font.setSize(oldsize);
                if (string(name) != "lyxtex"
@@ -264,7 +265,8 @@ FontSetChanger::FontSetChanger(MetricsBase & mb, docstring const & name,
                ColorCode oldcolor = save_.font.color();
                docstring const oldname = from_ascii(save_.fontname);
                mb.fontname = to_utf8(name);
-               mb.font = sane_font;
+               if (isMathFont(name) || isMathFont(oldname))
+                       mb.font = sane_font;
                augmentFont(mb.font, name);
                mb.font.setSize(oldsize);
                if (name != "lyxtex"