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
Contributor
kuroberry
Posts: 30
Registered: ‎02-05-2013
My Device: Dev Alpha B

font size issue

Hello,

 

is there a way to lock ones app to certain font size so that it doesnt follow device's font size inside settings?

 

 

when user change the font size to bigger size for example 14, other than the Label component that I have set using TextStyleDefinition, the systemprompt, systemdialog, etc along with its button's text follow the device font size and I very much would like to prevent that.

Any help is appreciated.

Developer
zezke
Posts: 1,004
Registered: ‎12-12-2010
My Device: Z10 (red Limited Edition)

Re: font size issue

Why would you want to do that? If the user increases the font size he probably has trouble reading the standard font size.

-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Contributor
kuroberry
Posts: 30
Registered: ‎02-05-2013
My Device: Dev Alpha B

Re: font size issue

In this case, it's one of my app's requirements.
Developer
hemant_sain
Posts: 180
Registered: ‎12-09-2011
My Device: 9360, BB10

Re: font size issue

For this you can use like this in your particular label etc..

 

textStyle.fontSize: FontSize.PointValue
textStyle.fontSizeValue: 14 //Give any point value according to you whatever you want to give

 

or

 

textStyle.fontSize: FontSize.PercentageValue
textStyle.fontSizeValue: xx //Give any percentage value according to you whatever you want to give

Developer
zezke
Posts: 1,004
Registered: ‎12-12-2010
My Device: Z10 (red Limited Edition)

Re: font size issue


kuroberry wrote:
In this case, it's one of my app's requirements.

Enlighten me, what kind of app requires this behavior? Just curious :smileyhappy:

-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Developer
Enaud
Posts: 74
Registered: ‎02-08-2013
My Device: z10

Re: font size issue

I'll reply to this since I have the same 'requirement'.

 

Because my app presents a substantial amount of text information in a series of custom list items I need to ensure a certain consistency with regards to font size since at a certain size (12+) the information no longer presents itself in a functional manner.

 

I tried setting the font size in various ways (setFontSizeValue, setFontSize) but they all seem relative to the settings->display->font size setting.

 

For the sake of a consistent application presentation, can anyone suggest a way of overriding the system font size settings throughout an app?

 

-e

Developer
slashkyle
Posts: 820
Registered: ‎10-16-2012
My Device: Red Z10

Re: font size issue

[ Edited ]

If you set the desired size as a variable and then set your text size to that variable it wont change.  using pointSize and fontSize has been forced into accesibility so they're adjusted no matter what.

 

property int fixedTextSize: 8
        onCreationCompleted: {
            myLabel.textStyle.fontSizeValue = root.fixedTextSize
        }

 

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

Re: font size issue

From an accessibility perspective, I would definitely recommend modifying your application so it can deal with larger font sizes rather than attempting to hard code them. A LOT of users do not have perfect close up vision and will turn up the default font size. If you hard code the font size you are effectively preventing them from using your app.

 

It's your app so of course you can do whatever you think is going to be worth it, but this is the sort of thing that can lead to lost sales or poor reviews.

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

Re: font size issue

I completely agree with you and since there is no current ability in (10.1) to identify the font setting programmatically I was intending on implementing a configurable font setting in-app that accommodates my design.

Thanks for the feedback.