def set_font(self, font_file): # get the font f = Font() font = f.load_font(font_file) self.font_width = len(font['i'][Font.CHARACTER_BY_ROWS][Font.ROW]) self.font_height = len(font['i'][Font.CHARACTER_BY_ROWS]) return font