Hi,

I think the Symbian Qt port is just lacking functionality in this
department (don't know about Maemo).

You can work around this though with some Symbian specific code.
Non-damaged souls and uninterested parties, please close your eyes for
the rest of this e-mail.

You need to tell the Symbian FBS (font and bitmap server) that it
should add your font to the typeface store. You can do that with this
bit of code:

    TInt id;
    CEikonEnv::Static()->ScreenDevice()->AddFile(_L("<path to your
font file>"), id);

You don't have to explicitly add the font file, if you deploy to
\resource\fonts\ (you still need to refresh the store or reboot after
installation though), but I would advise against that, because it
complicates uninstalling and updating (the font file will be locked
after boot and you'll need to provide a small exe in your .sis file to
unload the font).

You can clean up after yourself using RemoveFile() if your app is
somewhat rarely used and you want to free up the resources.

After adding the font file to the typeface store you can use the font
in your QML elements just by referring to it in font.family property.

Juha

On Wed, Dec 8, 2010 at 12:39 PM, Cornelius Hald <h...@icandy.de> wrote:
> Hi,
>
> in my QML UI I'm loading a font out of a resource file. On Linux and
> Windows it seems to work, but on Symbian (and I think Maemo) I get the
> following error:
>
> qrc:qml/MainWindow.qml:16:5: QML FontLoader: Cannot load font:
> "qrc:qml/fonts/Ubuntu-R.ttf"
>
> This is with Qt 4.7.1. Is this a known bug or am I missing something?
>
> Thanks!
> Conny
>
>
>
> _______________________________________________
> Qt-qml mailing list
> Qt-qml@trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml
>
_______________________________________________
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to