Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view preview of text size of user font in Android Studio?

Tags:

When specifying text size on Android, the suggested the best practice is to use sp font units instead of dp, since with sp the text will increase/decrease in size according to the user's display preferences. For example, on my device I can go to

Settings -> Display -> Font

and choose a preference: small, normal, large, huge (these seem to vary across devices though).

Does anyone know a way to preview the effect of this preference in Android Studio's layout preview? It would be easier than having to deploy to a device/emulator in order to test. I can't see an option for this, but maybe I'm missing it.

Related: is there a standard multiplier for what the largest ("huge") font preference equals to? Or, can this even vary across devices? If there's no upper bound to how large the text could be, the first part of my question is probably moot.

like image 703
dfinn Avatar asked Feb 14 '17 21:02

dfinn


People also ask

How do you preview fonts on Android?

Click on the font or emoji name to get a preview. Use the search to see if a font or emoji is available, and the form below to request it if it's not.

How can I tell the size of a font?

A font is often measured in pt (points). Points dictate the height of the lettering. There are approximately 72 (72.272) points in one inch or 2.54 cm. For example, the font size 72 would be about one inch tall, and 36 would be about a half of an inch.

How do I change the text size in Android Studio?

Go to File -> Settings, a new setting dialogue box will appear. Then go to Editor -> General. Now mark the checkbox Change font size with Ctrl + Mouse wheel and click on Apply button. Now to change your editor font size, you just have to press and hold Ctrl and rotate the Mouse wheel.


Video Answer


1 Answers

As of about May 2020, This can now be done via the Layout Validation feature of Android Studio 4.0. This allows you to view different Font Sizes, devices and even see your layouts from the perspective of someone with color blindness.

enter image description here

like image 198
gMale Avatar answered Sep 16 '22 18:09

gMale