Android Question B4X font size independent of OS Settings

fbritop

Active Member
Licensed User
Longtime User
Hi there,
I have an app, and I would like to keep the same font size of my app regardless of the user system text size and display size (in System Settings).

When my app is started (starter service), I define 6 font sizes that I will be using across my app. The problem is that GetUserFontScale returns me a value between 0.85 and 1.3 approx, depending on the user system settings. I have resized my fonts in the starter service, but with each different user system settings, the fonts are not the same. Is there any trick beyond?



B4X:
    bigSize=(19)
    superBigSize=(24)
    titleSize=(16)
    subTitleSize=(14)
    smallSize=(11)
    badgeSize=(10)
        
    Dim access As Accessiblity
    Log("GetUserFontScale:" & access.GetUserFontScale)
    

    bigSize=bigSize/access.GetUserFontScale
    superBigSize=superBigSize/access.GetUserFontScale
    titleSize=titleSize/access.GetUserFontScale
    subTitleSize=subTitleSize/access.GetUserFontScale
    smallSize=smallSize/access.GetUserFontScale
    badgeSize=badgeSize/access.GetUserFontScale
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…