Trolltech Home | Qt-jambi-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-jambi-interest Archive, April 2007
Load embedded fonts ?


Message 1 in thread

Hi,

Is it possible to embedd a font locally and use it as a QFont ? Or in
other words, is it possible to use TTF fonts not installed in the OS but
loaded from either the classpath or a local directory ?

-=Børge


Message 2 in thread

"Børge Austvold" <bna@xxxxxxxxxxx> wrote in message 
news:f058fv$fbm$1@xxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> Is it possible to embedd a font locally and use it as a QFont ? Or in
> other words, is it possible to use TTF fonts not installed in the OS but
> loaded from either the classpath or a local directory ?
>
> -=Børge

You can load the font using QFontDatabase::addApplicationFont, and then 
use it as you would use any installed font.

The font can be a local file, or a resource, or an already loaded 
QByteArray.

Volker



Message 3 in thread

Hi, Børge.

Børge Austvold skrev:
> Is it possible to embedd a font locally and use it as a QFont ? Or in
> other words, is it possible to use TTF fonts not installed in the OS but
> loaded from either the classpath or a local directory ?
>   

As mentioned by Volker in a separate mail, it should usually be possible 
to load fonts dynamically using QFontDatabase.addApplicationFont().

However, due to a bug in Qt 4.3, this does not work on Windows in the Qt 
Jambi beta. It will be fixed for the next release.

-- Eskil