LyX file-format changes
-----------------------
+2009-04-05 Jürgen Spitzmüller <spitz@lyx.org>
+ * Format incremented to 349: initial support for XeTeX.
+
2009-01-30 Uwe Stöhr <uwestoehr@web.de>
* Format incremented to 348: support for \*phantom.
\Format lilypond ly "LilyPond music" "" "" "%%" "vector"
\Format latex tex "LaTeX (plain)" L "" "%%" "document"
\Format pdflatex tex "LaTeX (pdflatex)" "" "" "%%" "document"
+\Format xetex tex "LaTeX (XeTeX)" "" "" "%%" "document"
\Format text txt "Plain text" a "" "%%" "document"
\Format text2 txt "Plain text (pstotext)" "" "" "%%" "document"
\Format text3 txt "Plain text (ps2ascii)" "" "" "%%" "document"
'gv', 'ghostview'],
rc_entry = [r'''\Format pdf pdf "PDF (ps2pdf)" P "%%" "" "document,vector"
\Format pdf2 pdf "PDF (pdflatex)" F "%%" "" "document,vector"
-\Format pdf3 pdf "PDF (dvipdfm)" m "%%" "" "document,vector"'''])
+\Format pdf3 pdf "PDF (dvipdfm)" m "%%" "" "document,vector"
+\Format pdf4 pdf "PDF (XeTeX)" X "%%" "" "document,vector"'''])
#
checkViewer('a DVI previewer', ['xdvi', 'kdvi'],
rc_entry = [r'\Format dvi dvi DVI D "%%" "" "document,vector"'])
''' Check all converters (\converter entries) '''
checkProg('the pdflatex program', ['pdflatex $$i'],
rc_entry = [ r'\converter pdflatex pdf2 "%%" "latex"' ])
+
+ checkProg('XeTeX', ['xelatex $$i'],
+ rc_entry = [ r'\converter xetex pdf4 "%%" "latex"' ])
''' If we're running LyX in-place then tex2lyx will be found in
../src/tex2lyx. Add this directory to the PATH temporarily and
supported_versions = ["2.0.0","2.0"]
convert = [[346, []],
[347, []],
- [348, []]
+ [348, []],
+ [349, []]
]
-revert = [[347, [revert_phantom, revert_hphantom, revert_vphantom]],
+revert = [[348, []],
+ [347, [revert_phantom, revert_hphantom, revert_vphantom]],
[346, [revert_tabularvalign]],
[345, [revert_swiss]]
]
// Do not remove the comment below, so we get merge conflict in
// independent branches. Instead add your own.
-int const LYX_FORMAT = 348; // uwestoehr: add support for \*phantom
+int const LYX_FORMAT = 349; // jspitzm: initial XeTeX support
typedef map<string, bool> DepClean;
typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
bool Buffer::makeLaTeXFile(FileName const & fname,
string const & original_path,
- OutputParams const & runparams,
+ OutputParams const & runparams_in,
bool output_preamble, bool output_body) const
{
+ OutputParams runparams = runparams_in;
+ if (params().useXetex)
+ runparams.flavor = OutputParams::XETEX;
+
string const encoding = runparams.encoding->iconvName();
LYXERR(Debug::LATEX, "makeLaTeXFile encoding: " << encoding << "...");
{
OutputParams runparams(¶ms().encoding());
runparams.nice = true;
- runparams.flavor = OutputParams::LATEX;
+ runparams.flavor = params().useXetex ?
+ OutputParams::XETEX : OutputParams::LATEX;
runparams.linelen = lyxrc.plaintext_linelen;
// No side effect of file copying and image conversion
runparams.dryrun = true;
return "docbook";
if (isLiterate())
return "literate";
+ if (params().useXetex)
+ return "xetex";
if (params().encoding().package() == Encoding::japanese)
return "platex";
return "latex";
};
+
namespace lyx {
// Local translators
return translator;
}
-
} // anon namespace
fontsSans = "default";
fontsTypewriter = "default";
fontsDefaultFamily = "default";
+ useXetex = false;
fontsSC = false;
fontsOSF = false;
fontsSansScale = 100;
} else if (token == "\\graphics") {
readGraphicsDriver(lex);
} else if (token == "\\font_roman") {
- lex >> fontsRoman;
+ lex.eatLine();
+ fontsRoman = lex.getString();
} else if (token == "\\font_sans") {
- lex >> fontsSans;
+ lex.eatLine();
+ fontsSans = lex.getString();
} else if (token == "\\font_typewriter") {
- lex >> fontsTypewriter;
+ lex.eatLine();
+ fontsTypewriter = lex.getString();
} else if (token == "\\font_default_family") {
lex >> fontsDefaultFamily;
+ } else if (token == "\\use_xetex") {
+ lex >> useXetex;
} else if (token == "\\font_sc") {
lex >> fontsSC;
} else if (token == "\\font_osf") {
<< "\n\\font_sans " << fontsSans
<< "\n\\font_typewriter " << fontsTypewriter
<< "\n\\font_default_family " << fontsDefaultFamily
+ << "\n\\use_xetex " << convert<string>(useXetex)
<< "\n\\font_sc " << convert<string>(fontsSC)
<< "\n\\font_osf " << convert<string>(fontsOSF)
<< "\n\\font_sf_scale " << fontsSansScale
}
break;
case OutputParams::PDFLATEX:
+ case OutputParams::XETEX:
if (xcolorulem) {
features.require("ct-xcolor-ulem");
features.require("ulem");
features.require("color");
}
+ if (useXetex)
+ features.require("xetex");
+
if (language->lang() == "vietnamese")
features.require("vietnamese");
else if (language->lang() == "japanese")
texrow.newline();
// end of \documentclass defs
+ if (useXetex) {
+ os << "\\usepackage{fontspec}\n";
+ texrow.newline();
+ os << "\\usepackage{xunicode}\n";
+ texrow.newline();
+ os << "\\usepackage{xltxtra}\n";
+ texrow.newline();
+ }
+
// font selection must be done before loading fontenc.sty
string const fonts =
loadFonts(fontsRoman, fontsSans,
fontsTypewriter, fontsSC, fontsOSF,
- fontsSansScale, fontsTypewriterScale);
+ fontsSansScale, fontsTypewriterScale, useXetex);
if (!fonts.empty()) {
os << from_ascii(fonts);
texrow.newline();
// this one is not per buffer
// for arabic_arabi and farsi we also need to load the LAE and
// LFE encoding
- if (lyxrc.fontenc != "default" && language->lang() != "japanese") {
+ // XeteX works without fontenc
+ if (lyxrc.fontenc != "default" && language->lang() != "japanese"
+ && !useXetex) {
if (language->lang() == "arabic_arabi"
|| language->lang() == "farsi") {
os << "\\usepackage[" << from_ascii(lyxrc.fontenc)
void BufferParams::writeEncodingPreamble(odocstream & os,
LaTeXFeatures & features, TexRow & texrow) const
{
+ if (useXetex)
+ return;
if (inputenc == "auto") {
string const doc_encoding =
language->encoding()->latexName();
}
+string const BufferParams::parseFontName(string const & name) const
+{
+ string mangled = name;
+ size_t const idx = mangled.find('[');
+ if (idx == string::npos || idx == 0)
+ return mangled;
+ else
+ return mangled.substr(0, idx - 1);
+}
+
+
string const BufferParams::loadFonts(string const & rm,
string const & sf, string const & tt,
bool const & sc, bool const & osf,
- int const & sfscale, int const & ttscale) const
+ int const & sfscale, int const & ttscale,
+ bool const & xetex) const
{
/* The LaTeX font world is in a flux. In the PSNFSS font interface,
several packages have been replaced by others, that might not
ostringstream os;
+ if (xetex) {
+ if (rm != "default")
+ os << "\\setmainfont[Mapping=tex-text]{"
+ << parseFontName(rm) << "}\n";
+ if (sf != "default") {
+ string const sans = parseFontName(sf);
+ if (sfscale != 100)
+ os << "\\setsansfont[Scale="
+ << float(sfscale) / 100
+ << ",Mapping=tex-text]{"
+ << sans << "}\n";
+ else
+ os << "\\setsansfont[Mapping=tex-text]{"
+ << sans << "}\n";
+ }
+ if (tt != "default") {
+ string const mono = parseFontName(tt);
+ if (ttscale != 100)
+ os << "\\setmonofont[Scale="
+ << float(sfscale) / 100
+ << "]{"
+ << mono << "}\n";
+ else
+ os << "\\setmonofont[Mapping=tex-text]{"
+ << mono << "}\n";
+ }
+ if (osf)
+ os << "\\defaultfontfeatures{Numbers=OldStyle}\n";
+ return os.str();
+ }
+
// ROMAN FONTS
// Computer Modern (must be explicitely selectable -- there might be classes
// that define a different default font!
Encoding const & BufferParams::encoding() const
{
+ if (useXetex)
+ return *(encodings.fromLaTeXName("utf8-plain"));
if (inputenc == "auto" || inputenc == "default")
return *language->encoding();
Encoding const * const enc = encodings.fromLaTeXName(inputenc);
std::string fontsTypewriter;
/// the default family (rm, sf, tt)
std::string fontsDefaultFamily;
+ /// use the XeTeX processor
+ bool useXetex;
/// use expert Small Caps
bool fontsSC;
/// use Old Style Figures
/// handle inputenc etc.
void writeEncodingPreamble(odocstream & os, LaTeXFeatures & features,
TexRow & texrow) const;
+ ///
+ std::string const parseFontName(std::string const & name) const;
/// set up the document fonts
std::string const loadFonts(std::string const & rm,
std::string const & sf, std::string const & tt,
bool const & sc, bool const & osf,
- int const & sfscale, int const & ttscale) const;
+ int const & sfscale, int const & ttscale,
+ bool const & xetex) const;
/// get the appropriate cite engine (natbib handling)
CiteEngine citeEngine() const;
cit != path.end(); ++cit) {
Converter const & conv = converterlist_[*cit];
if (conv.latex)
+ if (contains(conv.from, "xetex"))
+ return OutputParams::XETEX;
if (contains(conv.to, "pdf"))
return OutputParams::PDFLATEX;
if (conv.xml)
enum FLAVOR {
LATEX,
PDFLATEX,
+ XETEX,
XML
};
#include <QAbstractItemModel>
#include <QCloseEvent>
+#include <QFontDatabase>
#include <QScrollBar>
#include <QTextCursor>
this, SLOT(change_adaptor()));
connect(fontModule->fontOsfCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
+ connect(fontModule->xetexCB, SIGNAL(clicked()),
+ this, SLOT(change_adaptor()));
+ connect(fontModule->xetexCB, SIGNAL(toggled(bool)),
+ this, SLOT(xetexChanged(bool)));
- for (int n = 0; tex_fonts_roman[n][0]; ++n) {
- QString font = qt_(tex_fonts_roman_gui[n]);
- if (!isFontAvailable(tex_fonts_roman[n]))
- font += qt_(" (not installed)");
- fontModule->fontsRomanCO->addItem(font);
- }
- for (int n = 0; tex_fonts_sans[n][0]; ++n) {
- QString font = qt_(tex_fonts_sans_gui[n]);
- if (!isFontAvailable(tex_fonts_sans[n]))
- font += qt_(" (not installed)");
- fontModule->fontsSansCO->addItem(font);
- }
- for (int n = 0; tex_fonts_monospaced[n][0]; ++n) {
- QString font = qt_(tex_fonts_monospaced_gui[n]);
- if (!isFontAvailable(tex_fonts_monospaced[n]))
- font += qt_(" (not installed)");
- fontModule->fontsTypewriterCO->addItem(font);
- }
+ updateFontlist();
fontModule->fontsizeCO->addItem(qt_("Default"));
fontModule->fontsizeCO->addItem(qt_("10"));
setSkip(textLayoutModule->skipCO->currentIndex());
}
+
void GuiDocument::portraitChanged()
{
setMargins(pageLayoutModule->papersizeCO->currentIndex());
}
+
void GuiDocument::setMargins(bool custom)
{
bool const extern_geometry =
}
+void GuiDocument::xetexChanged(bool xetex)
+{
+ updateFontlist();
+ langModule->encodingCO->setEnabled(!xetex &&
+ !langModule->defaultencodingRB->isChecked());
+ langModule->defaultencodingRB->setEnabled(!xetex);
+ langModule->otherencodingRB->setEnabled(!xetex);
+}
+
+
void GuiDocument::updateFontsize(string const & items, string const & sel)
{
fontModule->fontsizeCO->clear();
}
+void GuiDocument::updateFontlist()
+{
+ fontModule->fontsRomanCO->clear();
+ fontModule->fontsSansCO->clear();
+ fontModule->fontsTypewriterCO->clear();
+
+ // With XeTeX, we have access to all system fonts, but not the LaTeX fonts
+ if (fontModule->xetexCB->isChecked()) {
+ fontModule->fontsRomanCO->addItem(qt_("Default"));
+ fontModule->fontsSansCO->addItem(qt_("Default"));
+ fontModule->fontsTypewriterCO->addItem(qt_("Default"));
+
+ QFontDatabase fontdb;
+ QStringList families(fontdb.families());
+ for (QStringList::Iterator it = families.begin(); it != families.end(); ++it) {
+ fontModule->fontsRomanCO->addItem(*it);
+ fontModule->fontsSansCO->addItem(*it);
+ fontModule->fontsTypewriterCO->addItem(*it);
+ }
+ return;
+ }
+
+ for (int n = 0; tex_fonts_roman[n][0]; ++n) {
+ QString font = qt_(tex_fonts_roman_gui[n]);
+ if (!isFontAvailable(tex_fonts_roman[n]))
+ font += qt_(" (not installed)");
+ fontModule->fontsRomanCO->addItem(font);
+ }
+ for (int n = 0; tex_fonts_sans[n][0]; ++n) {
+ QString font = qt_(tex_fonts_sans_gui[n]);
+ if (!isFontAvailable(tex_fonts_sans[n]))
+ font += qt_(" (not installed)");
+ fontModule->fontsSansCO->addItem(font);
+ }
+ for (int n = 0; tex_fonts_monospaced[n][0]; ++n) {
+ QString font = qt_(tex_fonts_monospaced_gui[n]);
+ if (!isFontAvailable(tex_fonts_monospaced[n]))
+ font += qt_(" (not installed)");
+ fontModule->fontsTypewriterCO->addItem(font);
+ }
+}
+
+
void GuiDocument::romanChanged(int item)
{
+ if (fontModule->xetexCB->isChecked()) {
+ fontModule->fontScCB->setEnabled(false);
+ return;
+ }
string const font = tex_fonts_roman[item];
fontModule->fontScCB->setEnabled(providesSC(font));
fontModule->fontOsfCB->setEnabled(providesOSF(font));
void GuiDocument::sansChanged(int item)
{
+ if (fontModule->xetexCB->isChecked()) {
+ fontModule->fontScCB->setEnabled(false);
+ return;
+ }
string const font = tex_fonts_sans[item];
bool scaleable = providesScale(font);
fontModule->scaleSansSB->setEnabled(scaleable);
void GuiDocument::ttChanged(int item)
{
+ if (fontModule->xetexCB->isChecked()) {
+ fontModule->fontScCB->setEnabled(false);
+ return;
+ }
string const font = tex_fonts_monospaced[item];
bool scaleable = providesScale(font);
fontModule->scaleTypewriterSB->setEnabled(scaleable);
bp_.float_placement = floatModule->get();
// fonts
- bp_.fontsRoman =
- tex_fonts_roman[fontModule->fontsRomanCO->currentIndex()];
-
- bp_.fontsSans =
- tex_fonts_sans[fontModule->fontsSansCO->currentIndex()];
+ bool const xetex = fontModule->xetexCB->isChecked();
+ bp_.useXetex = xetex;
- bp_.fontsTypewriter =
- tex_fonts_monospaced[fontModule->fontsTypewriterCO->currentIndex()];
+ if (xetex) {
+ if (fontModule->fontsRomanCO->currentIndex() == 0)
+ bp_.fontsRoman = "default";
+ else
+ bp_.fontsRoman =
+ fromqstr(fontModule->fontsRomanCO->currentText());
+
+ if (fontModule->fontsSansCO->currentIndex() == 0)
+ bp_.fontsSans = "default";
+ else
+ bp_.fontsSans =
+ fromqstr(fontModule->fontsSansCO->currentText());
+
+ if (fontModule->fontsTypewriterCO->currentIndex() == 0)
+ bp_.fontsTypewriter = "default";
+ else
+ bp_.fontsTypewriter =
+ fromqstr(fontModule->fontsTypewriterCO->currentText());
+ } else {
+ bp_.fontsRoman =
+ tex_fonts_roman[fontModule->fontsRomanCO->currentIndex()];
+
+ bp_.fontsSans =
+ tex_fonts_sans[fontModule->fontsSansCO->currentIndex()];
+
+ bp_.fontsTypewriter =
+ tex_fonts_monospaced[fontModule->fontsTypewriterCO->currentIndex()];
+ }
bp_.fontsCJK =
fromqstr(fontModule->cjkFontLE->text());
updateFontsize(documentClass().opt_fontsize(),
bp_.fontsize);
- int n = findToken(tex_fonts_roman, bp_.fontsRoman);
- if (n >= 0) {
- fontModule->fontsRomanCO->setCurrentIndex(n);
- romanChanged(n);
- }
+ fontModule->xetexCB->setChecked(bp_.useXetex);
- n = findToken(tex_fonts_sans, bp_.fontsSans);
- if (n >= 0) {
- fontModule->fontsSansCO->setCurrentIndex(n);
- sansChanged(n);
- }
-
- n = findToken(tex_fonts_monospaced, bp_.fontsTypewriter);
- if (n >= 0) {
- fontModule->fontsTypewriterCO->setCurrentIndex(n);
- ttChanged(n);
+ if (bp_.useXetex) {
+ for (int i = 0; i < fontModule->fontsRomanCO->count(); ++i) {
+ if (fontModule->fontsRomanCO->itemText(i) == toqstr(bp_.fontsRoman)) {
+ fontModule->fontsRomanCO->setCurrentIndex(i);
+ return;
+ }
+ }
+
+ for (int i = 0; i < fontModule->fontsSansCO->count(); ++i) {
+ if (fontModule->fontsSansCO->itemText(i) == toqstr(bp_.fontsSans)) {
+ fontModule->fontsSansCO->setCurrentIndex(i);
+ return;
+ }
+ }
+ for (int i = 0; i < fontModule->fontsTypewriterCO->count(); ++i) {
+ if (fontModule->fontsTypewriterCO->itemText(i) ==
+ toqstr(bp_.fontsTypewriter)) {
+ fontModule->fontsTypewriterCO->setCurrentIndex(i);
+ return;
+ }
+ }
+ } else {
+ int n = findToken(tex_fonts_roman, bp_.fontsRoman);
+ if (n >= 0) {
+ fontModule->fontsRomanCO->setCurrentIndex(n);
+ romanChanged(n);
+ }
+
+ n = findToken(tex_fonts_sans, bp_.fontsSans);
+ if (n >= 0) {
+ fontModule->fontsSansCO->setCurrentIndex(n);
+ sansChanged(n);
+ }
+
+ n = findToken(tex_fonts_monospaced, bp_.fontsTypewriter);
+ if (n >= 0) {
+ fontModule->fontsTypewriterCO->setCurrentIndex(n);
+ ttChanged(n);
+ }
}
if (!bp_.fontsCJK.empty())
fontModule->fontOsfCB->setChecked(bp_.fontsOSF);
fontModule->scaleSansSB->setValue(bp_.fontsSansScale);
fontModule->scaleTypewriterSB->setValue(bp_.fontsTypewriterScale);
- n = findToken(GuiDocument::fontfamilies, bp_.fontsDefaultFamily);
- if (n >= 0)
- fontModule->fontsDefaultCO->setCurrentIndex(n);
+
+ int nn = findToken(GuiDocument::fontfamilies, bp_.fontsDefaultFamily);
+ if (nn >= 0)
+ fontModule->fontsDefaultCO->setCurrentIndex(nn);
// paper
bool const extern_geometry =
pdfSupportModule->pdfusetitleCB->setChecked(pdf.pdfusetitle);
pdfSupportModule->colorlinksCB->setChecked(pdf.colorlinks);
- n = findToken(backref_opts, pdf.backref);
- if (n >= 0)
- pdfSupportModule->backrefCO->setCurrentIndex(n);
+ nn = findToken(backref_opts, pdf.backref);
+ if (nn >= 0)
+ pdfSupportModule->backrefCO->setCurrentIndex(nn);
pdfSupportModule->fullscreenCB->setChecked
(pdf.pagemode == pdf.pagemode_fullscreen);
void paramsToDialog();
void updateFontsize(std::string const &, std::string const &);
+ void updateFontlist();
void updatePagestyle(std::string const &, std::string const &);
void showPreamble();
void classChanged();
void updateModuleInfo();
void modulesChanged();
-
+ void xetexChanged(bool);
private:
/// validate listings parameters and return an error message, if any
QString validateListingsParameters();
std::list<modInfoStruct> const & getModuleInfo();
/// Modules in use in current buffer
std::list<modInfoStruct> const getSelectedModules();
- ///
+ ///
std::list<modInfoStruct> const getProvidedModules();
///
std::list<modInfoStruct> const
#include "qt_helpers.h"
#include "Buffer.h"
+#include "BufferParams.h"
#include "Converter.h"
#include "Format.h"
#include "FuncRequest.h"
exports.push_back("text");
if (buffer().isLatex()) {
- exports.push_back("latex");
- exports.push_back("pdflatex");
+ if (buffer().params().useXetex)
+ exports.push_back("xetex");
+ else {
+ exports.push_back("latex");
+ exports.push_back("pdflatex");
+ }
}
else if (buffer().isDocBook())
exports.push_back("docbook");
<rect>
<x>0</x>
<y>0</y>
- <width>414</width>
- <height>268</height>
+ <width>543</width>
+ <height>361</height>
</rect>
</property>
<property name="windowTitle" >
<string>FontUi</string>
</property>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <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>
- </property>
- <property name="sizeHint" >
- <size>
- <width>391</width>
- <height>16</height>
- </size>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QCheckBox" name="xetexCB" >
+ <property name="toolTip" >
+ <string>Use the XeTeX processor, which allows access to all system fonts</string>
</property>
- </spacer>
- </item>
- <item row="5" column="0" >
- <widget class="QLabel" name="cjkFontLA" >
<property name="text" >
- <string>C&JK:</string>
- </property>
- <property name="buddy" >
- <cstring>cjkFontLE</cstring>
+ <string>Use &XeTeX</string>
</property>
</widget>
</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>
- </property>
- </widget>
- </item>
- <item row="5" column="2" colspan="2" >
- <spacer>
+ <item row="1" column="0" colspan="4" >
+ <widget class="Line" name="line" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
- <size>
- <width>151</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="7" 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="6" column="1" >
- <widget class="QCheckBox" name="fontScCB" >
- <property name="toolTip" >
- <string>Use a real small caps shape, if the font provides one</string>
- </property>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="fontsDefaultLA" >
<property name="text" >
- <string>Use true S&mall Caps</string>
+ <string>&Default Family:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>fontsDefaultCO</cstring>
</property>
</widget>
</item>
- <item row="0" column="1" >
+ <item row="2" column="1" >
<widget class="QComboBox" name="fontsDefaultCO" >
<property name="toolTip" >
<string>Select the default family for the document</string>
</property>
</widget>
</item>
- <item row="0" column="2" >
+ <item row="2" column="2" >
<widget class="QLabel" name="TextLabel2_2" >
<property name="text" >
<string>&Base Size:</string>
</property>
</widget>
</item>
- <item row="0" column="3" >
+ <item row="2" column="3" >
<widget class="QComboBox" name="fontsizeCO" >
<property name="toolTip" >
<string/>
</property>
</widget>
</item>
- <item row="0" column="0" >
- <widget class="QLabel" name="fontsDefaultLA" >
+ <item row="3" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>182</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="fontsRomanLA" >
<property name="text" >
- <string>&Default Family:</string>
+ <string>&Roman:</string>
</property>
<property name="buddy" >
- <cstring>fontsDefaultCO</cstring>
+ <cstring>fontsRomanCO</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" >
+ <widget class="QComboBox" name="fontsRomanCO" >
+ <property name="toolTip" >
+ <string>Select the roman (serif) typeface</string>
</property>
</widget>
</item>
- <item row="1" column="1" >
+ <item row="4" column="2" colspan="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
- <width>182</width>
- <height>16</height>
+ <width>131</width>
+ <height>20</height>
</size>
</property>
</spacer>
</item>
- <item row="3" column="0" >
+ <item row="5" column="0" >
<widget class="QLabel" name="fontsSansLA" >
<property name="text" >
<string>&Sans Serif:</string>
</property>
</widget>
</item>
- <item row="3" column="1" >
+ <item row="5" column="1" >
<widget class="QComboBox" name="fontsSansCO" >
<property name="toolTip" >
<string>Select the Sans Serif (grotesque) typeface</string>
</property>
</widget>
</item>
- <item row="3" column="2" >
+ <item row="5" column="2" >
<widget class="QLabel" name="scaleSansLA" >
<property name="text" >
<string>S&cale (%):</string>
</property>
</widget>
</item>
- <item row="3" column="3" >
+ <item row="5" column="3" >
<widget class="QSpinBox" name="scaleSansSB" >
<property name="toolTip" >
<string>Scale the Sans Serif font to match the base font's dimensions</string>
</property>
- <property name="maximum" >
- <number>200</number>
- </property>
<property name="minimum" >
<number>10</number>
</property>
- </widget>
- </item>
- <item row="2" column="0" >
- <widget class="QLabel" name="fontsRomanLA" >
- <property name="text" >
- <string>&Roman:</string>
- </property>
- <property name="buddy" >
- <cstring>fontsRomanCO</cstring>
- </property>
- </widget>
- </item>
- <item row="2" column="1" >
- <widget class="QComboBox" name="fontsRomanCO" >
- <property name="toolTip" >
- <string>Select the roman (serif) typeface</string>
+ <property name="maximum" >
+ <number>200</number>
</property>
</widget>
</item>
- <item row="4" column="0" >
+ <item row="6" column="0" >
<widget class="QLabel" name="fontsTypewriterLA" >
<property name="text" >
<string>&Typewriter:</string>
</property>
</widget>
</item>
- <item row="4" column="1" >
+ <item row="6" column="1" >
<widget class="QComboBox" name="fontsTypewriterCO" >
<property name="toolTip" >
<string>Select the typewriter (monospaced) typeface</string>
</property>
</widget>
</item>
- <item row="4" column="2" >
+ <item row="6" column="2" >
<widget class="QLabel" name="scaleTypewriterLA" >
<property name="text" >
<string>Sc&ale (%):</string>
</property>
</widget>
</item>
- <item row="4" column="3" >
+ <item row="6" column="3" >
<widget class="QSpinBox" name="scaleTypewriterSB" >
<property name="toolTip" >
<string>Scale the Typewriter font to match the base font's dimensions</string>
</property>
+ <property name="minimum" >
+ <number>10</number>
+ </property>
<property name="maximum" >
<number>200</number>
</property>
- <property name="minimum" >
- <number>10</number>
+ </widget>
+ </item>
+ <item row="7" column="0" >
+ <widget class="QLabel" name="cjkFontLA" >
+ <property name="text" >
+ <string>C&JK:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>cjkFontLE</cstring>
</property>
</widget>
</item>
- <item row="2" column="2" colspan="2" >
+ <item row="7" 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>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="2" colspan="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
- <width>131</width>
+ <width>151</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
+ <item row="8" 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="9" 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="10" column="0" colspan="4" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>391</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
// If this is the last paragraph, and a local_font was set upon entering
// the inset, and we're using "auto" or "default" encoding, the encoding
// should be set back to that local_font's encoding.
+ // However, do not change the encoding when XeTeX is used.
if (nextpit == paragraphs.end() && runparams_in.local_font != 0
&& runparams_in.encoding != runparams_in.local_font->language()->encoding()
- && (bparams.inputenc == "auto" || bparams.inputenc == "default")) {
+ && (bparams.inputenc == "auto" || bparams.inputenc == "default")
+ && (!bparams.useXetex)) {
runparams_in.encoding = runparams_in.local_font->language()->encoding();
os << setEncoding(runparams_in.encoding->iconvName());
}