kimstudio Active Member Licensed User Longtime User May 22, 2022 #1 Does chr() function only support 2 bytes unicode? also Asc(). I am trying to use the updated Material design icon font, which includes more than 6000 icons now, and its code is more than 2 bytes. If use chr(0xF1A29) it doens't work, however if directly copy the character to label.text it works. B4X: Label1.Text = Chr(0xF1A29) 'NO Label1.Text = "?" 'YES
Does chr() function only support 2 bytes unicode? also Asc(). I am trying to use the updated Material design icon font, which includes more than 6000 icons now, and its code is more than 2 bytes. If use chr(0xF1A29) it doens't work, however if directly copy the character to label.text it works. B4X: Label1.Text = Chr(0xF1A29) 'NO Label1.Text = "?" 'YES
Solution TILogistic May 23, 2022 B4X: Dim fx As JFX Dim IconsFont As B4XFont = xui.CreateFont(fx.LoadFont(File.DirAssets,"materialdesignicons-webfont.ttf",64),64) Label1.Font = IconsFont Label1.Text = UnicodeToString(0xF1A28) & UnicodeToString(0xF1A29) & UnicodeToString(0xF1A2A)
B4X: Dim fx As JFX Dim IconsFont As B4XFont = xui.CreateFont(fx.LoadFont(File.DirAssets,"materialdesignicons-webfont.ttf",64),64) Label1.Font = IconsFont Label1.Text = UnicodeToString(0xF1A28) & UnicodeToString(0xF1A29) & UnicodeToString(0xF1A2A)
TILogistic Expert Licensed User Longtime User May 23, 2022 #2 see [Solved] How to use new versions of Material Design Icons in AS Tab Menu Hello everyone I'm trying to use new version of Material Design Icons. So i downloaded, copied in files folder, imported with files manager and used the code bellow to show icons. Sub Class_Globals Private Root As B4XView Private xui As XUI Private ASTabMenu_horizontal As ASTabMenu... www.b4x.com use: UnicodeToString(0xF1028) Click to expand... B4X: Sub UnicodeToString (code As Int) As String Dim bc As ByteConverter Dim b() As Byte = bc.IntsToBytes(Array As Int(code)) Return BytesToString(b, 0, 4, "UTF32") End Sub Upvote 0
see [Solved] How to use new versions of Material Design Icons in AS Tab Menu Hello everyone I'm trying to use new version of Material Design Icons. So i downloaded, copied in files folder, imported with files manager and used the code bellow to show icons. Sub Class_Globals Private Root As B4XView Private xui As XUI Private ASTabMenu_horizontal As ASTabMenu... www.b4x.com use: UnicodeToString(0xF1028) Click to expand... B4X: Sub UnicodeToString (code As Int) As String Dim bc As ByteConverter Dim b() As Byte = bc.IntsToBytes(Array As Int(code)) Return BytesToString(b, 0, 4, "UTF32") End Sub
TILogistic Expert Licensed User Longtime User May 23, 2022 #3 B4X: Dim fx As JFX Dim IconsFont As B4XFont = xui.CreateFont(fx.LoadFont(File.DirAssets,"materialdesignicons-webfont.ttf",64),64) Label1.Font = IconsFont Label1.Text = UnicodeToString(0xF1A28) & UnicodeToString(0xF1A29) & UnicodeToString(0xF1A2A) Upvote 1 Solution
B4X: Dim fx As JFX Dim IconsFont As B4XFont = xui.CreateFont(fx.LoadFont(File.DirAssets,"materialdesignicons-webfont.ttf",64),64) Label1.Font = IconsFont Label1.Text = UnicodeToString(0xF1A28) & UnicodeToString(0xF1A29) & UnicodeToString(0xF1A2A)