}
-bool Encodings::isKnownScriptChar(char_type const c, string & preamble)
+string const Encodings::isKnownScriptChar(char_type const c)
{
CharInfoMap::const_iterator const it = unicodesymbols.find(c);
if (it == unicodesymbols.end())
- return false;
+ return string();
+ // FIXME: parse complex textpreamble (may be list or alternatives,
+ // e.g., "subscript,textgreek" or "textcomp|textgreek")
+ if (it->second.textpreamble() == "textgreek"
+ || it->second.textpreamble() == "textcyrillic")
+ return it->second.textpreamble();
+ return string();
+}
- if (it->second.textpreamble() != "textgreek" && it->second.textpreamble() != "textcyr")
- return false;
- if (preamble.empty()) {
- preamble = it->second.textpreamble();
- return true;
- }
- return it->second.textpreamble() == preamble;
+bool Encodings::fontencSupportsScript(string const & fontenc, string const & script)
+{
+ if (script == "textgreek")
+ return (fontenc == "LGR" || fontenc == "TU");
+ if (script == "textcyrillic")
+ return (fontenc == "T2A" || fontenc == "T2B" || fontenc == "T2C"
+ || fontenc == "X2" || fontenc == "TU");
+ return false;
}