Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 44
Registered: ‎06-16-2012
My Device: BB10 Dev Alpha
Accepted Solution

BB10 Dev Alpha - "QFontDatabase: Cannot find font directory /base/usr/lib/qt4/fonts"

[ Edited ]

Hi,

 

On my BB10 Dev Alpha device the Qt fonts seem to be located in:

 

/base/usr/lib/qt4/lib/fonts

 

but my app is looking for them here:

 

/base/usr/lib/qt4/fonts

 

How do I make my app look for them elsewhere? How can I set an environment variable to do this please?

 

Thanks in advance,

 

Yalnte

----------------------------------------------------------------------------------
Blog: http://partialpivot.blogspot.co.uk/
Developer
Posts: 44
Registered: ‎06-16-2012
My Device: BB10 Dev Alpha

Re: BB10 Dev Alpha - "QFontDatabase: Cannot find font directory /base/usr/lib/qt4/fonts"

[ Edited ]

I've tried the following additional code, but it is still saying it can't find the fonts in /base/usr/lib/qt4/fonts. I don't seem to be able to move them either (don't have enough permissions apparently).

 

	   QFontDatabase::removeAllApplicationFonts();
	   QString Fpath = "/base/usr/lib/qt4/lib/fonts/helvetica_80_75i.qpf";
	   QFontDatabase::addApplicationFont(Fpath);

 

 

----------------------------------------------------------------------------------
Blog: http://partialpivot.blogspot.co.uk/
Highlighted
Retired
Posts: 60
Registered: ‎05-10-2012
My Device: Blackberry 10 Alpha
My Carrier: none

Re: BB10 Dev Alpha - "QFontDatabase: Cannot find font directory /base/usr/lib/qt4/fonts"

Hello there,

 

to specify the font directory, add the following to your bar file

 

<env var="QT_QPA_FONTDIR" value="/usr/lib/qt4/lib/fonts"/>

 

This fixes the error from QFontDatabase on startup.

 

I noticed you are also attempting to use QtQui in your application, if you were not aware Cascades is a better option and has deeper integration with the system compared to QtQui, so take a look at it if you haven't done so already.

 

Cheers

Selom

Developer
Posts: 44
Registered: ‎06-16-2012
My Device: BB10 Dev Alpha

Re: BB10 Dev Alpha - "QFontDatabase: Cannot find font directory /base/usr/lib/qt4/fonts"

Thanks very much - that seems to have fixed it.

 

I'd like to use Cascades at some point, but for now I just want to get my app ported across and working in some form!

----------------------------------------------------------------------------------
Blog: http://partialpivot.blogspot.co.uk/
New Contributor
Posts: 6
Registered: ‎01-27-2013
My Device: BB10
My Carrier: Airtel

Re: BB10 Dev Alpha - "QFontDatabase: Cannot find font directory /base/usr/lib/qt4/fonts"

[ Edited ]

Hi,

I have to show the custom fonts only for some of the labels. I have keep my .ttf file in assets folder and used in Label as textStyle.fontFamily: "myfont.ttf". I have also declared





 i tried this link also but all wain

in bar file but though i'm not getting the result. Tell me if i'm wrong anywhere and how to solve this issue. Thanks in advance.