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

This commit is contained in:
Enrico Forestieri 2012-12-22 23:06:18 +01:00
parent 483b99193f
commit 25e4bf4b27

View File

@ -1447,15 +1447,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 && !features.isProvided("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";
}
}