[LyX/master] Fix bug #3751

Enrico Forestieri forenr at lyx.org
Sat Feb 27 20:42:53 UTC 2021


commit 7b526d6461a517888d1291e376a36f29aec9e272
Author: Enrico Forestieri <forenr at lyx.org>
Date:   Sat Feb 27 21:40:28 2021 +0100

    Fix bug #3751
    
    We lack the necessary font (cmb10) for drawing bold uppercase greek
    letters. It would be overkill adding it for this sole purpose, so
    adopt the same poor man's bold strategy used with \boldsymbol.
---
 src/mathed/MathSupport.cpp |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp
index 6a5218b..1601920 100644
--- a/src/mathed/MathSupport.cpp
+++ b/src/mathed/MathSupport.cpp
@@ -772,9 +772,12 @@ void mathedSymbolDraw(PainterInfo & pi, int x, int y, latexkeys const * sym)
 	//	<< "' drawn as: '" << sym->draw
 	//	<< "'" << endl;
 
-	bool const italic_upcase_greek = sym->inset == "cmr" &&
-		sym->extra == "mathalpha" &&
-		pi.base.fontname == "mathit";
+	bool const upcase_greek =
+		sym->inset == "cmr" && sym->extra == "mathalpha";
+	bool const bold_upcase_greek =
+		upcase_greek && pi.base.fontname == "mathbf";
+	bool const italic_upcase_greek =
+		upcase_greek && pi.base.fontname == "mathit";
 	std::string const font = italic_upcase_greek ? "cmm" : sym->inset;
 	bool const change_font = font != "cmr" ||
 				(pi.base.fontname != "mathbb" &&
@@ -784,6 +787,8 @@ void mathedSymbolDraw(PainterInfo & pi, int x, int y, latexkeys const * sym)
 				 pi.base.fontname != "mathscr");
 	Changer dummy = change_font ? pi.base.changeFontSet(font) : noChange();
 	pi.draw(x, y, mathedSymbol(pi.base, sym));
+	if (bold_upcase_greek)
+		pi.draw(x + 1, y, mathedSymbol(pi.base, sym));
 }
 
 


More information about the lyx-cvs mailing list