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
Developer
blackqtcoder
Posts: 145
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C
My Carrier: Telefonica Spain
Accepted Solution

List of Fonts ?

Hi guys !

I have to get a list of fonts installed in the Alpha Device, needed for a text setting pickup dialog.

 

The cascades documentation says nothing about this. How can i get it?

 

Thanks.

---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
Please use plain text.
BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: List of Fonts ?

Please use plain text.
Developer
blackqtcoder
Posts: 145
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C
My Carrier: Telefonica Spain

Re: List of Fonts ?

[ Edited ]

Thanks smacmartin for your reply, but how you know, I was thinking on cascades's native fonts, not Qt fonts.

 

However, while cascades fonts are "accesible" to us at next releases ( i hope, i hope), Qt fonts maybe are valid for my purpose.

 

Best regards.

 

---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
Please use plain text.
Developer
blackqtcoder
Posts: 145
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C
My Carrier: Telefonica Spain

Re: List of Fonts ?

Another question, smacmartin. Can I use Qt fonts with Cascades, without QFont class ? Thanks
---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
Please use plain text.
BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: List of Fonts ?

It is not documented in https://developer.blackberry.com/cascades/reference/qt_index.html so the official answer is it does not work in R4.

 

Try it and let me know.  (It's on my queue but I can't get to it today).  It might be that you can collect info with QFont and from that initialize the appropriate font, but I'd have to play to be sure this works.

 

Stuart

Please use plain text.
Developer
blackqtcoder
Posts: 145
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C
My Carrier: Telefonica Spain

Re: List of Fonts ?

Ok. I will try it.

 

Thanks again.:Yes:

---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
Please use plain text.
Developer
blackqtcoder
Posts: 145
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C
My Carrier: Telefonica Spain

Re: List of Fonts ?

That doesn't work. QFont is no supported in Cascades. I tested.

 

The other alternative is using fontFamily property and create a "hand-made" list of font families, but fontFamily has no effect too !! :

--------------

Label {

     text: "Hello world"

     textStyle {

             fontFamily: "Times New Roman"

     }

}

--------------

 

It doesn't work. All other properties work (size, fontStyle, fontWeight, etc.), except fontFamily.

A bug ? A known issue ? (i don't see in release notes)

Any ideas ?

 

Thanks.

 

 

---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
Please use plain text.
Developer
babcow
Posts: 28
Registered: ‎06-25-2009
My Device: 9930
My Carrier: China Telecom

Re: List of Fonts ?

    QFontDatabase database;
    QStringList fontList = database.families();

    foreach (const QString &family, database.families())
    {
        qDebug() << family;
    }

Please use plain text.