qtawesome.load_font¶
- qtawesome.load_font(prefix, ttf_filename, charmap_filename, directory=None)[source]¶
Loads a font file and the associated charmap.
If
directoryis passed, the files will be looked for in the qtawesomefontsdirectory.- Parameters:
Example
If you want to load a font
myicon.tffwith amyicon-charmap.jsoncharmap added to the qtawesomefontsdirectory (usually located at</path/to/lib/python>/site-packages/qtawesome/fonts/) you can use:qta.load_font( 'myicon', 'myicon.ttf', 'myicon-charmap.json' )
However, if you want to load a font
myicon.tffwith amyicon-charmap.jsoncharmap located in a specific path outside the qtawesomefontdirectory like for example/path/to/myproject/fontsyou can use:qta.load_font( 'myicon', 'myicon.ttf', 'myicon-charmap.json', directory='/path/to/myproject/fonts' )