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
Enaud
Posts: 74
Registered: ‎02-08-2013
My Device: z10

Overridding HTML Font Size

I'm working with HTML texts that have inconsistent font sizes, I want to make them all appear the same size. I can't do anything about the HTML input itself.

 

I'm stuffing some the of HTML encoded text into a QLabel and have tried all sort of things to override the font size defined in the HTML code. Is this even possible?

 

These had no impact on the text size.

mItemDescLabel->textStyle()->setFontSize(bb::cascades::FontSize::smileyfrustrated:mall);

mItemDescLabel->textStyle()->setBase(SystemDefaults::TextStyles::smallText());

 

Thanks!

Eric

Retired
PBernhardt
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30

Re: Overridding HTML Font Size

HTML isn't really "encoded", it's just a markup language. So you could find the markup you wanted to change and modify the string yourself. Or strip out all the HTML and do your own formatting, depending on your use case.

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker