]> git.lyx.org Git - lyx.git/blobdiff - src/Encoding.cpp
* src/LyXRC.{cpp,h}:
[lyx.git] / src / Encoding.cpp
index c6441f1dc05607d49ee8f780c7f0400ada17c3c6..c95748bea154133f2ecd90dcfeb8dca679f8fd1a 100644 (file)
@@ -23,6 +23,8 @@
 #include "support/lstrings.h"
 #include "support/unicode.h"
 
+#include <boost/cstdint.hpp>
+
 #include <sstream>
 
 #ifndef CXX_GLOBAL_CSTD
@@ -401,6 +403,25 @@ bool Encodings::isCombiningChar(char_type c)
 }
 
 
+bool Encodings::isKnownScriptChar(char_type const c, string & preamble)
+{
+       CharInfoMap::const_iterator const it = unicodesymbols.find(c);
+
+       if (it == unicodesymbols.end())
+               return false;
+
+       if (it->second.preamble != "textgreek" &&
+           it->second.preamble != "textcyr")
+               return false;
+
+       if (preamble.empty()) {
+               preamble = it->second.preamble;
+               return true;
+       }
+       return it->second.preamble == preamble;
+}
+
+
 Encoding const * Encodings::getFromLyXName(string const & name) const
 {
        EncodingList::const_iterator it = encodinglist.find(name);