Adjust the Font Size of components' to Phone's font size

Hi,

Different phones have different Font Sizes. So when I open the app in a phone with a small Font Size, the UI gets too small (There is too much empty space at the bottom of the screen)

Similarly, If i try it on a phone with an Increased Font Size, the components become too big.

Is there any way to auto-adjust the font size of the components to the default font size of the device?

Screenshots:

image
Phone with Big font size

image

Phone with smaller font size…

Please help me, as the UI of the second phone doesn’t look good at all…

Thanks,
Saiansh

You can see here:

1 Like

Thanks @Mohamed_Tamer

Just one quick question: In Peter’s solution, what does the FontSizeAspect parameter have to be?

and that solution is more about the phone’s size, not the font size

The default one you use, for example if your font size right now is 16 so pass 16.

But that solution is about the width of the phone, not about the Font Size of the phone

Even a small-sized phone can have a large font size (or vice-versa)

Peters solution will only work for screen size or/and if zoomed in/out…

You will have to extend the above solution with the help of this extension App Inventor Extensions: Settings | Pura Vida Apps and it’s FontScale block

something like this

4 Likes

Thanks @Boban
:smiley:

And just one more question, @Boban - What is the LTB_001_100 component? is it the Screen or an Arrangement ??

Yes :upside_down_face:

1 Like

I don’t know what’s the best option bcz if we add like this than if we have more than 100+ label in a screen than we have to do it for every block which is not a good idea…

You can make a list all the labels and then under for each item in list loop drag the set font size of label block from Any Component category and then set the font size according to the procedure block mentioned in previous replies.

Here, if you don’t want to create list of labels, then you can also create dynamic labels and then set the further blocks accordingly

5 Likes

Yes, and you should do it this way (→ ScreenOrientation):

4 Likes

Thanks @bodymindpower

Anyways I have set the Screen Orientation to Portrait :smile:

Slightly simpler blocks

7 Likes

The Best Solution To Make Component and Font Size Responsive