There is a work around using the Android SDK, by rendering the font onto a canvas, and passing it on to a bitmap and assign that to an imageview. Anyone got a idea on how to accomplish this in B4E?
Last edited:
Sub DrawFont(MyText As String) As Bitmap
Dim MyFont As Typeface
MyFont = Typeface.LoadFromAssets("myfont.ttf")
Dim Canvas As Canvas
Dim imgCC As Bitmap
imgCC.InitializeMutable(40dip,16dip) 'sample size
Canvas.Initialize2(imgCC)
Canvas.DrawText(MyText, 0, 0, MyFont, 16, Colors.Blue, "LEFT")
Return Canvas.Bitmap
End Sub
Personally, I would not compromise simplicity and use the Android fonts.
This is still correct. Please post the error message from the logs.You should check the logs and see why it crashes.
Usually if you don't get an out of memory error then everything is fine. The garbage collector doesn't immediately releases the memory. If there is a real memory leak then eventually you will get an error.