font size problem on htc hd2 (800x480px)

matahari

Member
Licensed User
Longtime User
Hy,

i´m new here and not familar with basic4ppc.
I immediately noticed a problem with the font size on my htc hd2 (running a 800x480px resolution).
I have defined the resolution manually (Designer>Form>Tools>Screen Size).
Inside the designer everything looks fine, but on my ppc the font size is much to big.

How can i handle this?

Regards

Matze
 

sitajony

Active Member
Licensed User
Hi, if you compile with the autoscale mode and you size the Label for WVGA so the size will be resized again for WVGA so 2x bigger... You must:

1°)Place your Labels for QVGA and compile in AutoScale mode.
Or
2°)Place your Labels for WVGA and compile in Normal mode...
 

matahari

Member
Licensed User
Longtime User
Wow, thatwas quick :)

Hi, if you compile with the autoscale mode and you size the Label for WVGA so the size will be resized again for WVGA so 2x bigger... You must:

1°)Place your Labels for QVGA and compile in AutoScale mode.
Or
2°)Place your Labels for WVGA and compile in Normal mode...

I have placed my labels in WVGA (height=800, width=480).
Is File>Compile>Device EXE (Alt+1) the "normal mode". I have used this, but the labels are much to big (maybe 2 times...)

Regards
 

sitajony

Active Member
Licensed User
Ho sorry, It's the font-size? (I didn't well read) Yes it's different between QVGA and WVGA you have to change simply the font-size from 8 to 4 and on your device it'll be "8" like on QVGA but on a QVGA it'll be 4 so very small...
You can write a code who check the screen resolution and set the appropriate font size...
 

matahari

Member
Licensed User
Longtime User
Ho sorry, It's the font-size? (I didn't well read) Yes it's different between QVGA and WVGA you have to change simply the font-size from 8 to 4 and on your device it'll be "8" like on QVGA but on a QVGA it'll be 4 so very small...
You can write a code who check the screen resolution and set the appropriate font size...

Ok, i have tried this:
B4X:
Sub wvga
      names() = GetControls("form1")
      For i = 0 To ArrayLen(names())-1
            If ControlType(names(i)) = "Button" OR ControlType(names(i)) = "Label" Then
         Control(names(i)).fontsize=Control(names(i)).fontsize/2         
            End If
     Next
     
End Sub

The font is smaller, i think in the right size - but now my positions are bad.
I have 4 Labels:
left | [Label description] [Value] [Label description] [Value] | right
In the designer right is right, but on the device the logical right is ~5 mm away from the physical right...

B4X:
Editor 
|.................................................|
PPC
|..............................................   |

how can I position the labels correctly?

Thanks
 

matahari

Member
Licensed User
Longtime User
Forget my last post - you are right. /2 the font-size made it right.
The rest was a problem between my ears, now it´s clear :)

Thank you very much!
 
Top