Using fontawesome in a button

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Using fontawesome in a button

Post by quailcreek » Mon Mar 21, 2016 7:25 pm

Hi,
In LC 8 they had a pushbutton that allowed to use fontawesome to display a font icon in the button. Now that the pushbutton is not going to be supported, how do we do this with a regular button? I can make a button using tmControl2 by dragging from the ICON Library but I'd like to accomplish this from within LC.
Tom
MacBook Pro OS Mojave 10.14

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Using fontawesome in a button

Post by jacque » Tue Mar 22, 2016 5:07 pm

Set the textfont of the button to font awesome and its label to the character that is the icon you want.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Using fontawesome in a button

Post by quailcreek » Tue Mar 22, 2016 5:38 pm

Thanks Jacqueline,
I get that part. How do I determine the char to set the label? I have installed fontawesome on my Mac and I can copy/paste from the font book to the label. Is that the only way?
Tom
MacBook Pro OS Mojave 10.14

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Using fontawesome in a button

Post by jacque » Tue Mar 22, 2016 8:10 pm

I have installed fontawesome on my Mac and I can copy/paste from the font book to the label. Is that the only way?
That's how I usually do it. It's easier than memorizing the character codes. Sometimes I set up the character in a LiveCode field and take a snapshot of it, and use that as the icon. That way I don't have to include the font with my app. But if you need resizeable icons, using the font is better.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Using fontawesome in a button

Post by quailcreek » Tue Mar 22, 2016 10:10 pm

Thanks again, Jacqueline. Wasn't sure if there was another way to do it. Copy/paste works fine.
Tom
MacBook Pro OS Mojave 10.14

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Re: Using fontawesome in a button

Post by SparkOut » Tue Mar 22, 2016 10:30 pm

There are fontawesome crib sheets that you can use to look up, and info on how to use: http://forums.livecode.com/viewtopic.ph ... 0&p=128259

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Using fontawesome in a button

Post by quailcreek » Tue Mar 22, 2016 10:40 pm

Thanks, Sparkout.
When I did a search for fontawesome I looked in the iOS Development forum. Didn't think to look in the beginners forum. My bad.
Tom
MacBook Pro OS Mojave 10.14

Post Reply