i have a sub that make a texture but the text width looks different if me compare a tablet with a phone.
why?
my goal is to have the same texture at all devices.
currently one device looks good and at the other the text is cut.
is there a way to use a static font in asset folder or something else?
or did i made a mistake?
tablet
phone
why?
my goal is to have the same texture at all devices.
currently one device looks good and at the other the text is cut.
is there a way to use a static font in asset folder or something else?
or did i made a mistake?
B4X:
Dim bmp As Bitmap
bmp = TextToBitmap2(Description,13.0,Colors.White,256,256)
B4X:
Public Sub TextToBitmap2(Texts As List,TextSize As Float, Color As Int, Width As Int,Height As Int) As Bitmap
Private Bitmap1 As Bitmap
Private Canvas1 As Canvas
Dim DestRect As Rect
DestRect.Initialize(0%x, 0%y, Width, Height)
Bitmap1.InitializeMutable( Width,Height)
Canvas1.Initialize2(Bitmap1)
Canvas1.AntiAlias = True
Canvas1.DrawColor(Color)
Dim y As Float
y = 3%y + TextSize
For Each T As String In Texts
Canvas1.DrawText(T,1%x,y,Typeface.DEFAULT,TextSize, Colors.Black ,"LEFT")
y = y + TextSize + 5dip
Next
Return Canvas1.Bitmap
End Sub
tablet
phone
Last edited: