Page 1 of 1

Finding the name of a font used in a field

Posted: Wed Sep 28, 2022 9:58 am
by richmond62
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

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

Posted: Wed Sep 28, 2022 3:26 pm
by SparkOut
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.

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

Posted: Wed Sep 28, 2022 3:40 pm
by richmond62
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.

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

Posted: Wed Sep 28, 2022 4:51 pm
by FourthWorld
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.

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

Posted: Wed Sep 28, 2022 5:12 pm
by jacque
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.

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

Posted: Wed Sep 28, 2022 8:04 pm
by richmond62
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.

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

Posted: Wed Sep 28, 2022 9:10 pm
by SparkOut
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?