Android Question Problems with font awesome encoding

Cadenzo

Active Member
Licensed User
Longtime User
I am using font awesome in a label with text and symols:
lblInfo.Text = Chr(0xF0A4) & " Töne"
On some devices it works perfect, but on others I have problems with the encoding.
So the umlaut 'ö' is not displayed.
Can I set a label property or force something in the Manifest-Editor to fix that?
 

Cadenzo

Active Member
Licensed User
Longtime User
This sub makes it easy to mix awesome symbols and text in a label

B4X:
Sub SetLabelAwesomeText(lab As Label, text As String)
    Dim cs As CSBuilder
    If text = "" Then
        lab.Text = ""
    else If Asc(text.CharAt(0)) >= 0xF000 Then 'Starts with a Awesome symbol
        lab.Text = cs.Initialize.Typeface(Typeface.FONTAWESOME).Append(text.CharAt(0)).Pop.Typeface(Typeface.DEFAULT).Append(text.SubString(1)).PopAll
    Else 'normal text
        lab.Text = cs.Initialize.Typeface(Typeface.DEFAULT).Append(text).PopAll
    End If
End Sub
 
Upvote 0
Top