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

Clipping the edges of fonts with bbutil_render_text()

I am noticing the rightmost and bottommost edges of some characters rendered in MyriadPro-Bold.otf with bbutil_render_text() are being clipped. The amount being clipped appears to be 1 pixel off the right and bottom for some characters. I am not seeing clipping with any other fonts that I have tried, just MyriadPro-Bold.otf so far. Is anyone else seeing this?

 

Scott

Please use plain text.
BlackBerry Development Advisor (Retired)
dtomilovskiy
Posts: 36
Registered: ‎10-26-2011
My Device: RIM Developer
My Carrier: Rogers

Re: Clipping the edges of fonts with bbutil_render_text()

Which characters do you see clipping on? HelloWorldDisplay uses MyriadPro-Bold.otf and I dont see any clipping.

 

Also, is this on a device or simulator?

 

PS I might need glasses though.

Please use plain text.
Developer
superdirt
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified

Re: Clipping the edges of fonts with bbutil_render_text()

I will PM you tonight with a screenshot. It seems to be showing up pretty clearly against my background. I'm seeing it in the device but I will try to see how it renders on the sim.

 

Thanks

Scott

Please use plain text.
Developer
guru2000at
Posts: 101
Registered: ‎02-25-2011
My Device: Playbook, q5, z10
My Carrier: TM

Re: Clipping the edges of fonts with bbutil_render_text()

Any solution to this issue yet? We're encountering the same problem with different fonts (e.g. akzidenz-grotesk-roman.ttf) in one of our Apps.

________________
mappau Dev Team
blackberry@mappau.com
twitter: mappau
Please use plain text.
BlackBerry Development Advisor (Retired)
dtomilovskiy
Posts: 36
Registered: ‎10-26-2011
My Device: RIM Developer
My Carrier: Rogers

Re: Clipping the edges of fonts with bbutil_render_text()

[ Edited ]

I am curious as to why you are using bbutil sample code to render text as opposed to cascades.

Please use plain text.
Developer
guru2000at
Posts: 101
Registered: ‎02-25-2011
My Device: Playbook, q5, z10
My Carrier: TM

Re: Clipping the edges of fonts with bbutil_render_text()

make cascades available for the pb and we are going to use it ...

________________
mappau Dev Team
blackberry@mappau.com
twitter: mappau
Please use plain text.
Developer
HorizonXP
Posts: 133
Registered: ‎03-28-2011
My Device: BlackBerry 9900 & PlayBook
My Carrier: Bell

Re: Clipping the edges of fonts with bbutil_render_text()

And what about Qt? That's available now.

Founder of Pulsecode Inc. and taab
Authomator - Two-factor authentication codes on BlackBerry 10 - http://www.xitijpatel.com/ - Follow @xitijpatel
Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Please use plain text.
Developer
guru2000at
Posts: 101
Registered: ‎02-25-2011
My Device: Playbook, q5, z10
My Carrier: TM

Re: Clipping the edges of fonts with bbutil_render_text()

you are right, but we do not want to use the qt framework. The NDK provides a class for simple rendering of text.

________________
mappau Dev Team
blackberry@mappau.com
twitter: mappau
Please use plain text.
Developer
HorizonXP
Posts: 133
Registered: ‎03-28-2011
My Device: BlackBerry 9900 & PlayBook
My Carrier: Bell

Re: Clipping the edges of fonts with bbutil_render_text()

But bbutil is not a part of the NDK, it's simply a helper class that is used in the samples. It's likely not something under active development, so it's likely unwise to use as the basis for an app.

If you're adamant about avoid Qt, then look at the freetype library. We've used it on the BB-Py Project, and it works just fine for rendering text.

Founder of Pulsecode Inc. and taab
Authomator - Two-factor authentication codes on BlackBerry 10 - http://www.xitijpatel.com/ - Follow @xitijpatel
Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Please use plain text.
BlackBerry Development Advisor (Retired)
dtomilovskiy
Posts: 36
Registered: ‎10-26-2011
My Device: RIM Developer
My Carrier: Rogers

Re: Clipping the edges of fonts with bbutil_render_text()

Bear in mind that it is a part of several samples - not a full text rendering engine as there are several intricacies when it comes to rendering text with GL/Freetype. Hence bbutil is not a general-purpose engine, but merely a collection of useful code that would otherwise be replicated over several of our samples.

 

Also, note that there exist open-source text engines that you can make use of. Not sure how big your app is, but you will quickly run into problems with non-english fonts both in terms of resource limitations and layouting with bbutil.

 

That being said, could you please PM me a distilled example that reproduces edge clipping problem? If I recall this correctly, superdirt and I could not reproduce this problem reliably. I'll look into this issue at my earliest convenience.

Please use plain text.