Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt- Where can I find the list of fonts I can use?

Tags:

c++

qt

When setting a font in a Qt application, where can I find the list of fonts I can choose from?

Thanks.

like image 703
Simplicity Avatar asked Apr 25 '11 10:04

Simplicity


People also ask

Where does Qt look for fonts?

Qt normally uses fontconfig to provide access to system fonts. If fontconfig is not available, e.g. in dedicated embedded systems where space is at a premium, Qt will fall back to using QBasicFontDatabase . In this case, Qt applications will look for fonts in Qt's lib/fonts/ directory.

How do I add a font to QT?

To do this in Qt Creator right click on your project and click Add New, then select Qt / Qt Resource File (*. qrc file) and give it any names you want. As it is seen in the picture, I created a resource file named “resources. qrc”, and added a prefix named “fonts” and then added the font file named “komika_font.

What is QT font?

The QFont class specifies a query for a font used for drawing text.


1 Answers

You can use the QFontDatabase class to get information about available fonts in the underlying window system.

like image 184
Mat Avatar answered Oct 04 '22 11:10

Mat