Alphabeticised font menu

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: 10099
Joined: Fri Feb 19, 2010 10:17 am

Alphabeticised font menu

Post by richmond62 » Wed Mar 11, 2020 5:04 pm

This:

Code: Select all

on mouseDown
    put the fontNames into me
end mouseDown
gives me this:
-
LCfonts.jpg
-
[that's only part of the list 8) ]

HOWEVER
, things would be much lovelier if the font list were alphabeticised . . .

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10049
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Alphabeticised font menu

Post by FourthWorld » Wed Mar 11, 2020 5:39 pm

Let me introduce you to our friend sort:
https://livecode.com/resources/api/#liv ... _container
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Alphabeticised font menu

Post by richmond62 » Wed Mar 11, 2020 5:59 pm

I have been aware of sort for many years, but somehow, rather naively,
thought listing the fonts would automatically alphabeticise them. :wink:

Code: Select all

on mouseDown
   put the fontNames into me
   sort lines of me ascending international
end mouseDown
Last edited by richmond62 on Wed Mar 11, 2020 6:04 pm, edited 1 time in total.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10049
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Alphabeticised font menu

Post by FourthWorld » Wed Mar 11, 2020 6:04 pm

I had once thought that about file listings too, but Dr. Raney explained that the engine delivers them in the order the OS hands them to it. I suspect the same is true with font files.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Alphabeticised font menu

Post by Klaus » Wed Mar 11, 2020 6:52 pm

richmond62 wrote:
Wed Mar 11, 2020 5:59 pm
I have been aware of sort for many years, but somehow, rather naively,
thought listing the fonts would automatically alphabeticise them.
And probably even still after looking at your own screenshot? 8)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Alphabeticised font menu

Post by richmond62 » Wed Mar 11, 2020 8:16 pm

Very funny:
-
Screenshot 2020-03-11 at 21.15.44.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Alphabeticised font menu

Post by richmond62 » Wed Apr 22, 2020 7:48 am

And . . . .
-
fontz.png
fontz.png (94.21 KiB) Viewed 5977 times
-
How does one stop "all that cack" [the top bit in the snapshot] from showing up in a font list on MacOS?

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

Re: Alphabeticised font menu

Post by bogs » Wed Apr 22, 2020 9:45 am

richmond62 wrote:
Wed Apr 22, 2020 7:48 am
How does one stop "all that cack" [the top bit in the snapshot] from showing up in a font list on MacOS?
Well, you start with this code....
richmond62 wrote:
Wed Mar 11, 2020 5:59 pm

Code: Select all

on mouseDown
   put the fontNames into me
   sort lines of me ascending international
end mouseDown
...and if it were say, me, I'd modify it like this ....

Code: Select all

on mouseDown
   put the fontNames into me
   sort lines of me ascending international
   delete line 1 to 7 of me
end mouseDown
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Alphabeticised font menu

Post by richmond62 » Wed Apr 22, 2020 10:28 am

And why should it always be lines 1 to 7 that are full of crud?

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

Re: Alphabeticised font menu

Post by bogs » Wed Apr 22, 2020 10:38 am

If you see something change in a font list on MacOS, let me know.
Image

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10049
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Alphabeticised font menu

Post by FourthWorld » Wed Apr 22, 2020 10:53 am

Those aren't "crud" (how do you imagine the team has time to go out of their way to add "crud" to the engine?).

They are directives that can be used to radically simplify using fonts that adhere to OS conventions across supported platforms.

And because they're directives rather than true font names, those are likely to be filtered out of the fontNames by the engine in the near future.

For now you can use the filter command:

Code: Select all

filter tFontList without "(*)"
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Alphabeticised font menu

Post by richmond62 » Wed Apr 22, 2020 11:49 am

FourthWorld wrote:
Wed Apr 22, 2020 10:53 am
Those aren't "crud" (how do you imagine the team has time to go out of their way to add "crud" to the engine?).

Code: Select all

filter tFontList without "(*)"
What is one man's meat is another one's poison . . . so crud can stand.

Thanks.

Post Reply