Jump to content
stewag64

Set font size automatically depending on display size

Recommended Posts

I develop a smartphone app with a tabcontrol with several tabs for some years already.

 

In order to size controls I use TGridPanelLayouts but in order to also scale font-sizes, I am still using various layout packages.

That is because I realized that the "standard" font-size is often too small on larger devices.

 

Layout packages have two drawbacks:

1. There is a bunch of layouts to update for every change in the app

2. You can never catch all existing Android display sizes, as I realize when I look at my app at other person's smartphones.

 

That is why I want to get rid of layout packages and find an algorithm that allows me to set font-sizes for labels, buttons and memos, depending on screen.width (or other device parameter).

 

Is there a general approach for this?

Does it also respect different device's dpi?

 

Thanks for any advice 

Steffen  

    

layouts.jpg

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×