PDA

View Full Version : how to use user define font



numen
20th April 2006, 10:07
i have a font ,it's truetype but it doesn't work
the following is the example
QString str;
str.sprintf("%d,%d",p->width(),p->height());
QFont f("8888 8888",15);//8888 8888 is font name
painter.setFont(f);
painter.drawText(200,200,str);
but it doesn't display my font ,why?
can anyone tell me how to use a font that isnot system font.

wysota
20th April 2006, 10:25
Does your font system know about that font? Which platform do you use? Does QFontDatabase know your font?