Finding the name of a font used in a field

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Finding the name of a font used in a field

Post by richmond62 » Wed Sep 28, 2022 9:58 am

So . . . happily posting non-standard font glyphs into LC fields and they show up
exactly as they do in the source . . .

So, would like to find out:

1. Is LiveCode doing something very clever with fonts on my machine?

2. What is the name of the textFont of the field into which the glyphs are being posted?

3. What is the name of the font of the posted glyphs?

This does not work:

Code: Select all

put the name of the textFont of fld "fx" into fld "fnt"
This is hugely uninformative:
-
SShot 2022-09-28 at 11.58.49.png

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

Re: Finding the name of a font used in a field

Post by SparkOut » Wed Sep 28, 2022 3:26 pm

Just a guess, but maybe use of the term "effective" might help?
Presumably the PI or scripted result are showing nothing as nothing specific has been set on that field, while it is inheriting values from a parent object, such as card or stack.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Finding the name of a font used in a field

Post by richmond62 » Wed Sep 28, 2022 3:40 pm

The field is inheriting nothing.

I pasted that glyph from a web-page into the field, and it rendered exactly, even though it is NOT a Unicode compliant glyph.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Finding the name of a font used in a field

Post by FourthWorld » Wed Sep 28, 2022 4:51 pm

richmond62 wrote:
Wed Sep 28, 2022 3:40 pm
The field is inheriting nothing.

I pasted that glyph from a web-page into the field, and it rendered exactly, even though it is NOT a Unicode compliant glyph.
Fields naturally inherit font attributes. This inheritance can be overridden, but not prevented. It's a built-in part of how objects work in LC.

But in addition to field properties, text attributes like fonts may be assigned to runs of the text within the field.

Try getting the effective textFont of char 1 of field 1, or whatever specifier matches your circumstance.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Finding the name of a font used in a field

Post by jacque » Wed Sep 28, 2022 5:12 pm

The property inspector shows that it is using the default text font for the OS, since you haven't assigned anything. The italicized fonts are generic substitutes that will change depending on the device running the app.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Finding the name of a font used in a field

Post by richmond62 » Wed Sep 28, 2022 8:04 pm

SShot 2022-09-28 at 22.02.51.png
-
Unfortunately that brings me no nearer to knowing what font that 'kko' in Bengali script is in.

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

Re: Finding the name of a font used in a field

Post by SparkOut » Wed Sep 28, 2022 9:10 pm

If nothing has been defined anywhere in the stack, then it should be using the default (text) system font on the machine in question.

You might have a look at the htmlText and rtfText for any other clues?

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”