To make text scale on various devices, I've used the following calculation with good results:
log("ApproximateScreenSize = " & GetDeviceLayoutValues.ApproximateScreenSize) 'use this to get your reference value
dim fontScale As Float = GetDeviceLayoutValues.ApproximateScreenSize / 4.5 'assuming Note 3 as reference device
...
someLabel.TextSize = someLabel.titleSize * fontScale
How this works:
- I set the textSize to look good on my main device (a Galaxy Note 3 with a 5.5" screen, which for some reason gets reported as 4.5" - whatever).
- For your own device, use the value from GetDeviceLayoutValues.ApproximateScreenSize as the denominator instead of 4.5 above
- On that same device, size your text normally. That gives you a baseline to work with.
- Then use the
fontScale multiplier above to adjust each label's textSize according to the physical screen size of the device it's actually running on out in User Land.
For example, on a 9" tablet, using the example above, the textSize gets doubled, which keeps the text looking roughly proportional to everything else.
I doubt this is exact, but it has worked pretty well on all devices that I've tried (actual and emulated). If there's a better way, though, I'm all ears.
Hope this helps!