Font details returned from 'start using font'
Moderator: Klaus
Font details returned from 'start using font'
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.
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.
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- Livecode Opensource Backer
- Posts: 10080
- Joined: Fri Feb 19, 2010 10:17 am
Re: Font details returned from 'start using font'
That does seem counter intuitive.If the font was loaded successfully, the start using font command puts empty into the result.
I have just tried this:
Code: Select all
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):
The Dictionary seems a bit misleading:/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
sicthe fontFilesInUse property will return the fill paths of the loaded font files.
HOWEVER




Loading the fonts with 'start using font file' allows
Code: Select all
put the fontFilesInUse
/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.
Re: Font details returned from 'start using font'
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:richmond62 wrote: ↑Wed Mar 28, 2018 11:00 amThat does seem counter intuitive.If the font was loaded successfully, the start using font command puts empty into the result.
Whereas control structures use the result a little more freely: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.
I hope the fact that 'start using font' is a command doesn't prevent this feature request from being considered.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.
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?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)

Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- Livecode Opensource Backer
- Posts: 10080
- Joined: Fri Feb 19, 2010 10:17 am
Re: Font details returned from 'start using font'
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.
Re: Font details returned from 'start using font'
"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"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.

Re: Font details returned from 'start using font'
Indeed. So, back to the feature request... 

Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- Livecode Opensource Backer
- Posts: 10080
- Joined: Fri Feb 19, 2010 10:17 am
Re: Font details returned from 'start using font'
Quite possibly, Klaus . . .deprecated some versions ago
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!"
Re: Font details returned from 'start using font'
Splash screens are so last decade...


Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
Re: Font details returned from 'start using font'
I knew you would post this!richmond62 wrote: ↑Thu Mar 29, 2018 10:27 amQuite possibly, Klaus . . .deprecated some versions ago
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!"

But this will fail silently in one of the next versions, so why not get used to not use it anymore?
Re: Font details returned from 'start using font'

Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 10080
- Joined: Fri Feb 19, 2010 10:17 am
Re: Font details returned from 'start using font'
Utterly hilarious: and it would be even better were it to be implementedI found this disproportionately amusing.

-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Font details returned from 'start using font'
You're right about "the result" being used primarily for errors, Keith. Commands that return data often put that data in "it".
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Font details returned from 'start using font'
Ah, of course. It – I meant ‘it’ – would be a very respectable place to put the data.
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- Livecode Opensource Backer
- Posts: 10080
- Joined: Fri Feb 19, 2010 10:17 am
Re: Font details returned from 'start using font'
I wonder when someone is going to set up a website to disambiguate 'it' in LiveCode:
'it' should prove interesting.
'it' should prove interesting.