]> git.lyx.org Git - features.git/commitdiff
Store both sets of font selections
authorGeorg Baum <baum@lyx.org>
Mon, 9 Nov 2015 06:33:57 +0000 (07:33 +0100)
committerGeorg Baum <baum@lyx.org>
Mon, 9 Nov 2015 06:36:42 +0000 (07:36 +0100)
This is one part of bug 9744: If you toggle between TeX fonts and non-TeX
fonts, the settings of the other choice are no longer thrown away, but stored
and re-activated if you switch back. Most parts of the patch are purely
mechanical (duplicating some BufferParams members), the only non-mechanical
change is in the GUI logic.

27 files changed:
development/FORMAT
lib/lyx2lyx/LyX.py
lib/lyx2lyx/lyx_2_2.py
src/BufferParams.cpp
src/BufferParams.h
src/LaTeXFeatures.cpp
src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiDocument.h
src/tex2lyx/Preamble.cpp
src/tex2lyx/Preamble.h
src/tex2lyx/test/CJK.lyx.lyx
src/tex2lyx/test/CJKutf8.lyx.lyx
src/tex2lyx/test/DummyDocument.lyx.lyx
src/tex2lyx/test/Dummy~Document.lyx.lyx
src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
src/tex2lyx/test/algo2e.lyx.lyx
src/tex2lyx/test/box-color-size-space-align.lyx.lyx
src/tex2lyx/test/test-insets-basic.lyx.lyx
src/tex2lyx/test/test-insets.lyx.lyx
src/tex2lyx/test/test-memoir.lyx.lyx
src/tex2lyx/test/test-modules.lyx.lyx
src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
src/tex2lyx/test/test-scr.lyx.lyx
src/tex2lyx/test/test-structure.lyx.lyx
src/tex2lyx/test/test.lyx.lyx
src/tex2lyx/test/verbatim.lyx.lyx
src/version.h

index 7ec9be71bffacb7b721d937de53ad3ac0fa64d0c..53f9c03cb51cb74b4e77630878a1f3f5e725b533 100644 (file)
@@ -11,6 +11,15 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx.
 
 -----------------------
 
+2015-11-08 Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+       * Format incremented to 501
+         \fonts_roman, \fonts_sans, \fonts_typewriter and \fonts_math,
+         take now two quoted values instead of one unquoted one.
+         The first one is for TeX fonts, the second one for non-TeX fonts.
+         \font_sf_scale and \font_tt_scale
+         take now two values instead of one.
+         The first one is for TeX fonts, the second one for non-TeX fonts.
+
 2015-11-04 Uwe Stöhr <uwestoehr@web.de>
        * Format incremented to 500
          No new parameters.
index ad13afe224ce9bda6e03e8b1de70d987e07e17fe..a40ef1640a0571aadf88122a4f1e192424dea756 100644 (file)
@@ -85,7 +85,7 @@ format_relation = [("0_06",    [200], minor_versions("0.6" , 4)),
                    ("1_6", list(range(277,346)), minor_versions("1.6" , 10)),
                    ("2_0", list(range(346,414)), minor_versions("2.0" , 8)),
                    ("2_1", list(range(414,475)), minor_versions("2.1" , 0)),
-                   ("2_2", list(range(475,501)), minor_versions("2.2" , 0))
+                   ("2_2", list(range(475,502)), minor_versions("2.2" , 0))
                   ]
 
 ####################################################################
index ccc4b4455bed0ca28dc5dad4c9c447d97a562033..6bed08e801d10643f38154e6b0b5838b78a8f4d8 100644 (file)
@@ -2019,6 +2019,79 @@ def revert_achemso(document):
     i += 1
 
 
+fontsettings = ["\\font_roman", "\\font_sans", "\\font_typewriter", "\\font_math", \
+                "\\font_sf_scale", "\\font_tt_scale"]
+fontdefaults = ["default", "default", "default", "auto", "100", "100"]
+fontquotes = [True, True, True, True, False, False]
+
+def convert_fontsettings(document):
+    " Duplicate font settings "
+
+    i = find_token(document.header, "\\use_non_tex_fonts ", 0)
+    if i == -1:
+        document.warning("Malformed LyX document: No \\use_non_tex_fonts!")
+        use_non_tex_fonts = "false"
+    else:
+        use_non_tex_fonts = get_value(document.header, "\\use_non_tex_fonts", i)
+    j = 0
+    for f in fontsettings:
+        i = find_token(document.header, f + " ", 0)
+        if i == -1:
+            document.warning("Malformed LyX document: No " + f + "!")
+            j = j + 1
+            continue
+        value = document.header[i][len(f):].strip()
+        if fontquotes[j]:
+            if use_non_tex_fonts == "true":
+                document.header[i:i+1] = [f + ' "' + fontdefaults[j] + '" "' + value + '"']
+            else:
+                document.header[i:i+1] = [f + ' "' + value + '" "' + fontdefaults[j] + '"']
+        else:
+            if use_non_tex_fonts == "true":
+                document.header[i:i+1] = [f + ' ' + fontdefaults[j] + ' ' + value]
+            else:
+                document.header[i:i+1] = [f + ' ' + value + ' ' + fontdefaults[j]]
+        j = j + 1
+
+
+def revert_fontsettings(document):
+    " Merge font settings "
+
+    i = find_token(document.header, "\\use_non_tex_fonts ", 0)
+    if i == -1:
+        document.warning("Malformed LyX document: No \\use_non_tex_fonts!")
+        use_non_tex_fonts = "false"
+    else:
+        use_non_tex_fonts = get_value(document.header, "\\use_non_tex_fonts", i)
+    j = 0
+    for f in fontsettings:
+        i = find_token(document.header, f + " ", 0)
+        if i == -1:
+            document.warning("Malformed LyX document: No " + f + "!")
+            j = j + 1
+            continue
+        line = get_value(document.header, f, i)
+        if fontquotes[j]:
+            q1 = line.find('"')
+            q2 = line.find('"', q1+1)
+            q3 = line.find('"', q2+1)
+            q4 = line.find('"', q3+1)
+            if q1 == -1 or q2 == -1 or q3 == -1 or q4 == -1:
+                document.warning("Malformed LyX document: Missing quotes!")
+                j = j + 1
+                continue
+            if use_non_tex_fonts == "true":
+                document.header[i:i+1] = [f + ' ' + line[q3+1:q4]]
+            else:
+                document.header[i:i+1] = [f + ' ' + line[q1+1:q2]]
+        else:
+            if use_non_tex_fonts == "true":
+                document.header[i:i+1] = [f + ' ' + line.split()[2]]
+            else:
+                document.header[i:i+1] = [f + ' ' + line.split()[1]]
+        j = j + 1
+
+
 ##
 # Conversion hub
 #
@@ -2053,10 +2126,12 @@ convert = [
            [497, [convert_external_bbox]],
            [498, []],
            [499, [convert_moderncv]],
-           [500, []]
+           [500, []],
+           [501, [convert_fontsettings]]
           ]
 
 revert =  [
+           [500, [revert_fontsettings]],
            [499, [revert_achemso]],
            [498, [revert_moderncv_1, revert_moderncv_2]],
            [497, [revert_tcolorbox_1, revert_tcolorbox_2,
index 37468824a6ffd1522604122a6b173b6cb2cfc56d..a73194d310854746e4e24eb8b092e6ee157f2451 100644 (file)
@@ -377,16 +377,22 @@ BufferParams::BufferParams()
        tocdepth = 3;
        language = default_language;
        fontenc = "global";
-       fonts_roman = "default";
-       fonts_sans = "default";
-       fonts_typewriter = "default";
-       fonts_math = "auto";
+       fonts_roman[0] = "default";
+       fonts_roman[1] = "default";
+       fonts_sans[0] = "default";
+       fonts_sans[1] = "default";
+       fonts_typewriter[0] = "default";
+       fonts_typewriter[1] = "default";
+       fonts_math[0] = "auto";
+       fonts_math[1] = "auto";
        fonts_default_family = "default";
        useNonTeXFonts = false;
        fonts_expert_sc = false;
        fonts_old_figures = false;
-       fonts_sans_scale = 100;
-       fonts_typewriter_scale = 100;
+       fonts_sans_scale[0] = 100;
+       fonts_sans_scale[1] = 100;
+       fonts_typewriter_scale[0] = 100;
+       fonts_typewriter_scale[1] = 100;
        inputenc = "auto";
        lang_package = "default";
        graphics_driver = "default";
@@ -726,17 +732,17 @@ string BufferParams::readToken(Lexer & lex, string const & token,
                lex.eatLine();
                fontenc = lex.getString();
        } else if (token == "\\font_roman") {
-               lex.eatLine();
-               fonts_roman = lex.getString();
+               lex >> fonts_roman[0];
+               lex >> fonts_roman[1];
        } else if (token == "\\font_sans") {
-               lex.eatLine();
-               fonts_sans = lex.getString();
+               lex >> fonts_sans[0];
+               lex >> fonts_sans[1];
        } else if (token == "\\font_typewriter") {
-               lex.eatLine();
-               fonts_typewriter = lex.getString();
+               lex >> fonts_typewriter[0];
+               lex >> fonts_typewriter[1];
        } else if (token == "\\font_math") {
-               lex.eatLine();
-               fonts_math = lex.getString();
+               lex >> fonts_math[0];
+               lex >> fonts_math[1];
        } else if (token == "\\font_default_family") {
                lex >> fonts_default_family;
        } else if (token == "\\use_non_tex_fonts") {
@@ -746,9 +752,11 @@ string BufferParams::readToken(Lexer & lex, string const & token,
        } else if (token == "\\font_osf") {
                lex >> fonts_old_figures;
        } else if (token == "\\font_sf_scale") {
-               lex >> fonts_sans_scale;
+               lex >> fonts_sans_scale[0];
+               lex >> fonts_sans_scale[1];
        } else if (token == "\\font_tt_scale") {
-               lex >> fonts_typewriter_scale;
+               lex >> fonts_typewriter_scale[0];
+               lex >> fonts_typewriter_scale[1];
        } else if (token == "\\font_cjk") {
                lex >> fonts_cjk;
        } else if (token == "\\paragraph_separation") {
@@ -1092,16 +1100,22 @@ void BufferParams::writeFile(ostream & os, Buffer const * buf) const
        os << "\\language_package " << lang_package
           << "\n\\inputencoding " << inputenc
           << "\n\\fontencoding " << fontenc
-          << "\n\\font_roman " << fonts_roman
-          << "\n\\font_sans " << fonts_sans
-          << "\n\\font_typewriter " << fonts_typewriter
-          << "\n\\font_math " << fonts_math
+          << "\n\\font_roman \"" << fonts_roman[0]
+          << "\" \"" << fonts_roman[1] << '"'
+          << "\n\\font_sans \"" << fonts_sans[0]
+          << "\" \"" << fonts_sans[1] << '"'
+          << "\n\\font_typewriter \"" << fonts_typewriter[0]
+          << "\" \"" << fonts_typewriter[1] << '"'
+          << "\n\\font_math " << fonts_math[0]
+          << "\" \"" << fonts_math[1] << '"'
           << "\n\\font_default_family " << fonts_default_family
           << "\n\\use_non_tex_fonts " << convert<string>(useNonTeXFonts)
           << "\n\\font_sc " << convert<string>(fonts_expert_sc)
           << "\n\\font_osf " << convert<string>(fonts_old_figures)
-          << "\n\\font_sf_scale " << fonts_sans_scale
-          << "\n\\font_tt_scale " << fonts_typewriter_scale
+          << "\n\\font_sf_scale " << fonts_sans_scale[0]
+          << ' ' << fonts_sans_scale[1]
+          << "\n\\font_tt_scale " << fonts_typewriter_scale[0]
+          << ' ' << fonts_typewriter_scale[1]
           << '\n';
        if (!fonts_cjk.empty()) {
                os << "\\font_cjk " << fonts_cjk << '\n';
@@ -1373,7 +1387,7 @@ void BufferParams::validate(LaTeXFeatures & features) const
                || useNonTeXFonts))
                features.require("polyglossia");
 
-       if (useNonTeXFonts && fonts_math != "auto")
+       if (useNonTeXFonts && fontsMath() != "auto")
                features.require("unicode-math");
 
        if (!language->requires().empty())
@@ -1540,7 +1554,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
        string const ams = features.loadAMSPackages();
        bool const ot1 = (font_encoding() == "default" || font_encoding() == "OT1");
        bool const use_newtxmath =
-               theLaTeXFonts().getLaTeXFont(from_ascii(fonts_math)).getUsedPackage(
+               theLaTeXFonts().getLaTeXFont(from_ascii(fontsMath())).getUsedPackage(
                        ot1, false, false) == "newtxmath";
        if ((useNonTeXFonts || use_newtxmath) && !ams.empty())
                os << from_ascii(ams);
@@ -3033,9 +3047,9 @@ string const BufferParams::parseFontName(string const & name) const
 
 string const BufferParams::loadFonts(LaTeXFeatures & features) const
 {
-       if (fonts_roman == "default" && fonts_sans == "default"
-           && fonts_typewriter == "default"
-           && (fonts_math == "default" || fonts_math == "auto"))
+       if (fontsRoman() == "default" && fontsSans() == "default"
+           && fontsTypewriter() == "default"
+           && (fontsMath() == "default" || fontsMath() == "auto"))
                //nothing to do
                return string();
 
@@ -3064,28 +3078,28 @@ string const BufferParams::loadFonts(LaTeXFeatures & features) const
                string const texmapping =
                        (features.runparams().flavor == OutputParams::XETEX) ?
                        "Mapping=tex-text" : "Ligatures=TeX";
-               if (fonts_roman != "default") {
+               if (fontsRoman() != "default") {
                        os << "\\setmainfont[" << texmapping;
                        if (fonts_old_figures)
                                os << ",Numbers=OldStyle";
-                       os << "]{" << parseFontName(fonts_roman) << "}\n";
+                       os << "]{" << parseFontName(fontsRoman()) << "}\n";
                }
-               if (fonts_sans != "default") {
-                       string const sans = parseFontName(fonts_sans);
-                       if (fonts_sans_scale != 100)
+               if (fontsSans() != "default") {
+                       string const sans = parseFontName(fontsSans());
+                       if (fontsSansScale() != 100)
                                os << "\\setsansfont[Scale="
-                                  << float(fonts_sans_scale) / 100
+                                  << float(fontsSansScale()) / 100
                                   << "," << texmapping << "]{"
                                   << sans << "}\n";
                        else
                                os << "\\setsansfont[" << texmapping << "]{"
                                   << sans << "}\n";
                }
-               if (fonts_typewriter != "default") {
-                       string const mono = parseFontName(fonts_typewriter);
-                       if (fonts_typewriter_scale != 100)
+               if (fontsTypewriter() != "default") {
+                       string const mono = parseFontName(fontsTypewriter());
+                       if (fontsTypewriterScale() != 100)
                                os << "\\setmonofont[Scale="
-                                  << float(fonts_typewriter_scale) / 100
+                                  << float(fontsTypewriterScale()) / 100
                                   << "]{"
                                   << mono << "}\n";
                        else
@@ -3098,26 +3112,26 @@ string const BufferParams::loadFonts(LaTeXFeatures & features) const
        // Tex Fonts
        bool const ot1 = (font_encoding() == "default" || font_encoding() == "OT1");
        bool const dryrun = features.runparams().dryrun;
-       bool const complete = (fonts_sans == "default" && fonts_typewriter == "default");
-       bool const nomath = (fonts_math == "default");
+       bool const complete = (fontsSans() == "default" && fontsTypewriter() == "default");
+       bool const nomath = (fontsMath() == "default");
 
        // ROMAN FONTS
-       os << theLaTeXFonts().getLaTeXFont(from_ascii(fonts_roman)).getLaTeXCode(
+       os << theLaTeXFonts().getLaTeXFont(from_ascii(fontsRoman())).getLaTeXCode(
                dryrun, ot1, complete, fonts_expert_sc, fonts_old_figures,
                nomath);
 
        // SANS SERIF
-       os << theLaTeXFonts().getLaTeXFont(from_ascii(fonts_sans)).getLaTeXCode(
+       os << theLaTeXFonts().getLaTeXFont(from_ascii(fontsSans())).getLaTeXCode(
                dryrun, ot1, complete, fonts_expert_sc, fonts_old_figures,
-               nomath, fonts_sans_scale);
+               nomath, fontsSansScale());
 
        // MONOSPACED/TYPEWRITER
-       os << theLaTeXFonts().getLaTeXFont(from_ascii(fonts_typewriter)).getLaTeXCode(
+       os << theLaTeXFonts().getLaTeXFont(from_ascii(fontsTypewriter())).getLaTeXCode(
                dryrun, ot1, complete, fonts_expert_sc, fonts_old_figures,
-               nomath, fonts_typewriter_scale);
+               nomath, fontsTypewriterScale());
 
        // MATH
-       os << theLaTeXFonts().getLaTeXFont(from_ascii(fonts_math)).getLaTeXCode(
+       os << theLaTeXFonts().getLaTeXFont(from_ascii(fontsMath())).getLaTeXCode(
                dryrun, ot1, complete, fonts_expert_sc, fonts_old_figures,
                nomath);
 
index ba3d510be01afc6dd0f94d51d69ef8f324a57d8b..6b2bb47b899a05bfa0c44a07c23da6ed93614869 100644 (file)
@@ -245,14 +245,22 @@ public:
        std::string index_command;
        /// font encoding(s) requested for this document
        std::string fontenc;
+       /// the rm font: [0] for TeX fonts, [1] for non-TeX fonts
+       std::string fonts_roman[2];
        /// the rm font
-       std::string fonts_roman;
+       std::string const & fontsRoman() const { return fonts_roman[useNonTeXFonts]; }
+       /// the sf font: [0] for TeX fonts, [1] for non-TeX fonts
+       std::string fonts_sans[2];
        /// the sf font
-       std::string fonts_sans;
+       std::string const & fontsSans() const { return fonts_sans[useNonTeXFonts]; }
+       /// the tt font: [0] for TeX fonts, [1] for non-TeX fonts
+       std::string fonts_typewriter[2];
        /// the tt font
-       std::string fonts_typewriter;
+       std::string const & fontsTypewriter() const { return fonts_typewriter[useNonTeXFonts]; }
+       /// the math font: [0] for TeX fonts, [1] for non-TeX fonts
+       std::string fonts_math[2];
        /// the math font
-       std::string fonts_math;
+       std::string const & fontsMath() const { return fonts_math[useNonTeXFonts]; }
        /// the default family (rm, sf, tt)
        std::string fonts_default_family;
        /// use the fonts of the OS (OpenType, True Type) directly
@@ -261,10 +269,14 @@ public:
        bool fonts_expert_sc;
        /// use Old Style Figures
        bool fonts_old_figures;
+       /// the scale factor of the sf font: [0] for TeX fonts, [1] for non-TeX fonts
+       int fonts_sans_scale[2];
        /// the scale factor of the sf font
-       int fonts_sans_scale;
+       int fontsSansScale() const { return fonts_sans_scale[useNonTeXFonts]; }
+       /// the scale factor of the tt font: [0] for TeX fonts, [1] for non-TeX fonts
+       int fonts_typewriter_scale[2];
        /// the scale factor of the tt font
-       int fonts_typewriter_scale;
+       int fontsTypewriterScale() const { return fonts_typewriter_scale[useNonTeXFonts]; }
        /// the font used by the CJK command
        std::string fonts_cjk;
        ///
index fb8fb6085a92d8caeee3401337993de4fcbab2fe..5405ce0faf53b14b43464d3cf473f6fbab3d87e5 100644 (file)
@@ -516,24 +516,24 @@ bool LaTeXFeatures::isProvided(string const & name) const
 
        bool const ot1 = (params_.font_encoding() == "default"
                || params_.font_encoding() == "OT1");
-       bool const complete = (params_.fonts_sans == "default")
-               && (params_.fonts_typewriter == "default");
-       bool const nomath = (params_.fonts_math == "default");
+       bool const complete = (params_.fontsSans() == "default"
+               && params_.fontsTypewriter() == "default");
+       bool const nomath = (params_.fontsMath() == "default");
        return params_.documentClass().provides(name)
                || theLaTeXFonts().getLaTeXFont(
-                       from_ascii(params_.fonts_roman)).provides(name, ot1,
+                       from_ascii(params_.fontsRoman())).provides(name, ot1,
                                                                  complete,
                                                                  nomath)
                || theLaTeXFonts().getLaTeXFont(
-                       from_ascii(params_.fonts_sans)).provides(name, ot1,
+                       from_ascii(params_.fontsSans())).provides(name, ot1,
                                                                 complete,
                                                                 nomath)
                || theLaTeXFonts().getLaTeXFont(
-                       from_ascii(params_.fonts_typewriter)).provides(name, ot1,
+                       from_ascii(params_.fontsTypewriter())).provides(name, ot1,
                                                                       complete,
                                                                       nomath)
                || theLaTeXFonts().getLaTeXFont(
-                       from_ascii(params_.fonts_math)).provides(name, ot1,
+                       from_ascii(params_.fontsMath())).provides(name, ot1,
                                                                       complete,
                                                                       nomath);
        // TODO: "textbaltic" provided, if the font-encoding is "L7x"
@@ -934,7 +934,7 @@ string const LaTeXFeatures::getPackages() const
        string const amsPackages = loadAMSPackages();
        bool const ot1 = (params_.font_encoding() == "default" || params_.font_encoding() == "OT1");
        bool const use_newtxmath =
-               theLaTeXFonts().getLaTeXFont(from_ascii(params_.fonts_math)).getUsedPackage(
+               theLaTeXFonts().getLaTeXFont(from_ascii(params_.fontsMath())).getUsedPackage(
                        ot1, false, false) == "newtxmath";
 
        if (!params_.useNonTeXFonts && !use_newtxmath && !amsPackages.empty())
index a4aa71f13ab83847247a0fed25fea6975520228a..cf64849ef5975349f4516b93ce46cbe9f8591701 100644 (file)
@@ -774,7 +774,7 @@ GuiDocument::GuiDocument(GuiView & lv)
                outputModule->synccustomCB));
 
        // fonts
-       fontModule = new UiWidget<Ui::FontUi>;
+       fontModule = new FontModule;
        connect(fontModule->osFontsCB, SIGNAL(clicked()),
                this, SLOT(change_adaptor()));
        connect(fontModule->osFontsCB, SIGNAL(toggled(bool)),
@@ -1775,6 +1775,18 @@ void GuiDocument::languageChanged(int i)
 void GuiDocument::osFontsChanged(bool nontexfonts)
 {
        bool const tex_fonts = !nontexfonts;
+       // store current fonts
+       QString const font_roman = fontModule->fontsRomanCO->itemData(
+                       fontModule->fontsRomanCO->currentIndex()).toString();
+       QString const font_sans = fontModule->fontsSansCO->itemData(
+                       fontModule->fontsSansCO->currentIndex()).toString();
+       QString const font_typewriter = fontModule->fontsTypewriterCO->itemData(
+                       fontModule->fontsTypewriterCO->currentIndex()).toString();
+       QString const font_math = fontModule->fontsMathCO->itemData(
+                       fontModule->fontsMathCO->currentIndex()).toString();
+       int const font_sf_scale = fontModule->scaleSansSB->value();
+       int const font_tt_scale = fontModule->scaleTypewriterSB->value();
+
        updateFontlist();
        // store default format
        QString const dformat = outputModule->defaultFormatCO->itemData(
@@ -1786,6 +1798,28 @@ void GuiDocument::osFontsChanged(bool nontexfonts)
        if (index == -1)
                index = 0;
        outputModule->defaultFormatCO->setCurrentIndex(index);
+
+       // try to restore fonts which were selected two toggles ago
+       index = fontModule->fontsRomanCO->findData(fontModule->font_roman);
+       if (index != -1)
+               fontModule->fontsRomanCO->setCurrentIndex(index);
+       index = fontModule->fontsSansCO->findData(fontModule->font_sans);
+       if (index != -1)
+               fontModule->fontsSansCO->setCurrentIndex(index);
+       index = fontModule->fontsTypewriterCO->findData(fontModule->font_typewriter);
+       if (index != -1)
+               fontModule->fontsTypewriterCO->setCurrentIndex(index);
+       index = fontModule->fontsMathCO->findData(fontModule->font_math);
+       if (index != -1)
+               fontModule->fontsMathCO->setCurrentIndex(index);
+       // save fonts for next next toggle
+       fontModule->font_roman = font_roman;
+       fontModule->font_sans = font_sans;
+       fontModule->font_typewriter = font_typewriter;
+       fontModule->font_math = font_math;
+       fontModule->font_sf_scale = font_sf_scale;
+       fontModule->font_tt_scale = font_tt_scale;
+
        langModule->encodingCO->setEnabled(tex_fonts &&
                !langModule->defaultencodingRB->isChecked());
        langModule->defaultencodingRB->setEnabled(tex_fonts);
@@ -2823,21 +2857,25 @@ void GuiDocument::applyView()
        bp_.display_pixel_ratio = theGuiApp()->pixelRatio();
 
        // fonts
-       bp_.fonts_roman =
+       bp_.fonts_roman[nontexfonts] =
                fromqstr(fontModule->fontsRomanCO->
                        itemData(fontModule->fontsRomanCO->currentIndex()).toString());
+       bp_.fonts_roman[!nontexfonts] = fromqstr(fontModule->font_roman);
 
-       bp_.fonts_sans =
+       bp_.fonts_sans[nontexfonts] =
                fromqstr(fontModule->fontsSansCO->
                        itemData(fontModule->fontsSansCO->currentIndex()).toString());
+       bp_.fonts_sans[!nontexfonts] = fromqstr(fontModule->font_sans);
 
-       bp_.fonts_typewriter =
+       bp_.fonts_typewriter[nontexfonts] =
                fromqstr(fontModule->fontsTypewriterCO->
                        itemData(fontModule->fontsTypewriterCO->currentIndex()).toString());
+       bp_.fonts_typewriter[!nontexfonts] = fromqstr(fontModule->font_typewriter);
 
-       bp_.fonts_math =
+       bp_.fonts_math[nontexfonts] =
                fromqstr(fontModule->fontsMathCO->
                        itemData(fontModule->fontsMathCO->currentIndex()).toString());
+       bp_.fonts_math[!nontexfonts] = fromqstr(fontModule->font_math);
 
        QString const fontenc =
                fontModule->fontencCO->itemData(fontModule->fontencCO->currentIndex()).toString();
@@ -2849,9 +2887,11 @@ void GuiDocument::applyView()
        bp_.fonts_cjk =
                fromqstr(fontModule->cjkFontLE->text());
 
-       bp_.fonts_sans_scale = fontModule->scaleSansSB->value();
+       bp_.fonts_sans_scale[nontexfonts] = fontModule->scaleSansSB->value();
+       bp_.fonts_sans_scale[!nontexfonts] = fontModule->font_sf_scale;
 
-       bp_.fonts_typewriter_scale = fontModule->scaleTypewriterSB->value();
+       bp_.fonts_typewriter_scale[nontexfonts] = fontModule->scaleTypewriterSB->value();
+       bp_.fonts_typewriter_scale[!nontexfonts] = fontModule->font_tt_scale;
 
        bp_.fonts_expert_sc = fontModule->fontScCB->isChecked();
 
@@ -3269,37 +3309,41 @@ void GuiDocument::paramsToDialog()
        updateFontsize(documentClass().opt_fontsize(),
                        bp_.fontsize);
 
-       QString font = toqstr(bp_.fonts_roman);
+       QString font = toqstr(bp_.fontsRoman());
        int rpos = fontModule->fontsRomanCO->findData(font);
        if (rpos == -1) {
                rpos = fontModule->fontsRomanCO->count();
                fontModule->fontsRomanCO->addItem(font + qt_(" (not installed)"), font);
        }
        fontModule->fontsRomanCO->setCurrentIndex(rpos);
+       fontModule->font_roman = toqstr(bp_.fonts_roman[!bp_.useNonTeXFonts]);
 
-       font = toqstr(bp_.fonts_sans);
+       font = toqstr(bp_.fontsSans());
        int spos = fontModule->fontsSansCO->findData(font);
        if (spos == -1) {
                spos = fontModule->fontsSansCO->count();
                fontModule->fontsSansCO->addItem(font + qt_(" (not installed)"), font);
        }
        fontModule->fontsSansCO->setCurrentIndex(spos);
+       fontModule->font_sans = toqstr(bp_.fonts_sans[!bp_.useNonTeXFonts]);
 
-       font = toqstr(bp_.fonts_typewriter);
+       font = toqstr(bp_.fontsTypewriter());
        int tpos = fontModule->fontsTypewriterCO->findData(font);
        if (tpos == -1) {
                tpos = fontModule->fontsTypewriterCO->count();
                fontModule->fontsTypewriterCO->addItem(font + qt_(" (not installed)"), font);
        }
        fontModule->fontsTypewriterCO->setCurrentIndex(tpos);
+       fontModule->font_typewriter = toqstr(bp_.fonts_typewriter[!bp_.useNonTeXFonts]);
 
-       font = toqstr(bp_.fonts_math);
+       font = toqstr(bp_.fontsMath());
        int mpos = fontModule->fontsMathCO->findData(font);
        if (mpos == -1) {
                mpos = fontModule->fontsMathCO->count();
                fontModule->fontsMathCO->addItem(font + qt_(" (not installed)"), font);
        }
        fontModule->fontsMathCO->setCurrentIndex(mpos);
+       fontModule->font_math = toqstr(bp_.fonts_math[!bp_.useNonTeXFonts]);
 
        if (bp_.useNonTeXFonts && os_fonts_available) {
                fontModule->fontencLA->setEnabled(false);
@@ -3322,8 +3366,10 @@ void GuiDocument::paramsToDialog()
 
        fontModule->fontScCB->setChecked(bp_.fonts_expert_sc);
        fontModule->fontOsfCB->setChecked(bp_.fonts_old_figures);
-       fontModule->scaleSansSB->setValue(bp_.fonts_sans_scale);
-       fontModule->scaleTypewriterSB->setValue(bp_.fonts_typewriter_scale);
+       fontModule->scaleSansSB->setValue(bp_.fontsSansScale());
+       fontModule->font_sf_scale = bp_.fonts_sans_scale[!bp_.useNonTeXFonts];
+       fontModule->scaleTypewriterSB->setValue(bp_.fontsTypewriterScale());
+       fontModule->font_tt_scale = bp_.fonts_typewriter_scale[!bp_.useNonTeXFonts];
 
        int nn = findToken(GuiDocument::fontfamilies, bp_.fonts_default_family);
        if (nn >= 0)
index c35aec3323f645ee309ea5def04c88103fc77a40..5bf1340fc935fc049b7af43c225ae59413b98bbc 100644 (file)
@@ -51,6 +51,7 @@ class GuiIndices;
 class ModuleSelectionManager;
 class PreambleModule;
 class LocalLayout;
+class FontModule;
 
 ///
 typedef void const * BufferId;
@@ -134,7 +135,7 @@ private:
 
        UiWidget<Ui::TextLayoutUi> *textLayoutModule;
        UiWidget<Ui::MasterChildUi> *masterChildModule;
-       UiWidget<Ui::FontUi> *fontModule;
+       FontModule *fontModule;
        UiWidget<Ui::PageLayoutUi> *pageLayoutModule;
        UiWidget<Ui::MarginsUi> *marginsModule;
        UiWidget<Ui::LanguageUi> *langModule;
@@ -329,6 +330,25 @@ private:
 };
 
 
+class FontModule : public UiWidget<Ui::FontUi>
+{
+       Q_OBJECT
+public:
+       /// The roman font currently not selected by osFontsCB->isChecked()
+       QString font_roman;
+       /// The sans font currently not selected by osFontsCB->isChecked()
+       QString font_sans;
+       /// The typewriter font currently not selected by osFontsCB->isChecked()
+       QString font_typewriter;
+       /// The math font currently not selected by osFontsCB->isChecked()
+       QString font_math;
+       /// The sans font scale currently not selected by osFontsCB->isChecked()
+       int font_sf_scale;
+       /// The typewriter font scale currently not selected by osFontsCB->isChecked()
+       int font_tt_scale;
+};
+
+
 } // namespace frontend
 } // namespace lyx
 
index 4809a4ad0daef8dbd2545583a1077a77ff382dec..01587cc02dfbbe0995cde64168ed7cca9e472129 100644 (file)
@@ -473,16 +473,22 @@ Preamble::Preamble() : one_language(true), explicit_babel(false),
        //h_float_placement;
        //h_fontcolor;
        h_fontencoding            = "default";
-       h_font_roman              = "default";
-       h_font_sans               = "default";
-       h_font_typewriter         = "default";
-       h_font_math               = "auto";
+       h_font_roman[0]           = "default";
+       h_font_roman[1]           = "default";
+       h_font_sans[0]            = "default";
+       h_font_sans[1]            = "default";
+       h_font_typewriter[0]      = "default";
+       h_font_typewriter[1]      = "default";
+       h_font_math[0]            = "auto";
+       h_font_math[1]            = "auto";
        h_font_default_family     = "default";
        h_use_non_tex_fonts       = false;
        h_font_sc                 = "false";
        h_font_osf                = "false";
-       h_font_sf_scale           = "100";
-       h_font_tt_scale           = "100";
+       h_font_sf_scale[0]        = "100";
+       h_font_sf_scale[1]        = "100";
+       h_font_tt_scale[0]        = "100";
+       h_font_tt_scale[1]        = "100";
        //h_font_cjk
        h_graphics                = "default";
        h_default_output_format   = "default";
@@ -684,25 +690,25 @@ void Preamble::handle_package(Parser &p, string const & name,
 
        // roman fonts
        if (is_known(name, known_roman_fonts))
-               h_font_roman = name;
+               h_font_roman[0] = name;
 
        if (name == "fourier") {
-               h_font_roman = "utopia";
+               h_font_roman[0] = "utopia";
                // when font uses real small capitals
                if (opts == "expert")
                        h_font_sc = "true";
        }
 
        if (name == "garamondx") {
-               h_font_roman = "garamondx";
+               h_font_roman[0] = "garamondx";
                if (opts == "osfI")
                        h_font_osf = "true";
        }
 
        if (name == "libertine") {
-               h_font_roman = "libertine";
+               h_font_roman[0] = "libertine";
                // this automatically invokes biolinum
-               h_font_sans = "biolinum";
+               h_font_sans[0] = "biolinum";
                if (opts == "osf")
                        h_font_osf = "true";
                else if (opts == "lining")
@@ -710,7 +716,7 @@ void Preamble::handle_package(Parser &p, string const & name,
        }
 
        if (name == "libertine-type1") {
-               h_font_roman = "libertine";
+               h_font_roman[0] = "libertine";
                // NOTE: contrary to libertine.sty, libertine-type1
                // does not automatically invoke biolinum
                if (opts == "lining")
@@ -721,11 +727,11 @@ void Preamble::handle_package(Parser &p, string const & name,
 
        if (name == "mathdesign") {
                if (opts.find("charter") != string::npos)
-                       h_font_roman = "md-charter";
+                       h_font_roman[0] = "md-charter";
                if (opts.find("garamond") != string::npos)
-                       h_font_roman = "md-garamond";
+                       h_font_roman[0] = "md-garamond";
                if (opts.find("utopia") != string::npos)
-                       h_font_roman = "md-utopia";
+                       h_font_roman[0] = "md-utopia";
                if (opts.find("expert") != string::npos) {
                        h_font_sc = "true";
                        h_font_osf = "true";
@@ -733,22 +739,22 @@ void Preamble::handle_package(Parser &p, string const & name,
        }
 
        else if (name == "mathpazo")
-               h_font_roman = "palatino";
+               h_font_roman[0] = "palatino";
 
        else if (name == "mathptmx")
-               h_font_roman = "times";
+               h_font_roman[0] = "times";
 
        // sansserif fonts
        if (is_known(name, known_sans_fonts)) {
-               h_font_sans = name;
+               h_font_sans[0] = name;
                if (options.size() >= 1) {
-                       if (scale_as_percentage(opts, h_font_sf_scale))
+                       if (scale_as_percentage(opts, h_font_sf_scale[0]))
                                options.clear();
                }
        }
 
        if (name == "biolinum-type1") {
-               h_font_sans = "biolinum";
+               h_font_sans[0] = "biolinum";
                // biolinum can have several options, e.g. [osf,scaled=0.97]
                string::size_type pos = opts.find("osf");
                if (pos != string::npos)
@@ -760,16 +766,16 @@ void Preamble::handle_package(Parser &p, string const & name,
                // fourier can be set as roman font _only_
                // fourier as typewriter is handled in handling of \ttdefault
                if (name != "fourier") {
-                       h_font_typewriter = name;
+                       h_font_typewriter[0] = name;
                        if (options.size() >= 1) {
-                               if (scale_as_percentage(opts, h_font_tt_scale))
+                               if (scale_as_percentage(opts, h_font_tt_scale[0]))
                                        options.clear();
                        }
                }
        }
 
        if (name == "libertineMono-type1") {
-               h_font_typewriter = "libertine-mono";
+               h_font_typewriter[0] = "libertine-mono";
        }
 
        // font uses old-style figure
@@ -778,26 +784,26 @@ void Preamble::handle_package(Parser &p, string const & name,
 
        // math fonts
        if (is_known(name, known_math_fonts))
-               h_font_math = name;
+               h_font_math[0] = name;
 
        if (name == "newtxmath") {
                if (opts.empty())
-                       h_font_math = "newtxmath";
+                       h_font_math[0] = "newtxmath";
                else if (opts == "garamondx")
-                       h_font_math = "garamondx-ntxm";
+                       h_font_math[0] = "garamondx-ntxm";
                else if (opts == "libertine")
-                       h_font_math = "libertine-ntxm";
+                       h_font_math[0] = "libertine-ntxm";
                else if (opts == "minion")
-                       h_font_math = "minion-ntxm";
+                       h_font_math[0] = "minion-ntxm";
        }
 
        if (name == "iwona")
                if (opts == "math")
-                       h_font_math = "iwona-math";
+                       h_font_math[0] = "iwona-math";
 
        if (name == "kurier")
                if (opts == "math")
-                       h_font_math = "kurier-math";
+                       h_font_math[0] = "kurier-math";
 
        // after the detection and handling of special cases, we can remove the
        // fonts, otherwise they would appear in the preamble, see bug #7856
@@ -1138,16 +1144,20 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc, string const & outfiled
           << "\\language_package " << h_language_package << "\n"
           << "\\inputencoding " << h_inputencoding << "\n"
           << "\\fontencoding " << h_fontencoding << "\n"
-          << "\\font_roman " << h_font_roman << "\n"
-          << "\\font_sans " << h_font_sans << "\n"
-          << "\\font_typewriter " << h_font_typewriter << "\n"
-          << "\\font_math " << h_font_math << "\n"
+          << "\\font_roman \"" << h_font_roman[0]
+          << "\" \"" << h_font_roman[1] << "\"\n"
+          << "\\font_sans \"" << h_font_sans[0] << "\" \"" << h_font_sans[1] << "\"\n"
+          << "\\font_typewriter \"" << h_font_typewriter[0]
+          << "\" \"" << h_font_typewriter[1] << "\"\n"
+          << "\\font_math \"" << h_font_math[0] << "\" \"" << h_font_math[1] << "\"\n"
           << "\\font_default_family " << h_font_default_family << "\n"
           << "\\use_non_tex_fonts " << (h_use_non_tex_fonts ? "true" : "false") << '\n'
           << "\\font_sc " << h_font_sc << "\n"
           << "\\font_osf " << h_font_osf << "\n"
-          << "\\font_sf_scale " << h_font_sf_scale << "\n"
-          << "\\font_tt_scale " << h_font_tt_scale << '\n';
+          << "\\font_sf_scale " << h_font_sf_scale[0]
+          << ' ' << h_font_sf_scale[1] << '\n'
+          << "\\font_tt_scale " << h_font_tt_scale[0]
+          << ' ' << h_font_tt_scale[1] << '\n';
        if (!h_font_cjk.empty())
                os << "\\font_cjk " << h_font_cjk << '\n';
        os << "\\graphics " << h_graphics << '\n'
@@ -1357,7 +1367,7 @@ void Preamble::parse(Parser & p, string const & forceclass,
                else if (t.cs() == "setmainfont") {
                        // we don't care about the option
                        p.hasOpt() ? p.getOpt() : string();
-                       h_font_roman = p.getArg('{', '}');
+                       h_font_roman[1] = p.getArg('{', '}');
                }
 
                else if (t.cs() == "setsansfont" || t.cs() == "setmonofont") {
@@ -1377,12 +1387,12 @@ void Preamble::parse(Parser & p, string const & forceclass,
                        }
                        if (t.cs() == "setsansfont") {
                                if (!scale.empty())
-                                       h_font_sf_scale = scale;
-                               h_font_sans = p.getArg('{', '}');
+                                       h_font_sf_scale[1] = scale;
+                               h_font_sans[1] = p.getArg('{', '}');
                        } else {
                                if (!scale.empty())
-                                       h_font_tt_scale = scale;
-                               h_font_typewriter = p.getArg('{', '}');
+                                       h_font_tt_scale[1] = scale;
+                               h_font_typewriter[1] = p.getArg('{', '}');
                        }
                }
 
@@ -1528,19 +1538,19 @@ void Preamble::parse(Parser & p, string const & forceclass,
                        // font settings
                        if (name == "\\rmdefault")
                                if (is_known(body, known_roman_fonts)) {
-                                       h_font_roman = body;
+                                       h_font_roman[0] = body;
                                        p.skip_spaces();
                                        in_lyx_preamble = true;
                                }
                        if (name == "\\sfdefault")
                                if (is_known(body, known_sans_fonts)) {
-                                       h_font_sans = body;
+                                       h_font_sans[0] = body;
                                        p.skip_spaces();
                                        in_lyx_preamble = true;
                                }
                        if (name == "\\ttdefault")
                                if (is_known(body, known_typewriter_fonts)) {
-                                       h_font_typewriter = body;
+                                       h_font_typewriter[0] = body;
                                        p.skip_spaces();
                                        in_lyx_preamble = true;
                                }
index 71367b1af4e14b328d59094d07570c7f0bae0afd..1c3fe66f23eef2802157a4a9ecde8586baeabd8d 100644 (file)
@@ -131,16 +131,16 @@ private:
        std::string h_float_placement;
        std::string h_fontcolor;
        std::string h_fontencoding;
-       std::string h_font_math;
-       std::string h_font_roman;
-       std::string h_font_sans;
-       std::string h_font_typewriter;
+       std::string h_font_math[2];
+       std::string h_font_roman[2];
+       std::string h_font_sans[2];
+       std::string h_font_typewriter[2];
        std::string h_font_default_family;
        bool h_use_non_tex_fonts;
        std::string h_font_sc;
        std::string h_font_osf;
-       std::string h_font_sf_scale;
-       std::string h_font_tt_scale;
+       std::string h_font_sf_scale[2];
+       std::string h_font_tt_scale[2];
        bool h_font_cjk_set;
        std::string h_font_cjk;
        std::string h_graphics;
index 552ca215684da1b50ec0e347ef14a49e373fa352..b3e4a470d395053c5cef10fc954ffb586acfe0ab 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 500
+\lyxformat 501
 \begin_document
 \begin_header
 \origin roundtrip
 \language_package default
 \inputencoding utf8
 \fontencoding T1
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_math auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
+\font_sf_scale 100 100
+\font_tt_scale 100 100
 \graphics default
 \default_output_format default
 \output_sync 0
index f6c071123f0402f62247b35249d2640a01da4e01..263abcde7e0a1645803fceedd9d6eaeee62a7426 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 500
+\lyxformat 501
 \begin_document
 \begin_header
 \origin roundtrip
 \language_package default
 \inputencoding utf8-cjk
 \fontencoding T1
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_math auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
+\font_sf_scale 100 100
+\font_tt_scale 100 100
 \graphics default
 \default_output_format default
 \output_sync 0
index bd0b641574e0e62e4b1c0aa71f6db1367c470234..489308f1009523c9a63f6284a598a0fbfa9eb30f 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 500
+\lyxformat 501
 \begin_document
 \begin_header
 \origin roundtrip
 \language_package none
 \inputencoding iso8859-15
 \fontencoding T1
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_math auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
+\font_sf_scale 100 100
+\font_tt_scale 100 100
 \graphics default
 \default_output_format default
 \output_sync 0
index 89a02ed0cb53b4d1aea7e270fa7d3948f5d3c88f..e93a8688238eba66705b73a5f175cc74eece689a 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 500
+\lyxformat 501
 \begin_document
 \begin_header
 \origin roundtrip
 \language_package none
 \inputencoding iso8859-15
 \fontencoding T1
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_math auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
+\font_sf_scale 100 100
+\font_tt_scale 100 100
 \graphics default
 \default_output_format default
 \output_sync 0
index 64d4d2116b8b60d04328be195712c0d6482777dd..3bdd502221dc5f349191ba3ddbeb6bc62f0e1127 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 500
+\lyxformat 501
 \begin_document
 \begin_header
 \origin roundtrip
 \language_package default
 \inputencoding auto
 \fontencoding default
-\font_roman Linux Libertine O
-\font_sans Linux Biolinum O
-\font_typewriter Linux Biolinum O
-\font_math auto
+\font_roman "default" "Linux Libertine O"
+\font_sans "default" "Linux Biolinum O"
+\font_typewriter "default" "Linux Biolinum O"
+\font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts true
 \font_sc false
 \font_osf false
-\font_sf_scale 75
-\font_tt_scale 100
+\font_sf_scale 100 75
+\font_tt_scale 100 100
 \graphics default
 \default_output_format pdf4
 \output_sync 0
index 5a32462cf32fdc759754827aa88278d0a1a34fa8..ae6d472070078c42ab58b63e6256a2d9cc3d664a 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 500
+\lyxformat 501
 \begin_document
 \begin_header
 \origin roundtrip
@@ -19,16 +19,16 @@ algorithm2e
 \language_package none
 \inputencoding iso8859-1
 \fontencoding T1
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_math auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
+\font_sf_scale 100 100
+\font_tt_scale 100 100
 \graphics default
 \default_output_format default
 \output_sync 0
index d91072a8cca5ad8f1b055fd98407f821804a03e1..588f67043a275b269d235dd61118eb1cb9d5df6e 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 500
+\lyxformat 501
 \begin_document
 \begin_header
 \origin roundtrip
 \language_package none
 \inputencoding iso8859-15
 \fontencoding T1
-\font_roman cmr
-\font_sans berasans
-\font_typewriter default
-\font_math auto
+\font_roman "cmr" "default"
+\font_sans "berasans" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
 \font_default_family sfdefault
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
+\font_sf_scale 100 100
+\font_tt_scale 100 100
 \graphics default
 \default_output_format default
 \output_sync 0
index e0d6e73b17862d4d272d717461ae51ef2315378f..38bfb3870b00f3b85a73e40d46c4389e66000f3b 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 500
+\lyxformat 501
 \begin_document
 \begin_header
 \origin roundtrip
 \language_package none
 \inputencoding iso8859-15
 \fontencoding T1
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_math auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
+\font_sf_scale 100 100
+\font_tt_scale 100 100
 \graphics default
 \default_output_format default
 \output_sync 0
index 2ebeb1bb71f2b8c344b29152159dd91a1772ae23..39db027de35d2b69cfa37781761bc8445ac4bf9d 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 500
+\lyxformat 501
 \begin_document
 \begin_header
 \origin roundtrip
 \language_package none
 \inputencoding iso8859-15
 \fontencoding T1
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_math auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
+\font_sf_scale 100 100
+\font_tt_scale 100 100
 \graphics default
 \default_output_format default
 \output_sync 0
index 32fa929c03b0d5e12fc050da36eebb69c487c0b6..d0232fb81e31c1cb9b0b99fb50272320ac5d618b 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 500
+\lyxformat 501
 \begin_document
 \begin_header
 \origin roundtrip
 \language_package default
 \inputencoding iso8859-15
 \fontencoding T1
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_math auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
+\font_sf_scale 100 100
+\font_tt_scale 100 100
 \graphics default
 \default_output_format default
 \output_sync 0
index a56bfb3c85582638c1c87006cefac05432c4a832..4bf0ef39d43e2631f48b0c0a8c2f30bc7e73d62e 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 500
+\lyxformat 501
 \begin_document
 \begin_header
 \origin roundtrip
@@ -17,16 +17,16 @@ theorems-ams
 \language_package default
 \inputencoding iso8859-15
 \fontencoding T1
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_math auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
+\font_sf_scale 100 100
+\font_tt_scale 100 100
 \graphics default
 \default_output_format default
 \output_sync 0
index 5bcf213e6736a644a9ac61750ac0b4d1f450df33..e77e9e3088de8046f6b10ab652fac371b0a6012f 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 500
+\lyxformat 501
 \begin_document
 \begin_header
 \origin roundtrip
@@ -17,16 +17,16 @@ theorems-ams
 \language_package default
 \inputencoding iso8859-15
 \fontencoding T1
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_math auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
+\font_sf_scale 100 100
+\font_tt_scale 100 100
 \graphics default
 \default_output_format default
 \output_sync 0
index 2f02590e9840630718bca07dd69dcc296df65122..13933c4eecef3d285113c819adf232abf89fbfba 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 500
+\lyxformat 501
 \begin_document
 \begin_header
 \origin roundtrip
 \language_package default
 \inputencoding iso8859-15
 \fontencoding T1
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_math auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
+\font_sf_scale 100 100
+\font_tt_scale 100 100
 \graphics default
 \default_output_format default
 \output_sync 0
index 45d10356257d6d1a79042fe33ef0a6d410e79437..3b3a2f8150add01b587ffa4b3e5607fae9d73d94 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 500
+\lyxformat 501
 \begin_document
 \begin_header
 \origin roundtrip
@@ -49,16 +49,16 @@ logicalmkup
 \language_package default
 \inputencoding iso8859-15
 \fontencoding default
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_math auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
+\font_sf_scale 100 100
+\font_tt_scale 100 100
 \graphics default
 \default_output_format default
 \output_sync 1
index 4b219a67471e0f9bb119c1955f745b31f9d91eb1..a4788a42a772865550640ae0d325bd5f44e69055 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 500
+\lyxformat 501
 \begin_document
 \begin_header
 \origin roundtrip
 \language_package none
 \inputencoding auto
 \fontencoding default
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_math auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
+\font_sf_scale 100 100
+\font_tt_scale 100 100
 \graphics default
 \default_output_format default
 \output_sync 0
index d6a05c3532287075e48c8688968e20fdeb70af1b..00f7643a1c85814867d5e9afbcbb4935099b36dc 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 500
+\lyxformat 501
 \begin_document
 \begin_header
 \origin roundtrip
 \language_package none
 \inputencoding auto
 \fontencoding default
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_math auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
+\font_sf_scale 100 100
+\font_tt_scale 100 100
 \graphics default
 \default_output_format default
 \output_sync 0
index 04f4b82b1f1d04d94c65f8e43288f12b91b2eac2..f6de3234708b693a6a19e16557d1161a38e0a88a 100644 (file)
@@ -32,8 +32,8 @@ extern char const * const lyx_version_info;
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-#define LYX_FORMAT_LYX 500 // uwestoehr: achemso layout improvement
-#define LYX_FORMAT_TEX2LYX 500
+#define LYX_FORMAT_LYX 501 // gb: store both TeX and non-TeX font selections
+#define LYX_FORMAT_TEX2LYX 501
 
 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
 #ifndef _MSC_VER