PDA

View Full Version : How to support new fonts in Qt, using .ttf file?



savaliya_ambani
21st April 2011, 15:23
hi,

i have read about the QFont, but not able to add the support of fonts required by me.

I have a Qt-4.6.2 running on ARM ,with touch screen LCD for UI. I am having a SwissFont.ttf file. i want to have all the QLineEdits to have these fonts.

There are some other files in $(QTDIR)/lib/font, but this file is not there.I dont know about the new font support in Qt. what is the method , if i want to add swiss font support?

stampede
21st April 2011, 16:29
Have you tried QFontDatabase::addApplicationFont (http://doc.trolltech.com/latest/qfontdatabase.html#addApplicationFont) ?

savaliya_ambani
22nd April 2011, 05:12
Yes, i am trying.

But, what is this?
Note: Adding application fonts on Unix/X11 platforms without fontconfig is currently not supported.

where should i do fontconfig?

stampede
22nd April 2011, 07:16
Maybe this article will help : link (http://linux.about.com/library/cmd/blcmdl3_fontconfig.htm)
There are some examples at the end of this article.
Sorry, I have no experience with this, maybe someone else can help you more.

savaliya_ambani
23rd April 2011, 04:50
I have tried to display the font families present on the board as QStringList and also seen font files in /usr/lib.

but both are different. There are nearly 25 files in /usr/lib/fonts, and the QStringList QFontDatabase::fontfamilies(Any); return only 11 families.

Why so? And what to do if i want to avail All font familes?

savaliya_ambani
25th April 2011, 14:13
Can some one please give me the hint?

savaliya_ambani
2nd May 2011, 07:45
No body is replying?

Is it because this is the first time i am doing ? I have read lot topics related to fonts. But i am not able to add the new font files.

Do i need to change the Qt Configuration For Arm Board, i am using or the other trick some experts knows.

I am really very eager to do this.