qt-interest@trolltech.com
[Top] [All Lists]

Re: Can you ship a font with a Qt app?

Subject: Re: Can you ship a font with a Qt app?
From: Dimitri
Date: Wed, 30 Jul 2008 09:26:28 +0200
Hi,

I have built a Qt app and notice that it looks bad on some linux boxes. This results from Qts auto font substitution on machines that have only a few limited fonts ( Qt finds the best matching fonts it can.) I'm thinking to solve this problem, I should just ship and install whatever fonts I intend to use with the app. Is there a way to do so?

Note that installing a font at "system" level may depend on the administrative rights of the user installing the font: - If installing as root (typical case of an RPM package) it should be possible to add a font to "standard" locations such as /usr/share/fonts (the exact location may depends on the version of the Linux distribution). - If installing as a non-privileged user, it should be possible to install a font in the ~/.fonts directory for personal use.

In any either case, I'm not certain it's easy to automate font installation at "system" level (so that the final user doesn't have to mess with fonts). See for example:
http://linuxhelp.blogspot.com/2005/12/adding-windows-fonts-in-linux.html
http://www.linuxjournal.com/content/installing-fonts-linux

It might be easier to ship a font together with your application, then use QFontDatabase to bypass the system and load the font directly:
http://doc.trolltech.com/4.4/qfontdatabase.html#addApplicationFont

--
Dimitri

--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>