Sub SetlabelText(v As Label, TFace As Typeface, txt As String)
SetPadding(v, 0, 0, 0, 0) ' we set the padding
Private vHeight As Int = v.Height ' the view's Height
Private vWidth As Int = v.Width ' the view's Width
Private tBase As Int ' the Text Base value
If vHeight > vWidth Then 'if it's taller than it is wide
tBase = vWidth ' the text size is calculated relatively to the view's Width
Else 'if it's wider than it is tall
tBase = vHeight ' the text size is calculated relatively to the view's Height
End If
'Now we get the max FontSize possible for tBase
Private CV As Canvas
CV.Initialize(v)
Private x As Int = 0
Do Until CV.MeasureStringHeight("+", TFace, x)>= tBase
x=x+1
Loop
' I want it to be about 70% of tBase
x = Floor(x * 0.7)
'Now I get the final sizes for text height with the calculated font size
Private tHeight As Int = CV.MeasureStringHeight(txt, TFace, x)
'and try to calculate the vertical origin point (x?) for the string
Private yBase As Int = Floor (vHeight - ((vHeight-tHeight)/2)) ' wich clearly eludes me!!!!
Private xBase As Int = Floor(vWidth/2)'this is horizontal origin point, center!
CV.DrawText(txt,xBase, yBase, TFace, x, Colors.Black, "CENTER")
End Sub