Can't set textFont of char 1 of a button label?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ctflatt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 243
Joined: Sun Dec 06, 2009 12:24 am
Location: Fredericktown, MO
Contact:

Can't set textFont of char 1 of a button label?

Post by ctflatt » Mon Jun 27, 2016 12:15 pm

Hello, everyone!

I am trying to set the font of the first character of a button label to a different font than the rest of the label text. I keep throwing errors (can't set this property, error in object expression, etc.) when trying combinations to get this to work.

Here is what I am using:

Code: Select all

set the textFont of char 1 of label of button "myButton" to "myFont"
This throws an error in object expression.

Code: Select all

set the textFont of button "myButton" to "myFont"
This throws an error in setting this property.

Is it possible to set the first character of a button label to a different font than the rest of the label text?

If so, could someone please point me in the right direction?

I would greatly appreciate it!

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Can't set textFont of char 1 of a button label?

Post by Klaus » Mon Jun 27, 2016 12:47 pm

Hi cflatt,
set the textFont of button "myButton" to "Arial"
is working for me without problems or errors! LC 8.01 on a Mac.

I am afraid you can only set the textfont for CHUNKS in FIELDS
but not for the label of a button.

Just tried to cheat with HTML text etc. no way, sorry.


Best

Klaus

ctflatt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 243
Joined: Sun Dec 06, 2009 12:24 am
Location: Fredericktown, MO
Contact:

Re: Can't set textFont of char 1 of a button label?

Post by ctflatt » Mon Jun 27, 2016 1:21 pm

Klaus,

Thanks for the confirmation.

I have gotten much better in my scripting these past few years, and thought I was just losing my mind.

I appreciate it.

Hope you've been well :)

Todd

By the way, I am using 8.1.0 (dp 1)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Can't set textFont of char 1 of a button label?

Post by dunbarx » Mon Jun 27, 2016 2:48 pm

Hi.

You would have to kluge the label. Maybe overlay a field onto a button with its "showName" property set to "false" ?

Craig Newman

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Can't set textFont of char 1 of a button label?

Post by MaxV » Fri Jul 08, 2016 4:02 pm

Create a label, create an image or graph, group it.
To have your custom super button, see also:
http://translate.google.com/translate?j ... li_88.html
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”