// some languages are only available via polyglossia
if (features.hasPolyglossiaExclusiveLanguages())
- features.require("polyglossia");
+ features.require("polyglossia");
if (useNonTeXFonts && fontsMath() != "auto")
features.require("unicode-math");
<< from_ascii(fonts_default_family) << "}\n";
// set font encoding
- // XeTeX and LuaTeX with Unicode fonts do not need fontenc
+ // XeTeX and LuaTeX (with OS fonts) do not need fontenc
if (!useNonTeXFonts && !features.isProvided("fontenc")
&& font_encoding() != "default") {
// get main font encodings
os << "[" << from_ascii(language->polyglossiaOpts()) << "]";
os << "{" << from_ascii(language->polyglossia()) << "}\n";
// now setup the other languages
- std::map<std::string, std::string> const polylangs =
+ set<string> const polylangs =
features.getPolyglossiaLanguages();
- for (std::map<std::string, std::string>::const_iterator mit = polylangs.begin();
+ for (set<string>::const_iterator mit = polylangs.begin();
mit != polylangs.end() ; ++mit) {
+ // We do not output the options here; they are output in
+ // the language switch commands. This is safer if multiple
+ // varieties are used.
+ if (*mit == language->polyglossia())
+ continue;
os << "\\setotherlanguage";
- if (!mit->second.empty())
- os << "[" << from_ascii(mit->second) << "]";
- os << "{" << from_ascii(mit->first) << "}\n";
+ os << "{" << from_ascii(*mit) << "}\n";
}
}
vector<string> fontencs;
- // "default" means "no explicit font encoding, don't load fontenc.sty"
+ // "default" means "no explicit font encoding"
if (doc_fontenc != "default") {
fontencs = getVectorFromString(doc_fontenc);
if (!language->fontenc().empty()