secnumdepth = 3;
tocdepth = 3;
language = default_language;
+ fontenc = "global";
fontsRoman = "default";
fontsSans = "default";
fontsTypewriter = "default";
} else if (token == "\\index_command") {
lex.eatLine();
index_command = lex.getString();
+ } else if (token == "\\fontencoding") {
+ lex.eatLine();
+ fontenc = lex.getString();
} else if (token == "\\font_roman") {
lex.eatLine();
fontsRoman = lex.getString();
if (language != ignore_language)
os << "\\language " << language->lang() << '\n';
os << "\\inputencoding " << inputenc
+ << "\n\\fontencoding " << fontenc
<< "\n\\font_roman " << fontsRoman
<< "\n\\font_sans " << fontsSans
<< "\n\\font_typewriter " << fontsTypewriter
<< from_ascii(fontsDefaultFamily) << "}\n";
// set font encoding
- // this one is not per buffer
// for arabic_arabi and farsi we also need to load the LAE and
// LFE encoding
// XeTeX works without fontenc
- if (lyxrc.fontenc != "default" && language->lang() != "japanese"
+ if (font_encoding() != "default" && language->lang() != "japanese"
&& !useXetex) {
if (language->lang() == "arabic_arabi"
|| language->lang() == "farsi") {
- os << "\\usepackage[" << from_ascii(lyxrc.fontenc)
+ os << "\\usepackage[" << from_ascii(font_encoding())
<< ",LFE,LAE]{fontenc}\n";
texrow.newline();
} else {
- os << "\\usepackage[" << from_ascii(lyxrc.fontenc)
+ os << "\\usepackage[" << from_ascii(font_encoding())
<< "]{fontenc}\n";
texrow.newline();
}
}
+string const BufferParams::font_encoding() const
+{
+ return (fontenc == "global") ? lyxrc.fontenc : fontenc;
+}
+
+
string BufferParams::babelCall(string const & lang_opts) const
{
string lang_pack = lyxrc.language_package;
// AE
else if (rm == "ae") {
// not needed when using OT1 font encoding.
- if (lyxrc.fontenc != "default")
+ if (font_encoding() != "default")
os << "\\usepackage{ae,aecompl}\n";
}
// Times
// fourier supersedes utopia.sty, but does
// not work with OT1 encoding.
if (LaTeXFeatures::isAvailable("fourier")
- && lyxrc.fontenc != "default") {
+ && font_encoding() != "default") {
os << "\\usepackage";
if (osf || sc) {
os << '[';
this, SLOT(ttChanged(int)));
connect(fontModule->fontsDefaultCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
+ connect(fontModule->fontencCO, SIGNAL(activated(int)),
+ this, SLOT(change_adaptor()));
+ connect(fontModule->fontencCO, SIGNAL(activated(int)),
+ this, SLOT(fontencChanged(int)));
+ connect(fontModule->fontencLE, SIGNAL(textChanged(const QString &)),
+ this, SLOT(change_adaptor()));
connect(fontModule->fontsizeCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(fontModule->cjkFontLE, SIGNAL(textChanged(const QString &)),
fontModule->fontsizeCO->addItem(qt_("11"));
fontModule->fontsizeCO->addItem(qt_("12"));
+ fontModule->fontencCO->addItem(qt_("Default"));
+ fontModule->fontencCO->addItem(qt_("Custom"));
+ fontModule->fontencCO->addItem(qt_("None (no fontenc)"));
+
for (int n = 0; GuiDocument::fontfamilies_gui[n][0]; ++n)
fontModule->fontsDefaultCO->addItem(
qt_(GuiDocument::fontfamilies_gui[n]));
font = tex_fonts_roman[fontModule->fontsRomanCO->currentIndex()];
fontModule->fontScCB->setEnabled(providesSC(font));
fontModule->fontOsfCB->setEnabled(providesOSF(font));
+
+ fontModule->fontencLA->setEnabled(!xetex);
+ fontModule->fontencCO->setEnabled(!xetex);
+ fontModule->fontencLE->setEnabled(!xetex);
}
}
+void GuiDocument::fontencChanged(int item)
+{
+ fontModule->fontencLE->setEnabled(item == 1);
+}
+
+
void GuiDocument::romanChanged(int item)
{
if (outputModule->xetexCB->isChecked())
tex_fonts_monospaced[fontModule->fontsTypewriterCO->currentIndex()];
}
+ if (fontModule->fontencCO->currentIndex() == 0)
+ bp_.fontenc = "global";
+ else if (fontModule->fontencCO->currentIndex() == 1)
+ bp_.fontenc = fromqstr(fontModule->fontencLE->text());
+ else if (fontModule->fontencCO->currentIndex() == 2)
+ bp_.fontenc = "default";
+
bp_.fontsCJK =
fromqstr(fontModule->cjkFontLE->text());
bp_.fontsize);
if (bp_.useXetex) {
+ fontModule->fontencLA->setEnabled(false);
+ fontModule->fontencCO->setEnabled(false);
+ fontModule->fontencLE->setEnabled(false);
for (int i = 0; i < fontModule->fontsRomanCO->count(); ++i) {
if (fontModule->fontsRomanCO->itemText(i) == toqstr(bp_.fontsRoman)) {
fontModule->fontsRomanCO->setCurrentIndex(i);
}
}
} else {
+ fontModule->fontencLA->setEnabled(true);
+ fontModule->fontencCO->setEnabled(true);
+ fontModule->fontencLE->setEnabled(true);
int n = findToken(tex_fonts_roman, bp_.fontsRoman);
if (n >= 0) {
fontModule->fontsRomanCO->setCurrentIndex(n);
if (nn >= 0)
fontModule->fontsDefaultCO->setCurrentIndex(nn);
+ if (bp_.fontenc == "global")
+ fontModule->fontencCO->setCurrentIndex(0);
+ else if (bp_.fontenc == "default")
+ fontModule->fontencCO->setCurrentIndex(2);
+ else {
+ fontModule->fontencCO->setCurrentIndex(1);
+ fontModule->fontencLE->setText(toqstr(bp_.fontenc));
+ }
+
// paper
bool const extern_geometry =
documentClass().provides("geometry");
<x>0</x>
<y>0</y>
<width>543</width>
- <height>361</height>
+ <height>341</height>
</rect>
</property>
<property name="windowTitle" >
<property name="spacing" >
<number>6</number>
</property>
- <item row="8" column="0" colspan="4" >
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::Expanding</enum>
+ <item row="1" column="2" >
+ <widget class="QComboBox" name="fontencCO" />
+ </item>
+ <item row="1" column="0" colspan="2" >
+ <widget class="QLabel" name="fontencLA" >
+ <property name="text" >
+ <string>LaTe&X font encoding:</string>
</property>
- <property name="sizeHint" >
- <size>
- <width>391</width>
- <height>16</height>
- </size>
+ <property name="buddy" >
+ <cstring>fontencCO</cstring>
</property>
- </spacer>
+ </widget>
</item>
- <item row="7" column="1" >
- <widget class="QCheckBox" name="fontOsfCB" >
+ <item row="1" column="3" colspan="2" >
+ <widget class="QLineEdit" name="fontencLE" >
<property name="toolTip" >
- <string>Use old style instead of lining figures</string>
+ <string>Specify the font encoding (e.g., T1).</string>
</property>
+ </widget>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="fontsDefaultLA" >
<property name="text" >
- <string>Use &Old Style Figures</string>
+ <string>&Default Family:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>fontsDefaultCO</cstring>
</property>
</widget>
</item>
- <item row="6" column="1" >
- <widget class="QCheckBox" name="fontScCB" >
+ <item row="0" column="1" colspan="2" >
+ <widget class="QComboBox" name="fontsDefaultCO" >
<property name="toolTip" >
- <string>Use a real small caps shape, if the font provides one</string>
+ <string>Select the default family for the document</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="4" >
+ <widget class="QComboBox" name="fontsizeCO" >
+ <property name="toolTip" >
+ <string/>
</property>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <widget class="QLabel" name="TextLabel2_2" >
<property name="text" >
- <string>Use true S&mall Caps</string>
+ <string>&Base Size:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>fontsizeCO</cstring>
</property>
</widget>
</item>
- <item row="5" column="2" colspan="2" >
+ <item row="9" column="0" colspan="5" >
<spacer>
<property name="orientation" >
- <enum>Qt::Horizontal</enum>
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
- <width>151</width>
- <height>20</height>
+ <width>525</width>
+ <height>41</height>
</size>
</property>
</spacer>
</item>
- <item row="5" column="1" >
- <widget class="QLineEdit" name="cjkFontLE" >
- <property name="toolTip" >
- <string>Input the font to be used for Chinese, Japanese or Korean (CJK) script</string>
+ <item row="2" column="1" colspan="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
</property>
- </widget>
+ <property name="sizeHint" >
+ <size>
+ <width>182</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
</item>
- <item row="5" column="0" >
- <widget class="QLabel" name="cjkFontLA" >
+ <item row="3" column="0" >
+ <widget class="QLabel" name="fontsRomanLA" >
<property name="text" >
- <string>C&JK:</string>
+ <string>&Roman:</string>
</property>
<property name="buddy" >
- <cstring>cjkFontLE</cstring>
+ <cstring>fontsRomanCO</cstring>
</property>
</widget>
</item>
- <item row="4" column="3" >
- <widget class="QSpinBox" name="scaleTypewriterSB" >
+ <item row="3" column="1" colspan="2" >
+ <widget class="QComboBox" name="fontsRomanCO" >
<property name="toolTip" >
- <string>Scale the Typewriter font to match the base font's dimensions</string>
+ <string>Select the roman (serif) typeface</string>
</property>
- <property name="maximum" >
- <number>200</number>
+ </widget>
+ </item>
+ <item row="3" column="3" colspan="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
</property>
- <property name="minimum" >
- <number>10</number>
+ <property name="sizeHint" >
+ <size>
+ <width>131</width>
+ <height>20</height>
+ </size>
</property>
- </widget>
+ </spacer>
</item>
- <item row="4" column="2" >
- <widget class="QLabel" name="scaleTypewriterLA" >
+ <item row="4" column="0" >
+ <widget class="QLabel" name="fontsSansLA" >
<property name="text" >
- <string>Sc&ale (%):</string>
+ <string>&Sans Serif:</string>
</property>
<property name="buddy" >
- <cstring>scaleTypewriterSB</cstring>
+ <cstring>fontsSansCO</cstring>
</property>
</widget>
</item>
- <item row="4" column="1" >
- <widget class="QComboBox" name="fontsTypewriterCO" >
+ <item row="4" column="1" colspan="2" >
+ <widget class="QComboBox" name="fontsSansCO" >
<property name="toolTip" >
- <string>Select the typewriter (monospaced) typeface</string>
+ <string>Select the Sans Serif (grotesque) typeface</string>
</property>
</widget>
</item>
- <item row="4" column="0" >
- <widget class="QLabel" name="fontsTypewriterLA" >
+ <item row="4" column="3" >
+ <widget class="QLabel" name="scaleSansLA" >
<property name="text" >
- <string>&Typewriter:</string>
+ <string>S&cale (%):</string>
</property>
<property name="buddy" >
- <cstring>fontsTypewriterCO</cstring>
+ <cstring>scaleSansSB</cstring>
</property>
</widget>
</item>
- <item row="3" column="3" >
+ <item row="4" column="4" >
<widget class="QSpinBox" name="scaleSansSB" >
<property name="toolTip" >
<string>Scale the Sans Serif font to match the base font's dimensions</string>
</property>
</widget>
</item>
- <item row="3" column="2" >
- <widget class="QLabel" name="scaleSansLA" >
+ <item row="5" column="0" >
+ <widget class="QLabel" name="fontsTypewriterLA" >
<property name="text" >
- <string>S&cale (%):</string>
+ <string>&Typewriter:</string>
</property>
<property name="buddy" >
- <cstring>scaleSansSB</cstring>
+ <cstring>fontsTypewriterCO</cstring>
</property>
</widget>
</item>
- <item row="3" column="1" >
- <widget class="QComboBox" name="fontsSansCO" >
+ <item row="5" column="1" colspan="2" >
+ <widget class="QComboBox" name="fontsTypewriterCO" >
<property name="toolTip" >
- <string>Select the Sans Serif (grotesque) typeface</string>
+ <string>Select the typewriter (monospaced) typeface</string>
</property>
</widget>
</item>
- <item row="3" column="0" >
- <widget class="QLabel" name="fontsSansLA" >
+ <item row="5" column="3" >
+ <widget class="QLabel" name="scaleTypewriterLA" >
<property name="text" >
- <string>&Sans Serif:</string>
+ <string>Sc&ale (%):</string>
</property>
<property name="buddy" >
- <cstring>fontsSansCO</cstring>
+ <cstring>scaleTypewriterSB</cstring>
</property>
</widget>
</item>
- <item row="2" column="2" colspan="2" >
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
+ <item row="5" column="4" >
+ <widget class="QSpinBox" name="scaleTypewriterSB" >
+ <property name="toolTip" >
+ <string>Scale the Typewriter font to match the base font's dimensions</string>
</property>
- <property name="sizeHint" >
- <size>
- <width>131</width>
- <height>20</height>
- </size>
+ <property name="maximum" >
+ <number>200</number>
</property>
- </spacer>
- </item>
- <item row="2" column="1" >
- <widget class="QComboBox" name="fontsRomanCO" >
- <property name="toolTip" >
- <string>Select the roman (serif) typeface</string>
+ <property name="minimum" >
+ <number>10</number>
</property>
</widget>
</item>
- <item row="2" column="0" >
- <widget class="QLabel" name="fontsRomanLA" >
+ <item row="6" column="0" >
+ <widget class="QLabel" name="cjkFontLA" >
<property name="text" >
- <string>&Roman:</string>
+ <string>C&JK:</string>
</property>
<property name="buddy" >
- <cstring>fontsRomanCO</cstring>
+ <cstring>cjkFontLE</cstring>
</property>
</widget>
</item>
- <item row="1" column="1" >
+ <item row="6" column="1" colspan="2" >
+ <widget class="QLineEdit" name="cjkFontLE" >
+ <property name="toolTip" >
+ <string>Input the font to be used for Chinese, Japanese or Korean (CJK) script</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="3" colspan="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
- <width>182</width>
- <height>16</height>
+ <width>151</width>
+ <height>20</height>
</size>
</property>
</spacer>
</item>
- <item row="0" column="3" >
- <widget class="QComboBox" name="fontsizeCO" >
+ <item row="7" column="1" colspan="2" >
+ <widget class="QCheckBox" name="fontScCB" >
<property name="toolTip" >
- <string/>
+ <string>Use a real small caps shape, if the font provides one</string>
</property>
- </widget>
- </item>
- <item row="0" column="2" >
- <widget class="QLabel" name="TextLabel2_2" >
<property name="text" >
- <string>&Base Size:</string>
- </property>
- <property name="buddy" >
- <cstring>fontsizeCO</cstring>
+ <string>Use true S&mall Caps</string>
</property>
</widget>
</item>
- <item row="0" column="1" >
- <widget class="QComboBox" name="fontsDefaultCO" >
+ <item row="8" column="1" colspan="2" >
+ <widget class="QCheckBox" name="fontOsfCB" >
<property name="toolTip" >
- <string>Select the default family for the document</string>
+ <string>Use old style instead of lining figures</string>
</property>
- </widget>
- </item>
- <item row="0" column="0" >
- <widget class="QLabel" name="fontsDefaultLA" >
<property name="text" >
- <string>&Default Family:</string>
- </property>
- <property name="buddy" >
- <cstring>fontsDefaultCO</cstring>
+ <string>Use &Old Style Figures</string>
</property>
</widget>
</item>