def _reGenerateFont(self): # regenerate 'code' and 'offset' fo chars offset = 0 for ch in self.ngl_font.get_chars_list(): ch['code'], _offset = NFontConverter.font_bmpCode(ch['bitmap']) ch['offset'] = offset offset += _offset # generate code for font, return result font self.ngl_font.code = NFontCodeGen.font(self.ngl_font) return self.ngl_font
def _reGenerateFont(self): # regenerate 'code' and 'offset' fo chars offset = 0 for ch in self.ngl_font.get_chars_list(): ch['code'], _offset = NFontConverter.font_bmpCode(ch['bitmap']) ch['offset'] = offset offset += _offset # generate code for font, return result font self.ngl_font.code = NFontCodeGen.font( self.ngl_font ) return self.ngl_font
def parseFile(self, fontfile): if fontfile: with open(fontfile, 'r') as f: code = f.read() _description = self._getFontDescription(code) _name = self._parseName(_description).replace('Info', '') _start_char, _end_char = self._parseStartEndChars(_description) _pchars = self._parseChars(code) # crate NGL Font ngl_font = NGL_Font(_name) # add chars bitmaps to font offset = 0 for pch in _pchars: _, ch_offset = NFontConverter.font_bmpCode(pch['bitmap']) ngl_font.add_char(pch['char'], None, offset, pch['bitmap']) offset += ch_offset return ngl_font
def parseFile(self, fontfile): if fontfile: with open(fontfile, 'r') as f: code = f.read() _description = self._getFontDescription( code ) _name = self._parseName( _description ).replace('Info', '') _start_char, _end_char = self._parseStartEndChars( _description ) _pchars = self._parseChars( code ) # crate NGL Font ngl_font = NGL_Font( _name ) # add chars bitmaps to font offset = 0 for pch in _pchars: _, ch_offset = NFontConverter.font_bmpCode( pch['bitmap'] ) ngl_font.add_char( pch['char'], None, offset, pch['bitmap'] ) offset += ch_offset return ngl_font