def get_string_width_from_style(char_string, style): if type(char_string) not in (unicode, str): return 0 point_size = style.font.height / 0x14 # convert back to points font_name = style.font.name if not font_name: font_name = 'Arial' return int(get_string_width(font_name, point_size, char_string) * 50)
def get_string_width_from_style(char_string, style): point_size = style.font.height / 0x14 # convert back to points font_name = style.font.name return int(get_string_width(font_name, point_size, char_string) * 50)