mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
* BufferParams.{cpp,h}:
- go back to Maping=tex-text for XeTeX and use Ligatures=TeX only for LuaTeX. This gets users of older distributions (such as TeXLive 2009) back into the XeTeX game. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37402 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
6d342acf06
commit
a37190ee62
@ -1367,9 +1367,10 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
|
|||||||
|
|
||||||
// font selection must be done before loading fontenc.sty
|
// font selection must be done before loading fontenc.sty
|
||||||
string const fonts =
|
string const fonts =
|
||||||
loadFonts(fonts_roman, fonts_sans,
|
loadFonts(fonts_roman, fonts_sans, fonts_typewriter,
|
||||||
fonts_typewriter, fonts_expert_sc, fonts_old_figures,
|
fonts_expert_sc, fonts_old_figures,
|
||||||
fonts_sans_scale, fonts_typewriter_scale, useNonTeXFonts);
|
fonts_sans_scale, fonts_typewriter_scale,
|
||||||
|
useNonTeXFonts, features);
|
||||||
if (!fonts.empty()) {
|
if (!fonts.empty()) {
|
||||||
os << from_ascii(fonts);
|
os << from_ascii(fonts);
|
||||||
nlines =
|
nlines =
|
||||||
@ -2583,7 +2584,8 @@ string const BufferParams::loadFonts(string const & rm,
|
|||||||
string const & sf, string const & tt,
|
string const & sf, string const & tt,
|
||||||
bool const & sc, bool const & osf,
|
bool const & sc, bool const & osf,
|
||||||
int const & sfscale, int const & ttscale,
|
int const & sfscale, int const & ttscale,
|
||||||
bool const & use_systemfonts) const
|
bool const & use_systemfonts,
|
||||||
|
LaTeXFeatures & features) const
|
||||||
{
|
{
|
||||||
/* The LaTeX font world is in a flux. In the PSNFSS font interface,
|
/* The LaTeX font world is in a flux. In the PSNFSS font interface,
|
||||||
several packages have been replaced by others, that might not
|
several packages have been replaced by others, that might not
|
||||||
@ -2604,9 +2606,9 @@ string const BufferParams::loadFonts(string const & rm,
|
|||||||
ostringstream os;
|
ostringstream os;
|
||||||
|
|
||||||
/* Fontspec (XeTeX, LuaTeX): we provide GUI support for oldstyle
|
/* Fontspec (XeTeX, LuaTeX): we provide GUI support for oldstyle
|
||||||
* numbers (Numbers=OldStyle) and sf/tt scaling. The Ligatures=TeX
|
* numbers (Numbers=OldStyle) and sf/tt scaling. The Ligatures=TeX/
|
||||||
* option assures TeX ligatures (such as "--") are resolved.
|
* Mapping=tex-text option assures TeX ligatures (such as "--")
|
||||||
* Note that tt does not use these ligatures.
|
* are resolved. Note that tt does not use these ligatures.
|
||||||
* TODO:
|
* TODO:
|
||||||
* -- add more GUI options?
|
* -- add more GUI options?
|
||||||
* -- add more fonts (fonts for other scripts)
|
* -- add more fonts (fonts for other scripts)
|
||||||
@ -2614,8 +2616,19 @@ string const BufferParams::loadFonts(string const & rm,
|
|||||||
* OldStyle, enable/disable the widget accordingly.
|
* OldStyle, enable/disable the widget accordingly.
|
||||||
*/
|
*/
|
||||||
if (use_systemfonts) {
|
if (use_systemfonts) {
|
||||||
|
// "Mapping=tex-text" and "Ligatures=TeX" are equivalent.
|
||||||
|
// However, until v.2 (2010/07/11) fontspec only knew
|
||||||
|
// Mapping=tex-text (for XeTeX only); then "Ligatures=TeX"
|
||||||
|
// was introduced for both XeTeX and LuaTeX (LuaTeX
|
||||||
|
// didn't understand "Mapping=tex-text", while XeTeX
|
||||||
|
// understood both. With most recent versions, both
|
||||||
|
// variants are understood by both engines. However,
|
||||||
|
// we want to provide support for at least TeXLive 2009.
|
||||||
|
string const texmapping =
|
||||||
|
(features.runparams().flavor == OutputParams::XETEX) ?
|
||||||
|
"Mapping=tex-text" : "Ligatures=TeX";
|
||||||
if (rm != "default") {
|
if (rm != "default") {
|
||||||
os << "\\setmainfont[Ligatures=TeX";
|
os << "\\setmainfont[" << texmapping;
|
||||||
if (osf)
|
if (osf)
|
||||||
os << ",Numbers=OldStyle";
|
os << ",Numbers=OldStyle";
|
||||||
os << "]{" << parseFontName(rm) << "}\n";
|
os << "]{" << parseFontName(rm) << "}\n";
|
||||||
@ -2625,10 +2638,10 @@ string const BufferParams::loadFonts(string const & rm,
|
|||||||
if (sfscale != 100)
|
if (sfscale != 100)
|
||||||
os << "\\setsansfont[Scale="
|
os << "\\setsansfont[Scale="
|
||||||
<< float(sfscale) / 100
|
<< float(sfscale) / 100
|
||||||
<< ",Ligatures=TeX]{"
|
<< "," << texmapping << "]{"
|
||||||
<< sans << "}\n";
|
<< sans << "}\n";
|
||||||
else
|
else
|
||||||
os << "\\setsansfont[Ligatures=TeX]{"
|
os << "\\setsansfont[" << texmapping << "]{"
|
||||||
<< sans << "}\n";
|
<< sans << "}\n";
|
||||||
}
|
}
|
||||||
if (tt != "default") {
|
if (tt != "default") {
|
||||||
|
@ -374,7 +374,8 @@ public:
|
|||||||
std::string const & sf, std::string const & tt,
|
std::string const & sf, std::string const & tt,
|
||||||
bool const & sc, bool const & osf,
|
bool const & sc, bool const & osf,
|
||||||
int const & sfscale, int const & ttscale,
|
int const & sfscale, int const & ttscale,
|
||||||
bool const & use_nonlatexfonts) const;
|
bool const & use_nonlatexfonts,
|
||||||
|
LaTeXFeatures & features) const;
|
||||||
|
|
||||||
/// get the appropriate cite engine (natbib handling)
|
/// get the appropriate cite engine (natbib handling)
|
||||||
CiteEngine citeEngine() const;
|
CiteEngine citeEngine() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user