You can find the maximum font size with this code:
B4X:
Sub MaxFontToFitWidth(text As String, width As Int) As Font
Dim f As Font
For i = 5 To 50
f = Font.CreateNew(i)
If text.MeasureWidth(f) > width Then
Exit
End If
Next
Return f
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.