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

Reply
Contributor
ishar
Posts: 10
Registered: ‎06-23-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: none

Import custom font

Hi all!

I have been struggling with non-latin characters in Cascades app and I think I know now what is the problem - only latin characters in default Cascades font. In order to correctly spell words in my language I will need to import font with more codepages.

Could you please give me some hints? I have tried http://qt-project.org/doc/qt-4.8/qfontdatabase.html#addApplicationFont, but with no luck here.

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Import custom font

There are many fonts pre-installed on the device, and probably one or more have the glyphs that you need.

Try looking at http://qt-project.org/doc/qt-4.8/qfontdatabase.html#families to list what's found on-board.

On the PlayBook, for example, I got the list here: http://pastebin.com/hsGuMVwF

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Contributor
ishar
Posts: 10
Registered: ‎06-23-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: none

Re: Import custom font

Thanks Peter, I have tried following code:

QFontDatabase fdb;
QStringList qlist = fdb.families(QFontDatabase::Latin);
for (int i = 0; i < qlist.size(); ++i)
std::cout << qlist.at(i).toLocal8Bit().constData() << std::endl;

 but it doesn't work - no error message, just quits with 'Navigator error'. This applies to both device and simulator. 

Is it me (my code :-)) or..?

Please use plain text.
BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: Import custom font

Seems there is currently no support for using custom fonts in Cascades.

 

Please request a feature in Issue Tracker: http://supportforums.blackberry.com/t5/Java-Development/Developer-Issue-Tracker/td-p/271768

 

Stuart

Please use plain text.
BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: Import custom font

Please use plain text.
Trusted Contributor
sucroid
Posts: 195
Registered: ‎03-12-2012
My Device: PlayBook
My Carrier: None

Re: Import custom font


peter9477 wrote:
There are many fonts pre-installed on the device, and probably one or more have the glyphs that you need.

Try looking at http://qt-project.org/doc/qt-4.8/qfontdatabase.html#families to list what's found on-board.

On the PlayBook, for example, I got the list here: http://pastebin.com/hsGuMVwF


Why does one need to go to a pastebin to find out about this kind of info?  Shouldn't the list be in the docs?

Sucroid.com
Sweet Apps for the Fans
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Import custom font

I don't know about "need to go to a pastebin"... I made that pastebin, after going to the QFontDatabase.families() function (which really anyone could do).

I agree there ought to be some docs though.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.