]> git.lyx.org Git - lyx.git/blobdiff - src/Encoding.cpp
typo
[lyx.git] / src / Encoding.cpp
index f6197af13d6ddd822e2b2036ea623e9c1c476e26..148ce0b195c44c888bbce672229a8c6d15d528a7 100644 (file)
@@ -581,36 +581,28 @@ string const Encodings::TIPAShortcut(char_type c)
 }
 
 
-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;
-
-       if (it->second.textpreamble() != "textgreek"
-           && it->second.textpreamble() != "textcyrillic"
-           && it->second.textpreamble() != "textbaltic")
-               return false;
-
-       if (preamble.empty() && it->second.textpreamble() != "textbaltic") {
-               preamble = it->second.textpreamble();
-               return true;
-       }
-       return it->second.textpreamble() == preamble;
+               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();
 }
 
 
-bool Encodings::needsScriptWrapper(string const & script, string const & fontenc)
+bool Encodings::fontencSupportsScript(string const & fontenc, string const & script)
 {
        if (script == "textgreek")
-               return (fontenc != "LGR");
-       if (script == "textcyrillic") {
-               return (fontenc != "T2A" && fontenc != "T2B"
-                       && fontenc != "T2C" && fontenc != "X2");
-       }
-       if (script == "textbaltic")
-               return (fontenc != "L7x");
+               return (fontenc == "LGR" || fontenc == "TU");
+       if (script == "textcyrillic")
+               return (fontenc == "T2A" || fontenc == "T2B" || fontenc == "T2C"
+                               || fontenc == "X2" || fontenc == "TU");
        return false;
 }