Android Question unexpected Asian character in toast with Material font

Dave O

Well-Known Member
Licensed User
Longtime User
I'm using csBuilder to prefix toast messages with a Material-font icon (checkmark), using the Material font TTF file (so I can get the latest icons).

This worked fine until recently, when I noticed that my latest builds (using B4A 11.x) are replacing the checkmark with an Asian (?) character:

toast-strange-character.png


Android 12 is adding the app icon on the left, but both Android 11 and 12 are showing the strange character instead of the checkmark.

On Android 5, the checkmark appears normally using the same build.

I'm baffled. Any ideas?
 

Mahares

Expert
Licensed User
Longtime User
I'm baffled. Any ideas?
I think you have to use it with the BCTextengine library, not CSBuilder
B4X:
bc.Show($"[Alignment=Left][TextSize=20]
    [color=0xFFD21111][MaterialIcons=0xE5CA/][b]  B4XTable Results[/b]   
    [/color][/TextSize][/Alignment]
    "$)
 
Upvote 0

Dave O

Well-Known Member
Licensed User
Longtime User
Good idea. Attached is a minimal project that shows a checkmark on Android 5 - 10, but shows a strange character on Android 11 and 12.

It bundles the latest Material font as a TTF file in /Files, although the same thing happens using the built-in typeface.MATERIALICONS.
 

Attachments

  • toastTest1.zip
    172.1 KB · Views: 169
Last edited:
Upvote 0

Dave O

Well-Known Member
Licensed User
Longtime User
Even stranger, I seem to remember the icon appearing normally on my phone using Android 11, but only changing to the strange character once I rebuilt it using B4A 11.x and updated my phone to Android 12. But I'm not certain about that.
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Dave O

Well-Known Member
Licensed User
Longtime User
Thanks for confirming this.

I'm showing it from a service that backs up the file to the user's Google Drive, so the app has often been closed by then.

The checkmark was a slightly more glance-able way of seeing that everything worked, but not strictly necessary, so I'll remove it and leave the usual text.

Cheers!
 
Upvote 0
Top