commit d0cafa2367f34954f8693bfc6b1a0ff8beb1ea81
Author: Enrico Forestieri <[email protected]>
Date: Mon Mar 3 23:14:05 2025 +0100
Fix bug #13156
(cherry picked from commit 9a2e69070fac31baee65a4af760afbf518fdc473)
---
src/mathed/InsetMathChar.cpp | 18 ++++++++++++++++--
status.24x | 2 ++
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/mathed/InsetMathChar.cpp b/src/mathed/InsetMathChar.cpp
index 82d0b63f1e..bfe0d46eda 100644
--- a/src/mathed/InsetMathChar.cpp
+++ b/src/mathed/InsetMathChar.cpp
@@ -116,7 +116,14 @@ void InsetMathChar::metrics(MetricsInfo & mi, Dimension &
dim) const
dim = theFontMetrics(mi.base.font).dimension(char_);
kerning_ = 0;
} else if (!isASCII(char_) &&
Encodings::unicodeCharInfo(char_).isUnicodeSymbol()) {
- Changer dummy1 = mi.base.changeFontSet("mathnormal");
+ bool special_font = (f == "mathbb" ||
+ f == "mathds" ||
+ f == "mathfrak" ||
+ f == "mathcal" ||
+ f == "mathscr");
+ Changer dummy1 = special_font
+ ? mi.base.changeFontSet("mathnormal")
+ : noChange();
Changer dummy2 = Encodings::isMathAlpha(char_)
? noChange()
: mi.base.font.changeShape(UP_SHAPE);
@@ -161,7 +168,14 @@ void InsetMathChar::draw(PainterInfo & pi, int x, int y)
const
pi.draw(x, y, char_);
return;
} else if (!isASCII(char_) &&
Encodings::unicodeCharInfo(char_).isUnicodeSymbol()) {
- Changer dummy1 = pi.base.changeFontSet("mathnormal");
+ bool special_font = (pi.base.fontname == "mathbb" ||
+ pi.base.fontname == "mathds" ||
+ pi.base.fontname == "mathfrak" ||
+ pi.base.fontname == "mathcal" ||
+ pi.base.fontname == "mathscr");
+ Changer dummy1 = special_font
+ ? pi.base.changeFontSet("mathnormal")
+ : noChange();
Changer dummy2 = Encodings::isMathAlpha(char_)
? noChange()
: pi.base.font.changeShape(UP_SHAPE);
diff --git a/status.24x b/status.24x
index ee6822101a..6070b62e38 100644
--- a/status.24x
+++ b/status.24x
@@ -87,6 +87,8 @@ What's new
- Do not require the input of year in bibliography item
dialog with Natbib (Numeric).
+- Fix display of accented characters in math (bug 13156).
+
* INTERNALS
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs