# How To Embed Font in Qt Application Using QFontDatabase

You can embed a True Type font or Open Type font into your Qt application using QFontDatabase. You can link to an external font file or link to a font embedded as a resource.

First, make sure you include a reference to the QFontDatabase class:

`#include <QFontDatabase>;`

To link to an external font, do this:

```QFontDatabase database;

Or for a more reliable way, embed the font as a resource. Create a Qt resource file and add a reference to the font file you want embedded. Then use the path to the embedded resource font:

```QFontDatabase database;
```QFont f = database.font("myFont", "normal", 12);