]> git.lyx.org Git - features.git/commitdiff
rename BufferParams::font_encoding() to ::main_font_encoding()
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 25 Feb 2017 11:49:49 +0000 (12:49 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 25 Feb 2017 11:49:49 +0000 (12:49 +0100)
Because that's what's actually returned.

src/BufferParams.cpp
src/BufferParams.h
src/LaTeXFeatures.cpp
src/Paragraph.cpp
src/insets/InsetQuotes.cpp

index a725068792f2e53205b66ab0e707e6d8014c8b8e..4cbf2279014ae3a00a778d1e625b67b01d811157 100644 (file)
@@ -1646,7 +1646,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
 
        // if we use fontspec or newtxmath, we have to load the AMS packages here
        string const ams = features.loadAMSPackages();
-       bool const ot1 = (font_encoding() == "default" || font_encoding() == "OT1");
+       bool const ot1 = (main_font_encoding() == "default" || main_font_encoding() == "OT1");
        bool const use_newtxmath =
                theLaTeXFonts().getLaTeXFont(from_ascii(fontsMath())).getUsedPackage(
                        ot1, false, false) == "newtxmath";
@@ -1673,7 +1673,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
        // set font encoding
        // XeTeX and LuaTeX (with OS fonts) do not need fontenc
        if (!useNonTeXFonts && !features.isProvided("fontenc")
-           && font_encoding() != "default") {
+           && main_font_encoding() != "default") {
                // get main font encodings
                vector<string> fontencs = font_encodings();
                // get font encodings of secondary languages
@@ -2992,7 +2992,7 @@ string const BufferParams::dvips_options() const
 }
 
 
-string const BufferParams::font_encoding() const
+string const BufferParams::main_font_encoding() const
 {
        return font_encodings().empty() ? "default" : font_encodings().back();
 }
@@ -3228,7 +3228,7 @@ string const BufferParams::loadFonts(LaTeXFeatures & features) const
        }
 
        // Tex Fonts
-       bool const ot1 = (font_encoding() == "default" || font_encoding() == "OT1");
+       bool const ot1 = (main_font_encoding() == "default" || main_font_encoding() == "OT1");
        bool const dryrun = features.runparams().dryrun;
        bool const complete = (fontsSans() == "default" && fontsTypewriter() == "default");
        bool const nomath = (fontsMath() == "default");
index 405a54e7484e2aa1e66ac81faeee7f6ecbdd22cb..200b6d43963633041af86fceed784b6c3098773e 100644 (file)
@@ -411,7 +411,7 @@ public:
        AuthorMap author_map_;
 
        /// the buffer's active font encoding
-       std::string const font_encoding() const;
+       std::string const main_font_encoding() const;
        /// all font encodings requested by the prefs/document/main language.
        /// This does NOT include font encodings required by secondary languages
        std::vector<std::string> const font_encodings() const;
index 3d70a5aa7be5a0c50536a920c2ad674d533c090c..e19e771dd8fd2968a41311fa3d97bbc069dba691 100644 (file)
@@ -591,8 +591,8 @@ bool LaTeXFeatures::isProvided(string const & name) const
        if (params_.useNonTeXFonts)
                return params_.documentClass().provides(name);
 
-       bool const ot1 = (params_.font_encoding() == "default"
-               || params_.font_encoding() == "OT1");
+       bool const ot1 = (params_.main_font_encoding() == "default"
+               || params_.main_font_encoding() == "OT1");
        bool const complete = (params_.fontsSans() == "default"
                && params_.fontsTypewriter() == "default");
        bool const nomath = (params_.fontsMath() == "default");
@@ -1089,7 +1089,8 @@ string const LaTeXFeatures::getPackages() const
        // if fontspec or newtxmath is used, AMS packages have to be loaded
        // before fontspec (in BufferParams)
        string const amsPackages = loadAMSPackages();
-       bool const ot1 = (params_.font_encoding() == "default" || params_.font_encoding() == "OT1");
+       bool const ot1 = (params_.main_font_encoding() == "default"
+                         || params_.main_font_encoding() == "OT1");
        bool const use_newtxmath =
                theLaTeXFonts().getLaTeXFont(from_ascii(params_.fontsMath())).getUsedPackage(
                        ot1, false, false) == "newtxmath";
@@ -1318,14 +1319,14 @@ TexString LaTeXFeatures::getMacros() const
 
        if (!usePolyglossia() && mustProvide("textgreek")) {
            // ensure LGR font encoding is defined also if fontenc is not loaded by LyX
-               if (params_.font_encoding() == "default")
+               if (params_.main_font_encoding() == "default")
                        macros << textgreek_LGR_def;
                macros << textgreek_def << '\n';
        }
 
        if (!usePolyglossia() && mustProvide("textcyr")) {
                // ensure T2A font encoding is set up also if fontenc is not loaded by LyX
-               if (params_.font_encoding() == "default")
+               if (params_.main_font_encoding() == "default")
                        macros << textcyr_T2A_def;
                macros << textcyr_def << '\n';
        }
index c06799a23f6a726676bb023ebadbfd183b822c9e..eb5b1114b411c5636a1d74279ab2309d864aea32 100644 (file)
@@ -1194,7 +1194,7 @@ void Paragraph::Private::latexSpecialChar(otexstream & os,
        //       non-standard font encoding. If we are using such a language,
        //       we do not output special T1 chars.
        if (!runparams.inIPA && !running_font.language()->internalFontEncoding()
-           && !runparams.isFullUnicode() && bparams.font_encoding() == "T1"
+           && !runparams.isFullUnicode() && bparams.main_font_encoding() == "T1"
            && latexSpecialT1(c, os, i, column))
                return;
        // NOTE: XeTeX and LuaTeX use EU1/2 (pre 2017) or TU (as of 2017) encoding
index 06ef469729c81ff1f43776c95a5438e87c7c3407..88f39790073ae4e0c2c596fe6c8cdd5db56c7cf1 100644 (file)
@@ -628,7 +628,7 @@ InsetQuotes::InsetQuotes(Buffer * buf, char_type c, InsetQuotesParams::QuoteLeve
        bool dynamic = false;
        if (buf) {
                global_style_ = buf->masterBuffer()->params().quotes_style;
-               fontenc_ = buf->masterBuffer()->params().font_encoding();
+               fontenc_ = buf->masterBuffer()->params().main_font_encoding();
                dynamic = buf->masterBuffer()->params().dynamic_quotes;
                fontspec_ = buf->masterBuffer()->params().useNonTeXFonts;
        } else {
@@ -979,7 +979,7 @@ void InsetQuotes::updateBuffer(ParIterator const & it, UpdateType /* utype*/)
        BufferParams const & bp = buffer().masterBuffer()->params();
        pass_thru_ = it.paragraph().isPassThru();
        context_lang_ = it.paragraph().getFontSettings(bp, it.pos()).language()->code();
-       fontenc_ = bp.font_encoding();
+       fontenc_ = bp.main_font_encoding();
        global_style_ = bp.quotes_style;
        fontspec_ = bp.useNonTeXFonts;
 }