May 2019
Intermediate to advanced
542 pages
13h 37m
English
Resource files aren't limited to images; in fact, they can be used to include just about any kind of binary, including font files. For example, suppose that we want to include our favorite font in the program to ensure that it looks right on all platforms.
Just as with images, we start by including the font file in the .qrc file:
<RCC> <qresource prefix="teams"> <file>crimson_sharks.png</file> <file>shadow_hawks.png</file> <file>night_terrors.png</file> <file>blue_crew.png</file> </qresource> <qresource prefix="fonts"> <file>LiberationSans-Regular.ttf</file> </qresource></RCC>
Here, we've added a prefix of fonts and included a reference to the LiberationSans-Regular.ttf file. After running pyrcc5 against this file, ...
Read now
Unlock full access