[LyX/master] Correctly compute metrics for single-char non-math fonts

Enrico Forestieri forenr at lyx.org
Thu Aug 6 13:11:44 UTC 2020


commit 582296d79a143d918f30c14971c428d830f3752d
Author: Enrico Forestieri <forenr at lyx.org>
Date:   Thu Aug 6 15:34:54 2020 +0200

    Correctly compute metrics for single-char non-math fonts
    
    As evidenced by the comment, this corrects a thinko.
---
 src/frontends/qt/GuiFontMetrics.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/frontends/qt/GuiFontMetrics.cpp b/src/frontends/qt/GuiFontMetrics.cpp
index efd8463..9ff027e 100644
--- a/src/frontends/qt/GuiFontMetrics.cpp
+++ b/src/frontends/qt/GuiFontMetrics.cpp
@@ -241,7 +241,7 @@ int GuiFontMetrics::width(docstring const & s) const
 	int w = 0;
 	// is the string a single character from a math font ?
 #if QT_VERSION >= 0x040800
-	bool const math_char = s.length() == 1 || font_.styleName() == "LyX";
+	bool const math_char = s.length() == 1 && font_.styleName() == "LyX";
 #else
 	bool const math_char = s.length() == 1;
 #endif


More information about the lyx-cvs mailing list