May 2019
Intermediate to advanced
542 pages
13h 37m
English
Now, if all platforms and operating systems (OSes) shipped with an infinite array of identically named fonts, this would be all you'd need to know about QFont. Unfortunately, that isn't the case. Most systems ship with only a handful of fonts built-in and only a few of these are universal across platforms or even different versions of a platform. Therefore, Qt has a fallback mechanism for dealing with missing fonts.
For example, suppose that we ask Qt to use a nonexistent font family, as follows:
button_font = qtg.QFont( 'Totally Nonexistant Font Family XYZ', 15.233)
Qt will not throw an error at this call or even register a warning. Instead, after not finding the font family requested, it will fall back to its ...
Read now
Unlock full access