PDA

View Full Version : Set specific font's face



Cucumber
19th November 2010, 12:43
Hi there!

Can you help me setting the specific font face?
For example, I would like to use Helvetica Neue Light font.
I've tried following method, but had no luck:

setStyleSheet("font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light';");

As well the following doesn't help neither:

setStyleSheet("font-family: 'Helvetica Neue';"
"font-width: 100;");

By the way, how can I set style for all widgets by one setStyleSheet? Is it correct to doing it by:

setStyleSheet("QWidget {bla-bla-bla}");

pan
19th November 2010, 14:36
Something like:
setStyleSheet("*{font: bold 10pt \"Arial\";}") should work on all objects.

I guess you'll have to have the font installed on you machine? and you'll need to call it from the top window (use the window() method)?

Cucumber
20th November 2010, 22:42
Thank you for "*" and "window()" methods!
And as for first question, how to set specific face of the font?

minirop
7th December 2010, 00:08
Cucumber > maybe it would work if you use the code of your first post after added the font to the database http://doc.qt.nokia.com/latest/qfontdatabase.html#addApplicationFont