font

class janim.utils.font.FontInfo(filepath: 'str', index: 'int', name: 'str', table: 'table__n_a_m_e')

基类:object

filepath: str
index: int
name: str
table: table__n_a_m_e
janim.utils.font.get_font_info_by_name(font_name: str) FontInfo

通过字体名得到字体文件信息

例:通过 Consolas 得到 FontInfo('C:\Windows\Fonts\consola.ttf', 0, 'Consolas', <'name' table at ...>)

janim.utils.font.get_found_infos() dict[str, FontInfo]
class janim.utils.font.Font(filepath: str | FontInfo, index: int = 0)

基类:object

filepath_to_font_map: dict[tuple[str, int], Font] = {}
static get(filepath: str) Font
static get_by_info(info: FontInfo) Font
class GlyphData(array: 'np.ndarray', advance: 'tuple[int, int]')

基类:object

array: ndarray
advance: tuple[int, int]
get_glyph_data(char: str) tuple[ndarray, tuple[int, int]]