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

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

Definition at line 222 of file FontDataXML.py.

                                         :
        """ reads the unicode 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.unicodeFontData.has_key(parent)):
                self.__readUnicodeData(parent)
                
            # copy variables from parent
            unicodeDicts = list()
            for d in FontData.unicodeFontData[parent][0]:
                unicodeDicts.append(d.copy())
            unicodeTable = list(FontData.unicodeFontData[parent][1])
        else:
            # init variables
            unicodeDicts = list()
            unicodeTable = ["" for i in range(MAXUNI)]

        maps = font.getElementsByTagName("maps")
        if (len(maps) > 0):
            self.__readGlobalUni(maps[0], unicodeTable, unicodeDicts)
            self.__readFromUnicode(maps[0], unicodeDicts)

        FontData.unicodeFontData[fonttype] = (unicodeDicts, unicodeTable)


Generated by  Doxygen 1.6.0   Back to index