On 2015-12-20, Guenter Milde wrote: > On 2015-12-19, Jürgen Spitzmüller wrote: >> Am Mittwoch 16 Dezember 2015, 20:35:27 schrieb Guenter Milde: >>> This should be the same for any export using Unicode fonts, however a look >>> in the source pane shows, that with DVI (LuaTeX), the export still uses >>> Babel, not Polyglossia.
>> Probably an oversight. I agree that polyglossia should be preferred now for >> all LuaTeX ouput (with fontspec). > This means we only have to check for "useNonTeXFonts" > (polyglossia is already used for all XeTeX output). The following patch will auto-select polyglossia with fontspec whenever possible. OK to commit? Günter >From 36882805113be44151cd19358008adf3f53e6fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Milde?= <mi...@lyx.org> Date: Sat, 2 Jan 2016 22:05:41 +0100 Subject: [PATCH] Use polyglossia also with DVI (LuaTeX). Simplify the logic for language package selection and make it more consistent: Use polyglossia with non-TeX fonts (system fonts/Unicode fonts) for all export flavours (XeTeX, LuaTeX, DVI-LuaTeX), if the language package setting is "auto" and there is no language not supported by Babel and no package providing Babel. --- src/BufferParams.cpp | 7 ++----- src/LaTeXFeatures.cpp | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index e3121c7..fe47c05 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -1399,11 +1399,8 @@ void BufferParams::validate(LaTeXFeatures & features) const } // some languages are only available via polyglossia - if ((features.runparams().flavor == OutputParams::XETEX - || features.runparams().flavor == OutputParams::LUATEX) - && (features.hasPolyglossiaExclusiveLanguages() - || useNonTeXFonts)) - features.require("polyglossia"); + if (features.hasPolyglossiaExclusiveLanguages()) + features.require("polyglossia"); if (useNonTeXFonts && fontsMath() != "auto") features.require("unicode-math"); diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index feab837..a69fd59 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -382,14 +382,14 @@ LaTeXFeatures::LangPackage LaTeXFeatures::langPackage() const if (local_lp == "none") return LANG_PACK_NONE; - /* If "auto" is selected, we load polyglossia if required, + /* If "auto" is selected, we load polyglossia with non-TeX fonts, * else we select babel. * If babel is selected (either directly or via the "auto" * mechanism), we really do only require it if we have * a language that needs it. */ bool const polyglossia_required = - isRequired("polyglossia") + params_.useNonTeXFonts && isAvailable("polyglossia") && !isProvided("babel") && this->hasOnlyPolyglossiaLanguages(); -- 2.5.1