On Tue, Oct 25, 2016 at 04:04:01PM +0200, Enrico Forestieri wrote:
> commit 3cf0cbb3c69e73d72b6cee3723de7b67e69c4c0a
> Author: Enrico Forestieri <for...@lyx.org>
> Date:   Tue Oct 25 16:03:34 2016 +0200
> 
>     Show on screen font changes for text-in-math

Richard, please find attached the corresponding patch for stable.
This solves the on-screen representation glitch illustrated in
the also attached example.

-- 
Enrico
diff --git a/src/MetricsInfo.cpp b/src/MetricsInfo.cpp
index 2b954d3..71d7a39 100644
--- a/src/MetricsInfo.cpp
+++ b/src/MetricsInfo.cpp
@@ -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"
#LyX 1.4.5.1 created this file. For more info see http://www.lyx.org/
\lyxformat 245
\begin_document
\begin_header
\textclass article
\language english
\inputencoding auto
\fontscheme default
\graphics default
\paperfontsize default
\papersize default
\use_geometry false
\use_amsmath 1
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes true
\end_header

\begin_body

\begin_layout Standard
In the following equation, the 
\begin_inset Quotes els
\end_inset

a
\begin_inset Quotes ers
\end_inset

 should be bold, italic and green:
\begin_inset Formula \[
{\color{green}b=\textbf{\textit{a}}}\]

\end_inset


\end_layout

\end_body
\end_document

Reply via email to