Ability to change font sizes for each variant

tuicemen

Member
Licensed User
Longtime User
I'd like to see the ability to change text sizes for each variant.

Is there currently a way to change the font size for each variant?
This doesn't work in the designer

Currently you can change buttons, lables etc to larger sizes for larger layout variants.
However you can not change the font sizes for the larger buttons without also increasing the size in the smaller variant.

Sizes are fine when the app is run on a Phone but when run on a larger tablet the size of the font is small in relation to the larger buttons
 

tuicemen

Member
Licensed User
Longtime User
Yes, you can do it in the designer script.
OK I'm doing something wrong!
If I change the font size for a button for a 10" layout the size also changes for a 3" layout.
If I make the font smaller so it fits buttons in the 3" view the font also shrinks for the 10"
What am I missing? I'm using the latest build.
:sign0085:
 

tuicemen

Member
Licensed User
Longtime User
AH!
I'm not using the designer script!:sign0161:
Thanks Ere I'll play with this.
 

tuicemen

Member
Licensed User
Longtime User
Ok I started to Play with the designer script (very cool for repositioning things in relation to screen sizes)
However I still can't get the text to resize for the larger buttons
I'm using:
B4X:
delta = ((100%x + 100%y) / (320dip + 480dip) - 1)
rate = 0.2
scale = 1 + rate * delta
Button1.textsize= 10 * scale
Button2.textsize= 10 * scale
Button3.textsize= 10 * scale
CheckBox1.textsize= 10 *scale
Checkbox2.textsize= 10 * scale
if the text size is 10 it stays at 10 for the larger buttons(checkbox text also doesn't resize).
Am I still missing something or is it a bug in ver. 2.00?
 

tuicemen

Member
Licensed User
Longtime User
The scale parameter is not related to the button's size. It scales the values based on the device physical size.

So currently there is no way to have a different size text for larger buttons on larger device sizes?
The buttons scale fine however the text size of 10 looks fine on a phone but tinny on a 10" tablet.
Maybe you can add that to the wishlist?
Is there some sort of workarround others are using to overcome this?
:sign0163:
 

tuicemen

Member
Licensed User
Longtime User
Create a variant for the tablet and then set the button's text size in the variant script.

I'm confused
I've done this.
If I set the button text size larger for the current Larger variant size then change to the smaller variant the same info is there for the smaller.
when I run the app the text is to big for buttons on a phone.

Could you post an example?
I'm sure I'm missing something simple or I'm making it more complicated then it should be.
 

tuicemen

Member
Licensed User
Longtime User
Ok I've managed to over come some text resizing issues by using short form for text "clear" (CL)
However I'm still unable to resize the text "Unarmed" this could be fixed with a larger button.
Still text on the lower buttons need to be enlarged for the larger buttons on the larger variants.
I'm still playing with the designer script so it still needs some tweeking for the buttons.
 

Attachments

  • inputscreen.bal
    26.4 KB · Views: 240
Last edited:

tuicemen

Member
Licensed User
Longtime User
Ok however I'm unsure to do this.
Button sizing issn't the issue as they get made larger as code sits now.

I can seem to find an example for creating variant specific variables and anything on text size is vauge.(maybe I missed it)
 

tuicemen

Member
Licensed User
Longtime User
Ah I think I have it! It was right in front of me!:sign0161:
My eyes must be failing me!
I'll play some more and try this new found option!
Thanks Erel!
 

tuicemen

Member
Licensed User
Longtime User
Well I thought I had it figured out:sign0148: Not!!!
I uploaded a new bal file with my changes.
the text size stays the same small size for all variants even though the text size is specified for each variant.
I'm either missing something else (Most likely) or there is a bug for textsize.
 

tuicemen

Member
Licensed User
Longtime User
Finaly!!!
It works :icon_clap:
I feel so stupid , I was loading the wrong file forgot I had renamed it.
app was loading the wrong layout:BangHead:
 

omoba

Active Member
Licensed User
Longtime User
Tucimen,

Pls can you share the "bal" file that fixes the font size. Or can you discuss how you fixed the font issue.
 

mjtaryan

Active Member
Licensed User
Longtime User
Tucimen,

Pls can you share the "bal" file that fixes the font size. Or can you discuss how you fixed the font issue.

Yes, I too would welcome being able to see just How the problem was solved because I'm having a similar problem (my experiments results in both autoscale and altoscaleall not working as I expected).
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…