Font details returned from 'start using font'

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 231
Joined: Mon Mar 01, 2010 7:13 pm
Location: London, UK

Font details returned from 'start using font'

Post by thatkeith » Wed Mar 28, 2018 9:34 am

The 'start using font file' command is superb, and the 'globally' addition is also extremely useful. What would make this even better would be returning (in some way) the system-friendly font name (and styles, differentiated from the font family name?) of the font it activates. That would eliminate the need to do a before/after difference check on the whole list of active fonts.

Currently, 'the result' is empty unless an error happened. Perhaps the activated font name details could be put in there on success and a more explicit "error" plus details could be used on failure (duplicate active font, unable to read font file, etc.)?

The current implementation is great when dealing with a known font, such as one stashed in the app bundle, but when faced with more open-ended use with a user's font library it gets much more clunky.
Senior Lecturer, LCC (University of the Arts London)
Technical Editor, MacUser (1996-2015)
President, IVRPA.org

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

Re: Font details returned from 'start using font'

Post by richmond62 » Wed Mar 28, 2018 11:00 am

If the font was loaded successfully, the start using font command puts empty into the result.
That does seem counter intuitive.

I have just tried this:

Code: Select all

put the fontFilesInUse
*** the fonts were loaded using revFontLoad ***

which, annoyingly did NOT return the fonts I had just loaded (see my stack I uploaded earlier),
but, merely, "guff" about fonts inwith the LC 8.1.8 bundle (mac OS):
/Users/richmondmathewson/LiveCode/LiveCode Community 8.1.8.app/Contents/Tools/Toolset/resources/supporting_files/fonts/fontawesome.ttf
/Users/richmondmathewson/LiveCode/LiveCode Community 8.1.8.app/Contents/Tools/Toolset/resources/supporting_files/fonts/lcideicons.ttf
The Dictionary seems a bit misleading:
the fontFilesInUse property will return the fill paths of the loaded font files.
sic

HOWEVER :D :D :D :D

Loading the fonts with 'start using font file' allows

Code: Select all

put the fontFilesInUse
to list the added files ALONG with LiveCode's own internal ones:
/Volumes/STORAGE_2/Free Fonts/Happy Clean/TTF/Happy Party.ttf
/Users/richmondmathewson/LiveCode/LiveCode Community 8.1.8.app/Contents/Tools/Toolset/resources/supporting_files/fonts/fontawesome.ttf
/Users/richmondmathewson/LiveCode/LiveCode Community 8.1.8.app/Contents/Tools/Toolset/resources/supporting_files/fonts/lcideicons.ttf

THIS
is probably what you need.
Last edited by richmond62 on Wed Mar 28, 2018 12:33 pm, edited 1 time in total.

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 231
Joined: Mon Mar 01, 2010 7:13 pm
Location: London, UK

Re: Font details returned from 'start using font'

Post by thatkeith » Wed Mar 28, 2018 11:25 am

richmond62 wrote:
Wed Mar 28, 2018 11:00 am
If the font was loaded successfully, the start using font command puts empty into the result.
That does seem counter intuitive.
Perhaps when it was implemented the result was seen as nothing more than an error trap method? Extending the result in this way would seem to be the perfect way to enhance the command's usefulness and helpfulness. Although it seems (from the Dictionary entry for Result) that the current general concept is for commands to only put something into the result if an error occurs:
LiveCode Dictionary, "Result" wrote:Many commands (such as go and find) set the value of the result function when they finish. In most cases, if the result is empty, the command was successful; if the result is not empty, the command failed and the result contains an error message. See the specific command for information about whether it sets the result function.
Whereas control structures use the result a little more freely:
LiveCode Dictionary, "Result" wrote:Use the result function to check whether the last command executed encountered an error, or get the last value returned with the control structure return.
I hope the fact that 'start using font' is a command doesn't prevent this feature request from being considered.

richmond62 wrote:I have just tried this:

put the fontFilesInUse

which, annoyingly did NOT return the fonts I had just loaded (see my stack I uploaded earlier),
but, merely, "guff" about fonts inwith the LC 8.1.8 bundle (mac OS)
That does seem counter to the Dictionary's description that fontFilesInUse reports the files that have been loaded into memory by the start using font command. Although... did you load the fonts using the older revFontLoad command? The Dictionary description only talks about fonts loaded using the newer 'start using font' command. Perhaps we've found another difference between the two methods? :o
Senior Lecturer, LCC (University of the Arts London)
Technical Editor, MacUser (1996-2015)
President, IVRPA.org

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

Re: Font details returned from 'start using font'

Post by richmond62 » Wed Mar 28, 2018 7:04 pm

start using font file and stop using font file do seem superior to revFontLoad and revFontUnload at least in as far as one can find out what's what subsequently.

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

Re: Font details returned from 'start using font'

Post by Klaus » Wed Mar 28, 2018 7:09 pm

start using font file and stop using font file do seem superior to revFontLoad and revFontUnload at least in as far as one can find out what's what subsequently.
"revFontLoad" and "reFontUnload" have been deprecated some versions ago (version 7?) and are not listed in the dictionary anymore, so all of these considerations are "moot" :-)

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 231
Joined: Mon Mar 01, 2010 7:13 pm
Location: London, UK

Re: Font details returned from 'start using font'

Post by thatkeith » Wed Mar 28, 2018 8:06 pm

Indeed. So, back to the feature request... :lol:
Senior Lecturer, LCC (University of the Arts London)
Technical Editor, MacUser (1996-2015)
President, IVRPA.org

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

Re: Font details returned from 'start using font'

Post by richmond62 » Thu Mar 29, 2018 10:27 am

deprecated some versions ago
Quite possibly, Klaus . . .

BUT on later versions of LiveCode there isn't a splash screen that pops up whenever one tries to use
something 'deprecated' saying "Oy, Mush: that's outdated stuff!"

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 231
Joined: Mon Mar 01, 2010 7:13 pm
Location: London, UK

Re: Font details returned from 'start using font'

Post by thatkeith » Thu Mar 29, 2018 10:47 am

Splash screens are so last decade...
Image
Senior Lecturer, LCC (University of the Arts London)
Technical Editor, MacUser (1996-2015)
President, IVRPA.org

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

Re: Font details returned from 'start using font'

Post by Klaus » Thu Mar 29, 2018 10:55 am

richmond62 wrote:
Thu Mar 29, 2018 10:27 am
deprecated some versions ago
Quite possibly, Klaus . . .

BUT on later versions of LiveCode there isn't a splash screen that pops up whenever one tries to use
something 'deprecated' saying "Oy, Mush: that's outdated stuff!"
I knew you would post this! :D
But this will fail silently in one of the next versions, so why not get used to not use it anymore?

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

Re: Font details returned from 'start using font'

Post by jacque » Thu Mar 29, 2018 5:08 pm

thatkeith wrote:
Thu Mar 29, 2018 10:47 am
Splash screens are so last decade...
Image
:) I found this disproportionately amusing.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bogs
Posts: 2401
Joined: Sat Feb 25, 2017 10:45 pm

Re: Font details returned from 'start using font'

Post by bogs » Thu Mar 29, 2018 6:30 pm

jacque wrote:
Thu Mar 29, 2018 5:08 pm
I found this disproportionately amusing.
It is a good one, I enjoyed it as well thatkeith :)
Image

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

Re: Font details returned from 'start using font'

Post by richmond62 » Thu Mar 29, 2018 6:36 pm

I found this disproportionately amusing.
Utterly hilarious: and it would be even better were it to be implemented 8)

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

Re: Font details returned from 'start using font'

Post by FourthWorld » Thu Mar 29, 2018 7:20 pm

You're right about "the result" being used primarily for errors, Keith. Commands that return data often put that data in "it".
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 231
Joined: Mon Mar 01, 2010 7:13 pm
Location: London, UK

Re: Font details returned from 'start using font'

Post by thatkeith » Sat Mar 31, 2018 8:07 am

Ah, of course. It – I meant ‘it’ – would be a very respectable place to put the data.
Senior Lecturer, LCC (University of the Arts London)
Technical Editor, MacUser (1996-2015)
President, IVRPA.org

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

Re: Font details returned from 'start using font'

Post by richmond62 » Sat Mar 31, 2018 8:33 am

I wonder when someone is going to set up a website to disambiguate 'it' in LiveCode:

'it' should prove interesting.

Post Reply

Return to “Feature Requests”