Logo Search packages:      
Sourcecode: khmerconverter version File versions  Download package

def khmerconverter v.1.4::modules::FontDataXML::FontData::__readGlobal (   self,
  element,
  legacyTable,
  legacyDict 
) [private]
read the global replacements for legacy 

Definition at line 333 of file FontDataXML.py.

                                                            :
        """ read the global replacements for legacy """
        maps = element.getElementsByTagName("global")
        if (len(maps) < 1):
            return

        for map in maps[0].getElementsByTagName("map"):
            legacy = self.__decodeLegacy(map.getAttribute("legacy").encode("cp1252"))
            unicode = map.getAttribute("unicode")
            l = len(legacy)
            if (l == 1):
                i = ord(legacy)
                if (i >= 0 and i < MAXLEG):
                    if (legacyTable[i] == unichr(i)):
                        legacyTable[i] = unicode
                    else:
                        raise self.XMLDataError("Legacy character " + i.__hex__() + " defined twice in global.")
            elif (l > 0 and l < MAXLENGTH):
                if (not legacyDict.has_key(legacy)):
                    legacyDict[legacy] = unicode
                else:
                    raise self.XMLDataError("Legacy character " + legacy + " defined twice in global.")



Generated by  Doxygen 1.6.0   Back to index