[LyX/2.4.x] Fixup logic in LaTeXFonts::getUsedFont()

Juergen Spitzmueller spitz at lyx.org
Wed Nov 13 16:16:13 UTC 2024


commit 2a60f327807f2834f29fa7d9196cf944d8a8080d
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Wed Nov 13 09:02:49 2024 +0100

    Fixup logic in LaTeXFonts::getUsedFont()
    
    Allow for unavailable switchdefault fonts fall back to AltFonts
    
    Prerequisite to implement #13124
    
    (cherry picked from commit 833c37293147cec14500a208c8ca98cdc010346d)
---
 src/LaTeXFonts.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/LaTeXFonts.cpp b/src/LaTeXFonts.cpp
index c9d030e8c3..a6b5783b01 100644
--- a/src/LaTeXFonts.cpp
+++ b/src/LaTeXFonts.cpp
@@ -199,7 +199,8 @@ docstring const LaTeXFont::getUsedFont(bool ot1, bool complete, bool nomath, boo
 		 && altfonts_.empty()) {
 			return name_;
 	}
-	else if (!altfonts_.empty()) {
+	// if we haven't somethin up to here, try fallback fonts
+	if (!altfonts_.empty()) {
 		for (auto const & name : altfonts_) {
 			LaTeXFont altf = altFont(name);
 			if (altf.available(ot1, nomath))


More information about the lyx-cvs mailing list