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
Posts: 188
Registered: ‎04-07-2013
My Device: BlackBerry Z10
My Carrier: Telus

Get Correct Font Family Name

Hi, is there a docs some where about the supported font family names??

 

Thank you!!

jayvdiyk.com
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Get Correct Font Family Name

I've never found a list in the docs but it exists in qfont.h...

 

    enum StyleHint {
        Helvetica,  SansSerif = Helvetica,
        Times,      Serif = Times,
        Courier,    TypeWriter = Courier,
        OldEnglish, Decorative = OldEnglish,
        System,
        AnyStyle,
        Cursive,
        Monospace,
        Fantasy
    };

 Note that from 10.2 onwards you can define your own.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Get Correct Font Family Name

There are a lot more fonts defined in qnx6\usr\fonts\font_repository but whether you can access any of these I've never taken the time to find out.

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 188
Registered: ‎04-07-2013
My Device: BlackBerry Z10
My Carrier: Telus

Re: Get Correct Font Family Name

There is a file named SlatePro-BoldCondensed.ttf in the font repository folder. How could I use it?

What font family should I input to use that font?

I'm curious.

Thank you
jayvdiyk.com
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Get Correct Font Family Name

[ Edited ]

You would use SlatePro but as I said I haven't played around with fonts too much so don't know whether it works or not. Simple to test though.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 31
Registered: ‎03-06-2011
My Device: Not Specified

Re: Get Correct Font Family Name

[ Edited ]

So I've tried a whole bunch. This is what I've come up with for valid font family names. A whole bunch in that table above give copies of these fonts. A bunch actually give Comic Sans...

 

Here's a table

 

Give this font family name - Get this font

Slate - Slate Pro

Arial - Arial

Serif - Times New Roman

Monospace - Monospace (I don't know the font's real name)

Georgia - Georgia

Courier New - Courier New

Impact - Impact

Verdana - Verdana

Webdings - Webdings (yup. You can have the "symbols" font)

Cursive - Comic Sans

 

 

 

Let me know if you find some more that aren't repeats.