manimpango.register_font

register_font(font_path)

此函数使用原生操作系统API注册字体文件,使Pango可以使用该字体。在Linux上,它被别名为fc_register_font(),而在Windows和macOS上,它使用原生API。

参数:

font_path (str) – 字体文件的相对或绝对路径。

返回:

True 表示操作没有错误。False 表示发生了未知错误

返回类型:

bool

示例

>>> register_font("C:/home/roboto.tff")
True
引发

AssertionError – 指定的 :param:`font_path` 不存在。

参数:

font_path (str)

返回类型:

None