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

def khmerconverter v.1.4::modules::FontDataXML::FontData::__readLegacyData (   self,
) [private]
reads the legacy data for one font from the dom tree 

Definition at line 252 of file FontDataXML.py.

        """ reads the legacy data for one font from the dom tree """
        if (not FontData.fontElements.has_key(fonttype)):
            raise self.FontNotFoundError("Font: " + fonttype + " is unknown.")
        font = FontData.fontElements[fonttype]

        # check and resolve inheritance
        if (FontData.parents.has_key(fonttype)):
            parent = FontData.parents[fonttype]
            # do we need to load the data?
            if (not FontData.legacyFontData.has_key(parent)):
            # copy variables from parent
            legacyDict = FontData.legacyFontData[parent][0].copy()
            legacyTable = list(FontData.legacyFontData[parent][1])
            # init variables
            legacyDict = dict()
            legacyTable = [unichr(i) for i in range(MAXLEG)]

        maps = font.getElementsByTagName("maps")
        if (len(maps) > 0):
            self.__readGlobal(maps[0], legacyTable, legacyDict)
            self.__readToUnicode(maps[0], legacyDict)

        FontData.legacyFontData[fonttype] = [legacyDict, legacyTable]

Generated by  Doxygen 1.6.0   Back to index