Bundling Fonts

26 views
Skip to first unread message

Vinayakam Murugan

unread,
Apr 13, 2011, 9:32:26 AM4/13/11
to andro...@googlegroups.com
Hello

I need to bundle specific ttf fonts along with my QML application. Do let me know if this is possible and any pointers on how this can be done.

Warm Regards
~~~~~~~~~~~~~~~
Vinayak

http://www.flickr.com/photos/rightplacerighttime/

Vinayakam Murugan

unread,
Apr 14, 2011, 9:26:21 AM4/14/11
to andro...@googlegroups.com
Hello

Any body who has tried this? Any pointers would be helpful.

Warm Regards
~~~~~~~~~~~~~~~
Vinayak

http://www.flickr.com/photos/rightplacerighttime/


Josh

unread,
Apr 14, 2011, 2:49:36 PM4/14/11
to android-qt
On Apr 14, 2:26 pm, Vinayakam Murugan <mvinaya...@gmail.com> wrote:
> I need to bundle specific ttf fonts along with my QML application. Do let
> me know if this is possible and any pointers on how this can be done.

I just did something like this to overcome the - still lingering -
Samsung font bug.

I added fonts to the "/asset" folder of the project (I'm using
Eclipse). Then I added Java code to copy the font files to the
external storage during the first run. Afterwards they are easily
accessible from Qt.

It should be possible to use QFontDatabase::addApplicationFont(<ttf
file>), but in my case the point was to *replace* the system font
folder; so I hacked "qandroidplatformintegration.cpp" to try the
custom folder first.

Josh

Sergey A. Galin

unread,
Apr 15, 2011, 9:45:27 AM4/15/11
to andro...@googlegroups.com
Hi,

We did exactly the same in our project and our plugin, only we didn't
"hack" QAndroidFontDatabase, we added it as a normal functionality :)

О©╫ О©╫О©╫., 14/04/2011 О©╫ 11:49 -0700, Josh О©╫О©╫О©╫О©╫О©╫:

--
Best regards,
Sergey A.Galin


BogDan Vatra

unread,
Apr 18, 2011, 1:54:22 PM4/18/11
to andro...@googlegroups.com
It's a know issue, assigned to Nokia
(http://bugreports.qt.nokia.com/browse/QTBUG-16675), please vote for
it :)

BogDan.

2011/4/13 Vinayakam Murugan <mvina...@gmail.com>:

Vinayakam Murugan

unread,
Apr 18, 2011, 1:57:44 PM4/18/11
to andro...@googlegroups.com
Done :)

Warm Regards
~~~~~~~~~~~~~~~
Vinayak

http://www.flickr.com/photos/rightplacerighttime/


Daniel Wood

unread,
Apr 20, 2011, 3:02:33 PM4/20/11
to android-qt
A work around could be apply a local font:

QFont AndroidFont("system/fonts/DroidSans.ttf", 6,
QFont::Bold,true);
//set font of application
QApplication::setFont(AndroidFont);

Thanks,

Dan

On Apr 18, 6:57 pm, Vinayakam Murugan <mvinaya...@gmail.com> wrote:
> Done :)
>
> Warm Regards
> ~~~~~~~~~~~~~~~
> Vinayak
>
> http://www.flickr.com/photos/rightplacerighttime/
>
> On Mon, Apr 18, 2011 at 11:24 PM, BogDan Vatra <taipanroma...@gmail.com>wrote:
>
>
>
> > It's a know issue, assigned to Nokia
> > (http://bugreports.qt.nokia.com/browse/QTBUG-16675), please vote for
> > it :)
>
> > BogDan.
>
> > 2011/4/13 Vinayakam Murugan <mvinaya...@gmail.com>:

ravi nooka

unread,
Apr 21, 2011, 6:49:12 AM4/21/11
to andro...@googlegroups.com
thanks a lot daniel!

but one interesting thing observed is it works only for bold font(QFont::Bold), any idea why is it not working for normal font?

--ravi nooka

Reply all
Reply to author
Forward
0 new messages