Icons

262 views
Skip to first unread message

Jumar Hamac

unread,
Jan 28, 2018, 5:07:52 AM1/28/18
to DroidScript
Hello everyone.

Can I use Material Icons instead of Font Awesome Icons. Thanks a lot.

Dave Smart

unread,
Jan 31, 2018, 8:23:10 AM1/31/18
to DroidScript
You can load custom ttf fonts into textviews and buttons with the SetFontFile() method.  So if you can find a material style icon font, then that should work.

Mikhael

unread,
Oct 20, 2020, 5:11:34 AM10/20/20
to DroidScript
Please help

I add in assets material font with icons, but I don't understand how to display the icon

btn.SetText("[fa-user]"); //for font awesome i can add icon
btn.SetFontFile("Misc/material.ttf");
btn.SetText("[]"); //??? how can I specify an icon for material fonts ?

среда, 31 января 2018 г. в 18:23:10 UTC+5, Dave:

Steve Garman

unread,
Oct 20, 2020, 6:44:20 AM10/20/20
to DroidScript
You may need to find the codepoint the font uses for the icon you want

In a meteial font I looked at, this will display a face
btn.SetText('\ue87c')

ECEisLife

unread,
Oct 20, 2020, 9:40:38 AM10/20/20
to DroidScript
In addition to Steve's suggestion

You can also try this,

btn.SetFontFile("Misc/material.ttf")
btn.SetText("person")

You don't need the bracket anymore.
For a list of material icons, you can search it online, but if you have installed the beta version of DroidScript,
you can find the list of material icon fonts at the Docs Section, MaterialUI->Overview->Run MUI Demos->Iconography
Or if you have DroidScript UI Kit app, its on Iconography section. Just scroll down in the list of controls.

Regards

Mikhael

unread,
Oct 21, 2020, 7:56:39 AM10/21/20
to DroidScript
Thanks all. I will try

вторник, 20 октября 2020 г. в 18:40:38 UTC+5, ECEisLife:

Tuan Nguyen

unread,
Feb 11, 2021, 8:50:20 AM2/11/21
to DroidScript
Thank you so much.
Reply all
Reply to author
Forward
0 new messages