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
New Developer
Posts: 24
Registered: ‎10-25-2010
My Device: Not Specified

Re: How to use custom OpenType, TrueType, WOFF fonts?

Agreed.. but sometimes there are specific requirements to use a particular font for various reasons -- consistent branding and look & feel across all supported platforms for example. Also.. maybe you're building an experience that needs to break the mould - maybe something like a game that makes more sense to make in Cascades rather than OpenGL.

Developer
Posts: 93
Registered: ‎10-29-2012
My Device: Z10
My Carrier: Various

Re: How to use custom OpenType, TrueType, WOFF fonts?

@

If anyone is controlling in this respect - it's Apple. Even so - they allow custom fonts (actually - they went a step further and made it very easy).They want you to use certain button types with icons familiar to the user. There is nothing wrong with that, but fonts should be customizable. I am not aware of any other platform that does not support it.

 

Developer
Posts: 222
Registered: ‎11-05-2011
My Device: Z10
My Carrier: Beeline

Re: How to use custom OpenType, TrueType, WOFF fonts?

Apple love designers and viceversa. That is reason why we need custom fonts! Try look at iOS app designs! Its amazing with custom design and custom fonts!
Developer
Posts: 116
Registered: ‎10-31-2012
My Device: BB10 Dev Alpha B
My Carrier: -

Re: How to use custom OpenType, TrueType, WOFF fonts?

No, because context varies.

 

The font you would want for a game for example isalmost certlainly not Slate (too cold and impersonal).

 

The fonts I need to support some categories of disabled users aren't in the list of supported fonts (e.g. signwriting for deaf users, e.g. specialized fonts to support dyslexic/dyspraxic users). And I wouldn;t expect them to be, but I do need to add them for my own apps.

 

Software platforms always come to grief when they start making assumptions about the needs of  their users; it's why platforms always need to be extensible.

Developer
Posts: 51
Registered: ‎11-23-2012
My Device: BB10 Dev Alpha
My Carrier: GiffGaff

Re: How to use custom OpenType, TrueType, WOFF fonts?

FWIW, Qt does not have it's own font rendering engine and uses the underlying platform capabilities for this.  When BB10 decides to support this in Cascades they should do it through the standard font handling classes that work on all other Qt supported platforms.

 

So, two things need to be true:

1) Platform needs to support custom fonts

2) Support for platform font database needs to be wrapped with Qt's font database classes

 

If you only have fixed text in the custom font you can work around this by pre-rendering it to images.  If you need dynamic text you have to wait for the platform to support it.

 

Contributor
Posts: 15
Registered: ‎11-16-2012
My Device: None
My Carrier: Mobitel

Re: How to use custom OpenType, TrueType, WOFF fonts?

That is why we are waiting. We've already figured that we can render the images. Hopefully this will be supported once.

Regards
Developer
Posts: 237
Registered: ‎11-24-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: Telkomsel

Re: How to use custom OpenType, TrueType, WOFF fonts?

Is it posible to use .otf file (Open Type Font) on cascades?

 

Thanks

Highlighted
Developer
Posts: 222
Registered: ‎11-05-2011
My Device: Z10
My Carrier: Beeline

Re: How to use custom OpenType, TrueType, WOFF fonts?

Font changing API will be added in future cascades SDK. Hope problem with that question will be solved.

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: How to use custom OpenType, TrueType, WOFF fonts?

The roadmap has this noted on it: https://developer.blackberry.com/cascades/download/roadmap/ (See "Custom Fonts")

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!
Developer
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified

Re: How to use custom OpenType, TrueType, WOFF fonts?

It is possible to display custom fonts using a webview. Wrap your label text with the HTML and CSS tags necessary to define font, and point to the local font asset using the url:

 

local:///assets/yourfont.ttf

 

Set the source of the webview to your label wrapped in the HTML and CSS tags.

 

This works, but using webviews hurts performance of the application.

 

Scott