qtawesome.load_font¶
- qtawesome.load_font(prefix, ttf_filename, charmap_filename, directory=None)[source]¶
Loads a font file and the associated charmap.
If
directory
is passed, the files will be looked for in the qtawesomefonts
directory.- Parameters
Example
If you want to load a font
myicon.tff
with amyicon-charmap.json
charmap added to the qtawesomefonts
directory (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.tff
with amyicon-charmap.json
charmap located in a specific path outside the qtawesomefont
directory like for example/path/to/myproject/fonts
you can use:qta.load_font( 'myicon', 'myicon.ttf', 'myicon-charmap.json', directory='/path/to/myproject/fonts' )