Fix bug #8467: "Corrupted NFSS tables" error when Cyrillic character in an equation

(cherry picked from commit 25e4bf4b27b5b404e706ac7cf6f9f6c48cb57b33)

Conflicts:

	src/BufferParams.cpp
This commit is contained in:
Enrico Forestieri 2012-12-22 23:06:18 +01:00
parent 9f0e2bf614
commit 3eb7422bd6
2 changed files with 17 additions and 2 deletions

View File

@ -1389,15 +1389,27 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
// XeTeX and LuaTeX (with OS fonts) work without fontenc
if (font_encoding() != "default" && language->lang() != "japanese"
&& !useNonTeXFonts && !tclass.provides("fontenc")) {
docstring extra_encoding;
if (features.mustProvide("textgreek"))
extra_encoding += from_ascii("LGR");
if (features.mustProvide("textcyr")) {
if (!extra_encoding.empty())
extra_encoding.push_back(',');
extra_encoding += from_ascii("T2A");
}
if (!extra_encoding.empty() && !font_encoding().empty())
extra_encoding.push_back(',');
size_t fars = language_options.str().find("farsi");
size_t arab = language_options.str().find("arabic");
if (language->lang() == "arabic_arabi"
|| language->lang() == "farsi" || fars != string::npos
|| arab != string::npos) {
os << "\\usepackage[" << from_ascii(font_encoding())
os << "\\usepackage[" << extra_encoding
<< from_ascii(font_encoding())
<< ",LFE,LAE]{fontenc}\n";
} else {
os << "\\usepackage[" << from_ascii(font_encoding())
os << "\\usepackage[" << extra_encoding
<< from_ascii(font_encoding())
<< "]{fontenc}\n";
}
}

View File

@ -83,6 +83,9 @@ What's new
- Fix crash while exporting document with images to xhtml from the command-line
- In order to avoid NFSS problems with certain font packages, load the needed
font encodings when inserting cyrillic and/or greek characters (bug 8467).
* USER INTERFACE