How to use a true type font?
Hi all
I have searched around and cannot find much on how to set the font of a widget. I would like to set the lineedit widget font to something.ttf (truetype font)
Firstly is this possible on Qt symbian devices such as Nokia and secondley how can i achieve this.
Any help would really be appriciated.
So far i have only tried the below code.
Code:
ui->lineEdit->setFont("fancy.ttf");
Re: How to use a true type font?
I managed to get the font working on the any widget that required it via stylesheets, but i had to copy the font into the font directory of the phone simulator! Now i need to figure out a way in which i can install the font on installation or maybe using a script to copy the font into the font dircetory!
Re: How to use a true type font?
You may use the QFontDatabase::addApplicationFont function to load a font from a file. As you want to bring the font with your application, you could use Qt’s resource compiler to store the font file.