[PyQt] Embedding a font into a resource file

Hans-Peter Jansen hpj at urpla.net
Mon Oct 4 15:05:04 BST 2010


On Monday 04 October 2010, 15:49:07 pard wrote:
> Hi
>
> Is it possible to embed a font into a resource file and set the
> application font from the compiled resource file?

You can add __any__ data to the resource file, but you should keep in mind, 
that this data is always loaded into memory on startup.

Regarding an application font, you need to register it in the QFontDatabase 
and set it with QApplication.setFont() as the default font on startup.

Hth,
Pete



More information about the PyQt mailing list