]> git.lyx.org Git - features.git/commitdiff
Address an edge case where we need to loaf fontspec also with babel
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 18 Feb 2023 15:12:49 +0000 (16:12 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 18 Feb 2023 15:12:49 +0000 (16:12 +0100)
src/BufferParams.cpp

index 4d7550ac480532304ec8b45a9484e576d87ce382..e702b182f064a445ff75777c39e4f0d3bd50481e 100644 (file)
@@ -1921,8 +1921,12 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
 
        if (useNonTeXFonts) {
                // Babel (as of 2017/11/03) loads fontspec itself
+               // However, it does so only if a non-default font is requested via \babelfont
+               // Thus load fontspec if this is not the case and we need fontspec features
                if (!features.isProvided("fontspec")
-                   && !(features.useBabel() && features.isAvailableAtLeastFrom("babel", 2017, 11, 3)))
+                   && !(features.useBabel() && features.isAvailableAtLeastFrom("babel", 2017, 11, 3)
+                       && (fontsRoman() != "default" || fontsSans() != "default" || fontsTypewriter() != "default")
+                       && !features.isRequired("textquotesinglep") && !features.isRequired("textquotedoublep")))
                        os << "\\usepackage{fontspec}\n";
                if (features.mustProvide("unicode-math")
                    && features.isAvailable("unicode-math"))