Control of typeface size

ukimiku

Active Member
Licensed User
Longtime User
Since the advent of ICS, the user can increase the standard text size of the device. This causes problems for my app, as I need to display text with a fixed height.

How can I find out what settings the user has chosen for the standard text size of the phone, and adapt my code accordingly, so that the text displayed by my app has always the same height, no matter if/how the standard text size of the phone has been changed?

Thank you.

Regards,
 

ukimiku

Active Member
Licensed User
Longtime User
Maybe what I wrote is not clear enough to inspire replies.

When I first got the ICS update, I found that there was a new setting for the text size of the phone. Instead of "normal", I tried "bigger", and all the text in the phone menus became larger (and more easily readable), which I liked. But when I started an app that I was writing, I noticed that the text in the labels had become larger, too, although I had specified an absolute height value of "12". So, since I had learnt that the text size is provided in dip units, I expected the text size to be the same, no matter what the user set as the text size for the phone. This assumption was wrong. Instead, it seems that the new phone-wide setting for text size introduced another "multiplier" or scale-factor, this time only for text.

I would like to learn how to account for this new scale factor, so as to set the text height of my labels to an absolutely fixed value. Maybe I have to learn how to retrieve the new phone text height setting and take that into account, but don't know how.

Any ideas?

Thanks.

Regards,
 
Upvote 0

ukimiku

Active Member
Licensed User
Longtime User
Thank you, that approach is useful to know.

I wonder: why does checking whether a view is a label ensure that all views with text are being handled (a comment of yours said so)? Are text edit views also labels?

Regards,
 
Upvote 0

ukimiku

Active Member
Licensed User
Longtime User
Thanks.
 
Upvote 0
Top