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
citrinetiger
Posts: 54
Registered: ‎12-04-2012
My Device: Q10
My Carrier: Verizon
Accepted Solution

Fixed Text Size

I am testing my app on the dev alpha with different font sizes. In settings, I change the device text size to the highest possible(18) and run my app. It pretty much makes my app unreadable so obviously I need to avoid this.

 

Do any of you know a way to fix the font/text size so that it is not affected by the device text-size settings? If not, could you please tell me what you are doing to combat this senario within your own apps? 

 

 

Thanks!

 

-Ali

 

 

The code below doesnt block device from resizing:

 

Label {

text: "Hello world"
verticalAlignment: VerticalAlignment.Top
horizontalAlignment: HorizontalAlignment.Left
textStyle.color: Color.create("#999999")
textStyle.fontWeight: FontWeight.W100

textStyle.fontSize: FontSize.XLarge


}

Please use plain text.
Developer
kylefowler
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: Fixed Text Size

you need to do something like this

textStyle.fontSize: FontSize.PointValue
textStyle.fontSizeValue: 10
Like all of my posts
Please use plain text.
Developer
citrinetiger
Posts: 54
Registered: ‎12-04-2012
My Device: Q10
My Carrier: Verizon

Re: Fixed Text Size

Wow, Thanks a bunch! I kept seeing those commands when I hit CTRL + SPACE but couldn't string them together properly. love this forum, thanks again!!! :smileyhappy:
Please use plain text.
Contributor
adamlu
Posts: 14
Registered: ‎11-19-2012
My Device: 9900, BB10 Simulator
My Carrier: Rogers

Re: Fixed Text Size

[ Edited ]

Anyone knows how to have a fixed font size for Button component in QML?

 

 

The below code that does work for Label and TextField, doesn't work for Button component:

 

textStyle.fontSize: FontSize.PointValue
textStyle.fontSizeValue: 10

 

 

EDIT: Created a new thread for this question because this thread was already set as Solved.

Please use plain text.
Developer
taylortbb
Posts: 137
Registered: ‎10-26-2010
My Device: Bold 9900 + PlayBook
My Carrier: Rogers

Re: Fixed Text Size

citrinetiger, PLEASE DON'T DO IT! As someone who works in accessibility and always changes the font sizes on my own device I find it quite annoying when apps set fixed font sizes.

Your app breaking under font size 18 is okay, when a user sets their font size that huge they don't expect everything to work perfectly. The only situation a fixed font size is okay (in my opinion) is when your app becomes completely unusuable at anything other than the default font size. Your app breaking at 18 shouldn't prevent users from setting 7 or 10 as their font size. For a very significant number of users an app with the font fixed at the default size is completely unusuable.

It's your app and your choice, but please consider that not all users have full vision and depend on these features.
--------
Taylor Byrnes
Please use plain text.
Developer
citrinetiger
Posts: 54
Registered: ‎12-04-2012
My Device: Q10
My Carrier: Verizon

Re: Fixed Text Size

I agree with you completely. My issue was that when I took into account a blackberry x-series(720x720) many things shifted offscreen and into oblivion. I wish RIM set up an SDK that would allow me to build for both, but unfortunately, not the case... I guess thats not completely true, but from my understanding, in order to qualify for the 10k program, my app needed to suit both 720x720 and 1280x720 resolutions. 

     If I can create an app for both, I would love to allow the user's preferred size to reflect within my app. A 720 squeeze from a 1280 resolution is impossible without a fixed font size, in my opinion. 

 

 

-Ali

Please use plain text.
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Fixed Text Size

>Anyone knows how to have a fixed font size for Button component in QML?

have you found a solution?

Please use plain text.
Developer
lewellyn
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Re: Fixed Text Size

Again, you really really really do not want to do this. But in the case of a Button, you will need a custom control.


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!
Like this post too! :smileyvery-happy:
Please use plain text.
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Fixed Text Size

Again, I really need it.

Thanks for advice.

Please use plain text.
Developer
lewellyn
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Re: Fixed Text Size

Again, use the knowledge with caution. RIM most likely did not make these controls very customizable due to the fact that most customization will annoy your users.

 

Besides those who can't see well and need the font size turned up, there are others like me who (thankfully) do not have any such needs and prefer to keep our font sizes tiny, to maximize the amount on screen.

 

You will potentially make the app unusable by the people who need it big, while annoying those of us who like things small. So, basically, the only people using your app will have things at regular size. This defeats the entire purpose of making a custom control, for almost every case.

 

Basically, unless you have a very good reason, you are probably wasting your time worrying about it as you are ensuring that the people who are "harmed" by the fixed size won't ever be seeing your work for more than a moment.



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!
Like this post too! :smileyvery-happy:
Please use plain text.