-----------------------
+2019-07-14 Jürgen Spitzmüller <spitz@lyx.org>
+ * Format incremented to 581: split osf options to rm, sf, and tt
+ \font_osf => \font_roman_osf, \font_sans_osf, \font_typewriter_osf
+
2019-07-11 Uwe Stöhr <uwestoehr@web.de>
Jürgen Spitzmüller <spitz@lyx.org>
* Format incremented to 580: support for document font options
def revert_IBMFonts_xopts(document):
" Revert native IBM font definition (with extra options) to LaTeX "
-
i = find_token(document.header, '\\use_non_tex_fonts', 0)
if i == -1:
document.warning("Malformed LyX document: Missing \\use_non_tex_fonts.")
add_preamble_fonts(document, fontmap)
+def convert_osf(document):
+ " Convert \\font_osf param to new format "
+
+ NonTeXFonts = False
+ i = find_token(document.header, '\\use_non_tex_fonts', 0)
+ if i == -1:
+ document.warning("Malformed LyX document: Missing \\use_non_tex_fonts.")
+ else:
+ NonTeXFonts = str2bool(get_value(document.header, "\\use_non_tex_fonts", i))
+
+ i = find_token(document.header, '\\font_osf', 0)
+ if i == -1:
+ document.warning("Malformed LyX document: Missing \\font_osf.")
+ return
+
+ osfsf = ["biolinum", "ADOBESourceSansPro", "NotoSansRegular", "NotoSansMedium", "NotoSansThin", "NotoSansLight", "NotoSansExtralight" ]
+ osftt = ["ADOBESourceCodePro", "NotoMonoRegular" ]
+
+ osfval = str2bool(get_value(document.header, "\\font_osf", i))
+ document.header[i] = document.header[i].replace("\\font_osf", "\\font_roman_osf")
+
+ if NonTeXFonts:
+ document.header.insert(i, "\\font_sans_osf false")
+ document.header.insert(i + 1, "\\font_typewriter_osf false")
+ return
+
+ if osfval:
+ x = find_token(document.header, "\\font_sans", 0)
+ if x == -1:
+ document.warning("Malformed LyX document: Missing \\font_sans.")
+ else:
+ # We need to use this regex since split() does not handle quote protection
+ sffont = re.findall(r'[^"\s]\S*|".+?"', document.header[x])
+ sf = sffont[1].strip('"')
+ if sf in osfsf:
+ document.header.insert(i, "\\font_sans_osf true")
+ else:
+ document.header.insert(i, "\\font_sans_osf false")
+
+ x = find_token(document.header, "\\font_typewriter", 0)
+ if x == -1:
+ document.warning("Malformed LyX document: Missing \\font_typewriter.")
+ else:
+ # We need to use this regex since split() does not handle quote protection
+ ttfont = re.findall(r'[^"\s]\S*|".+?"', document.header[x])
+ tt = ttfont[1].strip('"')
+ if tt in osftt:
+ document.header.insert(i + 1, "\\font_sans_osf true")
+ else:
+ document.header.insert(i + 1, "\\font_sans_osf false")
+
+ else:
+ document.header.insert(i, "\\font_sans_osf false")
+ document.header.insert(i + 1, "\\font_typewriter_osf false")
+
+
+def revert_osf(document):
+ " Revert \\font_*_osf params "
+
+ NonTeXFonts = False
+ i = find_token(document.header, '\\use_non_tex_fonts', 0)
+ if i == -1:
+ document.warning("Malformed LyX document: Missing \\use_non_tex_fonts.")
+ else:
+ NonTeXFonts = str2bool(get_value(document.header, "\\use_non_tex_fonts", i))
+
+ i = find_token(document.header, '\\font_roman_osf', 0)
+ if i == -1:
+ document.warning("Malformed LyX document: Missing \\font_roman_osf.")
+ return
+
+ osfval = str2bool(get_value(document.header, "\\font_roman_osf", i))
+ document.header[i] = document.header[i].replace("\\font_roman_osf", "\\font_osf")
+
+ i = find_token(document.header, '\\font_sans_osf', 0)
+ if i == -1:
+ document.warning("Malformed LyX document: Missing \\font_sans_osf.")
+ return
+
+ osfval = str2bool(get_value(document.header, "\\font_sans_osf", i))
+ del document.header[i]
+
+ i = find_token(document.header, '\\font_typewriter_osf', 0)
+ if i == -1:
+ document.warning("Malformed LyX document: Missing \\font_typewriter_osf.")
+ return
+
+ osfval |= str2bool(get_value(document.header, "\\font_typewriter_osf", i))
+ del document.header[i]
+
+ if osfval:
+ i = find_token(document.header, '\\font_osf', 0)
+ if i == -1:
+ document.warning("Malformed LyX document: Missing \\font_osf.")
+ return
+ document.header[i] = "\\font_osf true"
+
+
##
# Conversion hub
#
[577, [convert_linggloss]],
[578, []],
[579, []],
- [580, []]
+ [580, []],
+ [581, [convert_osf]]
]
-revert = [[579, [revert_minionpro, revert_plainNotoFonts_xopts, revert_notoFonts_xopts, revert_IBMFonts_xopts, revert_AdobeFonts_xopts, revert_font_opts]], # keep revert_font_opts last!
+revert = [[580, [revert_osf]],
+ [579, [revert_minionpro, revert_plainNotoFonts_xopts, revert_notoFonts_xopts, revert_IBMFonts_xopts, revert_AdobeFonts_xopts, revert_font_opts]], # keep revert_font_opts last!
[578, [revert_babelfont]],
[577, [revert_drs]],
[576, [revert_linggloss, revert_subexarg]],
use_microtype = false;
use_dash_ligatures = true;
fonts_expert_sc = false;
- fonts_old_figures = false;
+ fonts_roman_osf = false;
+ fonts_sans_osf = false;
+ fonts_typewriter_osf = false;
fonts_sans_scale[0] = 100;
fonts_sans_scale[1] = 100;
fonts_typewriter_scale[0] = 100;
lex >> useNonTeXFonts;
} else if (token == "\\font_sc") {
lex >> fonts_expert_sc;
- } else if (token == "\\font_osf") {
- lex >> fonts_old_figures;
+ } else if (token == "\\font_roman_osf") {
+ lex >> fonts_roman_osf;
+ } else if (token == "\\font_sans_osf") {
+ lex >> fonts_sans_osf;
+ } else if (token == "\\font_typewriter_osf") {
+ lex >> fonts_typewriter_osf;
} else if (token == "\\font_roman_opts") {
lex >> font_roman_opts;
} else if (token == "\\font_sf_scale") {
<< "\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_roman_osf " << convert<string>(fonts_roman_osf)
+ << "\n\\font_sans_osf " << convert<string>(fonts_sans_osf)
+ << "\n\\font_typewriter_osf " << convert<string>(fonts_typewriter_osf);
if (!font_roman_opts.empty())
os << "\n\\font_roman_opts \"" << font_roman_opts << "\"";
os << "\n\\font_sf_scale " << fonts_sans_scale[0]
if (!font_roman_opts.empty())
os << font_roman_opts << ',';
os << texmapping;
- if (fonts_old_figures)
+ if (fonts_roman_osf)
os << ",Numbers=OldStyle";
os << "]{" << parseFontName(fontsRoman()) << "}\n";
}
os << "\\setsansfont";
os << "[Scale="
<< float(fontsSansScale()) / 100 << ',';
+ if (fonts_sans_osf)
+ os << "Numbers=OldStyle,";
if (!font_sans_opts.empty())
os << font_sans_opts << ',';
os << texmapping << "]{"
os << "\\babelfont{sf}[";
else
os << "\\setsansfont[";
+ if (fonts_sans_osf)
+ os << "Numbers=OldStyle,";
if (!font_sans_opts.empty())
os << font_sans_opts << ',';
os << texmapping << "]{"
os << "\\setmonofont";
os << "[Scale="
<< float(fontsTypewriterScale()) / 100;
+ if (fonts_typewriter_osf)
+ os << ",Numbers=OldStyle";
if (!font_typewriter_opts.empty())
os << ',' << font_typewriter_opts;
os << "]{"
os << "\\babelfont{tt}";
else
os << "\\setmonofont";
- if (!font_typewriter_opts.empty())
- os << '[' << font_typewriter_opts << ']';
+ if (!font_typewriter_opts.empty() || fonts_typewriter_osf) {
+ os << '[';
+ if (fonts_typewriter_osf)
+ os << "Numbers=OldStyle";
+ if (!font_typewriter_opts.empty()) {
+ if (fonts_typewriter_osf)
+ os << ',';
+ os << font_typewriter_opts;
+ }
+ os << ']';
+ }
os << '{' << mono << "}\n";
}
}
// ROMAN FONTS
os << theLaTeXFonts().getLaTeXFont(from_ascii(fontsRoman())).getLaTeXCode(
- dryrun, ot1, complete, fonts_expert_sc, fonts_old_figures,
+ dryrun, ot1, complete, fonts_expert_sc, fonts_roman_osf,
nomath, font_roman_opts);
// SANS SERIF
os << theLaTeXFonts().getLaTeXFont(from_ascii(fontsSans())).getLaTeXCode(
- dryrun, ot1, complete, fonts_expert_sc, fonts_old_figures,
+ dryrun, ot1, complete, fonts_expert_sc, fonts_sans_osf,
nomath, font_sans_opts, fontsSansScale());
// MONOSPACED/TYPEWRITER
os << theLaTeXFonts().getLaTeXFont(from_ascii(fontsTypewriter())).getLaTeXCode(
- dryrun, ot1, complete, fonts_expert_sc, fonts_old_figures,
+ dryrun, ot1, complete, fonts_expert_sc, fonts_typewriter_osf,
nomath, font_typewriter_opts, fontsTypewriterScale());
// MATH
os << theLaTeXFonts().getLaTeXFont(from_ascii(fontsMath())).getLaTeXCode(
- dryrun, ot1, complete, fonts_expert_sc, fonts_old_figures,
+ dryrun, ot1, complete, fonts_expert_sc, fonts_roman_osf,
nomath);
return os.str();
bool useNonTeXFonts;
/// use expert Small Caps
bool fonts_expert_sc;
- /// use Old Style Figures
- bool fonts_old_figures;
+ /// use Old Style Figures (rm)
+ bool fonts_roman_osf;
+ /// use Old Style Figures (sf)
+ bool fonts_sans_osf;
+ /// use Old Style Figures (tt)
+ bool fonts_typewriter_osf;
/// the options for the roman font
std::string font_roman_opts;
/// the scale factor of the sf font: [0] for TeX fonts, [1] for non-TeX fonts
this, SLOT(change_adaptor()));
connect(fontModule->fontOsfCB, SIGNAL(toggled(bool)),
this, SLOT(fontOsfToggled(bool)));
+ connect(fontModule->fontSansOsfCB, SIGNAL(clicked()),
+ this, SLOT(change_adaptor()));
+ connect(fontModule->fontTypewriterOsfCB, SIGNAL(clicked()),
+ this, SLOT(change_adaptor()));
connect(fontModule->fontspecRomanLE, SIGNAL(textChanged(const QString &)),
this, SLOT(change_adaptor()));
connect(fontModule->fontspecSansLE, SIGNAL(textChanged(const QString &)),
bool scaleable = providesScale(font);
fontModule->scaleSansSB->setEnabled(scaleable);
fontModule->scaleSansLA->setEnabled(scaleable);
+ fontModule->fontSansOsfCB->setEnabled(providesOSF(font));
if (tex_fonts)
font = fontModule->fontsTypewriterCO->itemData(
fontModule->fontsTypewriterCO->currentIndex()).toString();
scaleable = providesScale(font);
fontModule->scaleTypewriterSB->setEnabled(scaleable);
fontModule->scaleTypewriterLA->setEnabled(scaleable);
+ fontModule->fontTypewriterOsfCB->setEnabled(providesOSF(font));
if (tex_fonts)
font = fontModule->fontsRomanCO->itemData(
fontModule->fontsRomanCO->currentIndex()).toString();
bool const scaleable = providesScale(font);
fontModule->scaleSansSB->setEnabled(scaleable);
fontModule->scaleSansLA->setEnabled(scaleable);
+ fontModule->fontSansOsfCB->setEnabled(providesOSF(font));
updateExtraOpts();
}
bool scaleable = providesScale(font);
fontModule->scaleTypewriterSB->setEnabled(scaleable);
fontModule->scaleTypewriterLA->setEnabled(scaleable);
+ fontModule->fontTypewriterOsfCB->setEnabled(providesOSF(font));
updateExtraOpts();
}
bp_.fonts_expert_sc = fontModule->fontScCB->isChecked();
- bp_.fonts_old_figures = fontModule->fontOsfCB->isChecked();
+ bp_.fonts_roman_osf = fontModule->fontOsfCB->isChecked();
+ bp_.fonts_sans_osf = fontModule->fontSansOsfCB->isChecked();
+ bp_.fonts_typewriter_osf = fontModule->fontTypewriterOsfCB->isChecked();
if (nontexfonts)
bp_.fonts_default_family = "default";
fontModule->dashesCB->setChecked(!bp_.use_dash_ligatures);
fontModule->fontScCB->setChecked(bp_.fonts_expert_sc);
- fontModule->fontOsfCB->setChecked(bp_.fonts_old_figures);
+ fontModule->fontOsfCB->setChecked(bp_.fonts_roman_osf);
+ fontModule->fontSansOsfCB->setChecked(bp_.fonts_sans_osf);
+ fontModule->fontTypewriterOsfCB->setChecked(bp_.fonts_typewriter_osf);
fontModule->scaleSansSB->setValue(bp_.fontsSansScale());
fontModule->font_sf_scale = bp_.fonts_sans_scale[!bp_.useNonTeXFonts];
fontModule->scaleTypewriterSB->setValue(bp_.fontsTypewriterScale());
// FIXME: we should check if the fonts really
// have OSF support. But how?
return true;
+ LYXERR0("osf font: " << font);
return theLaTeXFonts().getLaTeXFont(
qstring_to_ucs4(font)).providesOSF(ot1(),
completeFontset(),
<rect>
<x>0</x>
<y>0</y>
- <width>534</width>
- <height>632</height>
+ <width>568</width>
+ <height>557</height>
</rect>
</property>
<property name="windowTitle">
<string>FontUi</string>
</property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0">
- <widget class="QCheckBox" name="osFontsCB">
- <property name="toolTip">
- <string>Use OpenType and TrueType fonts with the fontspec package (requires XeTeX or LuaTeX)</string>
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="4" column="0">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
</property>
- <property name="text">
- <string>&Use non-TeX fonts (via XeTeX/LuaTeX)</string>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>126</height>
+ </size>
</property>
- </widget>
+ </spacer>
</item>
- <item row="1" column="0" colspan="2">
- <layout class="QGridLayout" name="gridLayout">
+ <item row="1" column="0">
+ <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="fontsDefaultLA">
<property name="text">
</widget>
</item>
<item row="2" column="1">
- <widget class="QComboBox" name="fontsRomanCO">
- <property name="toolTip">
- <string>Select the roman (serif) typeface</string>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_5">
+ <layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
- <widget class="QLabel" name="fontspecRomanLA">
- <property name="text">
- <string>Options:</string>
+ <widget class="QComboBox" name="fontsRomanCO">
+ <property name="toolTip">
+ <string>Select the roman (serif) typeface</string>
</property>
- <property name="buddy">
- <cstring>fontspecRomanLE</cstring>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="fontScCB">
+ <property name="toolTip">
+ <string>Use a real small caps shape, if the font provides one</string>
+ </property>
+ <property name="text">
+ <string>Use true s&mall caps</string>
</property>
</widget>
</item>
+ </layout>
+ </item>
+ <item row="3" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
- <widget class="QLineEdit" name="fontspecRomanLE">
+ <widget class="QCheckBox" name="fontOsfCB">
<property name="toolTip">
- <string>Here you can insert additional options (as provided by the font package)</string>
+ <string>Use old style instead of lining figures</string>
+ </property>
+ <property name="text">
+ <string>Use &old style figures</string>
</property>
</widget>
</item>
+ <item>
+ <spacer name="horizontalSpacer_7">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_5">
+ <item>
+ <widget class="QLabel" name="fontspecRomanLA">
+ <property name="text">
+ <string>Options:</string>
+ </property>
+ <property name="buddy">
+ <cstring>fontspecRomanLE</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="fontspecRomanLE">
+ <property name="toolTip">
+ <string>Here you can insert additional options (as provided by the font package)</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</item>
<item row="4" column="0">
</layout>
</item>
<item row="5" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
- <widget class="QLabel" name="fontspecSansLA">
- <property name="text">
- <string>Options:</string>
+ <widget class="QCheckBox" name="fontSansOsfCB">
+ <property name="toolTip">
+ <string>Use old style instead of lining figures</string>
</property>
- <property name="buddy">
- <cstring>fontspecSansLE</cstring>
+ <property name="text">
+ <string>Use old st&yle figures</string>
</property>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="fontspecSansLE">
- <property name="toolTip">
- <string>Here you can insert additional options (as provided by the font package)</string>
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
- </widget>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QLabel" name="fontspecSansLA">
+ <property name="text">
+ <string>Options:</string>
+ </property>
+ <property name="buddy">
+ <cstring>fontspecSansLE</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="fontspecSansLE">
+ <property name="toolTip">
+ <string>Here you can insert additional options (as provided by the font package)</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
</layout>
</item>
</layout>
</item>
<item row="7" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
- <widget class="QLabel" name="fontspecTypewriterLA">
- <property name="text">
- <string>Options:</string>
+ <widget class="QCheckBox" name="fontTypewriterOsfCB">
+ <property name="toolTip">
+ <string>Use old style instead of lining figures</string>
</property>
- <property name="buddy">
- <cstring>fontspecTypewriterLE</cstring>
+ <property name="text">
+ <string>Use old style &figures</string>
</property>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="fontspecTypewriterLE">
- <property name="toolTip">
- <string>Here you can insert additional options (as provided by the font package)</string>
+ <spacer name="horizontalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
- </widget>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="QLabel" name="fontspecTypewriterLA">
+ <property name="text">
+ <string>Options:</string>
+ </property>
+ <property name="buddy">
+ <cstring>fontspecTypewriterLE</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="fontspecTypewriterLE">
+ <property name="toolTip">
+ <string>Here you can insert additional options (as provided by the font package)</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
</layout>
</item>
</property>
</widget>
</item>
- <item row="10" column="1">
- <widget class="QCheckBox" name="fontScCB">
- <property name="toolTip">
- <string>Use a real small caps shape, if the font provides one</string>
- </property>
- <property name="text">
- <string>Use true s&mall caps</string>
- </property>
- </widget>
- </item>
- <item row="11" column="1">
- <widget class="QCheckBox" name="fontOsfCB">
- <property name="toolTip">
- <string>Use old style instead of lining figures</string>
- </property>
- <property name="text">
- <string>Use &old style figures</string>
- </property>
- </widget>
- </item>
- <item row="12" column="1">
- <widget class="QCheckBox" name="microtypeCB">
- <property name="toolTip">
- <string>Activate extensions such as character protrusion and font expansion via the microtype package</string>
- </property>
- <property name="text">
- <string>Enable micr&o-typographic extensions</string>
- </property>
- </widget>
- </item>
- <item row="13" column="1">
- <widget class="QCheckBox" name="dashesCB">
- <property name="toolTip">
- <string>By default, a line break can occur after en- and em-dashes. Checking this box prevents that.</string>
- </property>
- <property name="text">
- <string>Disallow l&ine breaks after dashes</string>
- </property>
- </widget>
- </item>
</layout>
</item>
- <item row="2" column="1">
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
+ <item row="2" column="0">
+ <widget class="QCheckBox" name="microtypeCB">
+ <property name="toolTip">
+ <string>Activate extensions such as character protrusion and font expansion via the microtype package</string>
</property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>126</height>
- </size>
+ <property name="text">
+ <string>Enable micr&o-typographic extensions</string>
</property>
- </spacer>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="osFontsCB">
+ <property name="toolTip">
+ <string>Use OpenType and TrueType fonts with the fontspec package (requires XeTeX or LuaTeX)</string>
+ </property>
+ <property name="text">
+ <string>&Use non-TeX fonts (via XeTeX/LuaTeX)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QCheckBox" name="dashesCB">
+ <property name="toolTip">
+ <string>By default, a line break can occur after en- and em-dashes. Checking this box prevents that.</string>
+ </property>
+ <property name="text">
+ <string>Disallow l&ine breaks after dashes</string>
+ </property>
+ </widget>
</item>
</layout>
</widget>
<tabstop>fontsTypewriterCO</tabstop>
<tabstop>scaleTypewriterSB</tabstop>
<tabstop>cjkFontLE</tabstop>
- <tabstop>fontScCB</tabstop>
- <tabstop>fontOsfCB</tabstop>
</tabstops>
<includes>
<include location="local">qt_i18n.h</include>
h_font_default_family = "default";
h_use_non_tex_fonts = false;
h_font_sc = "false";
- h_font_osf = "false";
+ h_font_roman_osf = "false";
+ h_font_sans_osf = "false";
+ h_font_typewriter_osf = "false";
h_font_sf_scale[0] = "100";
h_font_sf_scale[1] = "100";
h_font_tt_scale[0] = "100";
if (name == "garamondx") {
h_font_roman[0] = "garamondx";
if (opts == "osfI")
- h_font_osf = "true";
+ h_font_roman_osf = "true";
}
if (name == "libertine") {
// as well as libertineMono
h_font_typewriter[0] = "libertine-mono";
if (opts == "osf")
- h_font_osf = "true";
+ h_font_roman_osf = "true";
else if (opts == "lining")
- h_font_osf = "false";
+ h_font_roman_osf = "false";
}
if (name == "libertineRoman" || name == "libertine-type1") {
// and libertine-type1 do not automatically invoke
// biolinum and libertineMono
if (opts == "lining")
- h_font_osf = "false";
+ h_font_roman_osf = "false";
else if (opts == "osf")
- h_font_osf = "true";
+ h_font_roman_osf = "true";
}
if (name == "MinionPro") {
h_font_roman[0] = "minionpro";
vector<string> allopts = getVectorFromString(opts);
string xopts;
- h_font_osf = "true";
+ h_font_roman_osf = "true";
h_font_math[0] = "auto";
for (auto const & opt : allopts) {
if (opt == "lf") {
- h_font_osf = "false";
+ h_font_roman_osf = "false";
continue;
}
if (opt == "onlytext") {
h_font_roman[0] = "md-utopia";
if (opts.find("expert") != string::npos) {
h_font_sc = "true";
- h_font_osf = "true";
+ h_font_roman_osf = "true";
}
}
// cochineal can have several options, e.g. [proportional,osf]
string::size_type pos = opts.find("osf");
if (pos != string::npos)
- h_font_osf = "true";
+ h_font_roman_osf = "true";
}
if (name == "noto") {
if (opt == "nott")
continue;
if (opt == "osf") {
- h_font_osf = "true";
+ h_font_roman_osf = "true";
continue;
}
if (!xopts.empty())
if (name == "XCharter") {
h_font_roman[0] = "xcharter";
if (opts == "osf")
- h_font_osf = "true";
+ h_font_roman_osf = "true";
}
if (name == "plex-serif") {
string xopts;
for (auto const & opt : allopts) {
if (opt == "osf") {
- h_font_osf = "true";
+ h_font_roman_osf = "true";
continue;
}
if (!xopts.empty())
// biolinum can have several options, e.g. [osf,scaled=0.97]
string::size_type pos = opts.find("osf");
if (pos != string::npos)
- h_font_osf = "true";
+ h_font_sans_osf = "true";
}
if (name == "PTSans") {
continue;
if (opt == "semibold")
continue;
+ if (opt == "osf") {
+ h_font_sans_osf = "true";
+ continue;
+ }
if (!xopts.empty())
xopts += ", ";
xopts += opt;
continue;
}
if (opt == "osf") {
- h_font_osf = "true";
+ h_font_sans_osf = "true";
continue;
}
if (!xopts.empty())
continue;
}
if (opt == "osf") {
- h_font_osf = "true";
+ h_font_typewriter_osf = "true";
continue;
}
if (!xopts.empty())
// font uses old-style figure
if (name == "eco")
- h_font_osf = "true";
+ h_font_roman_osf = "true";
// math fonts
if (is_known(name, known_math_font_packages))
<< "\\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_roman_osf " << h_font_roman_osf << "\n"
+ << "\\font_sans_osf " << h_font_sans_osf << "\n"
+ << "\\font_typewriter_osf " << h_font_typewriter_osf << "\n";
if (!h_font_roman_opts.empty())
os << "\\font_roman_opts \"" << h_font_roman_opts << "\"" << '\n';
os << "\\font_sf_scale " << h_font_sf_scale[0]
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_roman_osf;
+ std::string h_font_sans_osf;
+ std::string h_font_typewriter_osf;
std::string h_font_sf_scale[2];
std::string h_font_tt_scale[2];
bool h_font_cjk_set;
// Do not remove the comment below, so we get merge conflict in
// independent branches. Instead add your own.
-#define LYX_FORMAT_LYX 580 // spitz/uwestoehr: support for fontspec options
-#define LYX_FORMAT_TEX2LYX 580
+#define LYX_FORMAT_LYX 581 // spitz: split osf to font families
+#define LYX_FORMAT_TEX2LYX 581
#if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
#ifndef _MSC_VER