Page 2 of 3

Re: Compare two lists (comparing fontName before/after)

Posted: Tue Mar 27, 2018 6:55 pm
by thatkeith
It’s quite simple - I first saw ‘start using font’ from a mailing list thread, so I started with that. Then when I saw revFontLoad it seemed to be exactly the same except for two factors: it's older (minor), and it’s less flexible. :)

Re: Compare two lists (comparing fontName before/after)

Posted: Tue Mar 27, 2018 7:00 pm
by richmond62
fontComp.png
adding Fonts.livecode.zip
Here's the stack.
(1.46 KiB) Downloaded 525 times
Button "BONGA-BONGA" contains this:

Code: Select all

on mouseUp
   put empty into fld "fDIFFS"
   put empty into fld "fBEFORE"
   put empty into fld "fAFTER"
   put the fontNames into fld "fBEFORE"
   revFontLoad "/Volumes/STORAGE_2/Free Fonts/Happy Clean/TTF/Happy Party.ttf"
   put the fontNames into fld "fAFTER"
end mouseUp
Button "BEFORE & AFTER" contains this script:

Code: Select all

on mouseUp
   put 1 into KOUNT
   put 1 into QOUNT
   put fld "fBEFORE" into CHKLIST
   repeat until line KOUNT of fld "fAFTER" is empty
      put line KOUNT of fld "fAFTER" into TOCHECK
      if CHKLIST contains TOCHECK THEN
         -- DO NIX
      else
         put TOCHECK into line QOUNT of fld "fDIFFS"
         add 1 to QOUNT
         end if
      add 1 to KOUNT
   end repeat
end mouseUp
Works like a charm.

Re: Compare two lists (comparing fontName before/after)

Posted: Tue Mar 27, 2018 7:15 pm
by jacque

Code: Select all

split pList1 by cr and null
split pList2 by cr and null
Interesting, I never thought to do that. I usually do "split as set" but I suppose there are times when empty elements might be preferable.

Re: Compare two lists (comparing fontName before/after)

Posted: Tue Mar 27, 2018 7:55 pm
by FourthWorld
jacque wrote: Tue Mar 27, 2018 7:15 pm

Code: Select all

split pList1 by cr and null
split pList2 by cr and null
Interesting, I never thought to do that. I usually do "split as set" but I suppose there are times when empty elements might be preferable.
I'm on Linux where we haven't had a working Dictionary for several versions, so I'm operating at a disadvantage here until that gets fixed: what is the "as set" option, and when was it introduced?

EDIT: Never mind - I was able to turn this up with a web search:
http://livecode.wikia.com/wiki/Split

I guess either could be used here. The two-delim method might be slightly leaner on memory, but not enough to care about.

Re: Compare two lists (comparing fontName before/after)

Posted: Tue Mar 27, 2018 8:54 pm
by bogs
FourthWorld wrote: Tue Mar 27, 2018 7:55 pm I'm on Linux where we haven't had a working Dictionary for several versions, so I'm operating at a disadvantage here until that gets fixed: what is the "as set" option, and when was it introduced?
Keep in mind there is also Brian's excellently quick web based version of the dictionary here.

Re: Compare two lists (comparing fontName before/after)

Posted: Tue Mar 27, 2018 9:53 pm
by dunbarx
Keep in mind there is also Brian's excellently quick web based version of the dictionary here.
Yep, and it was Bogs who turned me on to it. I NEVER use the built-in dictionary any longer.

I just don't have the time. Silly, I think.

Craig

Re: Compare two lists (comparing fontName before/after)

Posted: Tue Mar 27, 2018 10:24 pm
by bogs
For me, whenever I am in 8 or higher (rarely), *if* I am not using the stacks I pulled out of Mc (also rarely), then I rely on 3 sources the most heavily. In order they are -
  • The excellently quick and very resizeable Tiny Dictionary from Bernd and friends (set to start when the IDE does).
  • Max's wiki, which often goes in to more depth than the regular dictionary.
  • Brian's web version of the dictionary, which is the fastest web dictionary I ever used.

Re: Compare two lists (comparing fontName before/after)

Posted: Tue Mar 27, 2018 10:39 pm
by jacque
Keep in mind there is also Brian's excellently quick web based version of the dictionary here.
Too bad it doesn't work on mobile. (Try it on Android Chrome.) When I'm in the IDE I use the native dictionary because I rely on the script integration. I read the forums on my tablet and that's where I usually need to look up a reference.

Re: Compare two lists (comparing fontName before/after)

Posted: Tue Mar 27, 2018 10:56 pm
by thatkeith
That's a shame! It's exactly the kind of thing that would be superb to have on a 'second screen' device. It works fine on my iPad, but smaller screens seem to break the div setup.

Re: Compare two lists (comparing fontName before/after)

Posted: Tue Mar 27, 2018 11:42 pm
by jameshale
Intrigued by mention of RevFonLoad not being in the dictionary i thought i would check Brian’s online version. nope, no mention.
So i checked my Dash version (I am on my iPad away from my iMac).
Nope, no mention.
Went to github and searched the codebase.
Found this snippet from a release note.
RevFont has been removed

The revFont external library has been removed as it is no longer required.

The two commands provided by the revFont library have been superceded by commands that are built into the LiveCode engine. The replacements are:

revFontLoad -> start using font
revFontUnload -> stop using font
The note was dated Nov 2016.

As for accessing the dictionary on linux, you can use Zeal and read the Dash docset created for LiveCode. It is bsed on the current lc9rc1 release. Zeal details can be found at https://zealdocs.org

Re: Compare two lists (comparing fontName before/after)

Posted: Wed Mar 28, 2018 1:10 am
by FourthWorld
For me not having the Dictionary is the small part. The root cause is a problem when SQLite init, so I don't get the suggested handlers in the Script Editor either, not anything else that needs SQLite. :(

Re: Compare two lists (comparing fontName before/after)

Posted: Wed Mar 28, 2018 1:18 am
by bogs
jacque wrote: Tue Mar 27, 2018 10:39 pm
Keep in mind there is also Brian's excellently quick web based version of the dictionary here.
Too bad it doesn't work on mobile. (Try it on Android Chrome.) When I'm in the IDE I use the native dictionary because I rely on the script integration. I read the forums on my tablet and that's where I usually need to look up a reference.
Well, I guess I'll go take a look, surprising it wouldn't work on a tablet though. Maybe Brian will fix it :D I have a lot of confidence in that guy.

Re: Compare two lists (comparing fontName before/after)

Posted: Wed Mar 28, 2018 11:35 pm
by bwmilby
bogs wrote: Wed Mar 28, 2018 1:18 am Well, I guess I'll go take a look, surprising it wouldn't work on a tablet though. Maybe Brian will fix it :D I have a lot of confidence in that guy.
Thanks! It is on my wish list. I’m actually using the same code as in the LC dictionary. Part of the speed is that it downloads the whole dictionary when loaded so everything is just filtered locally. I would like to fix the css so it works on phones. I do use it on my iPhone, but it is cumbersome (no access to filters, have to resize to see the hamburger icon, etc.). For me it works pretty good in landscape orientation on my iPad 3. I’m a few versions behind, so I need to get an update posted to align with RC1.

When I do get the css fixed, I’ll put in a PR to include with LC so the dictionary can be made narrower than today.

Re: Compare two lists (comparing fontName before/after)

Posted: Thu Mar 29, 2018 12:02 am
by jacque
Thanks Brian, that'd be terrific. Right now it's pretty messed up on Android but I'd love to use it.

I don't know where you get your energy but ours is not to question why. ;)

Re: Compare two lists (comparing fontName before/after)

Posted: Fri Mar 30, 2018 7:38 pm
by bogs
bogs wrote: Wed Mar 28, 2018 1:18 am Well, I guess I'll go take a look, surprising it wouldn't work on a tablet though. Maybe Brian will fix it :D I have a lot of confidence in that guy.
Hmm, I borrowed a tablet and went to look at the site. It is a bit slower on the tablet (least the one I used), but it seemed functional for the most part, not some wretched mess like I was thinking you meant. Unfortunately, I don't think I could take browsing on a tablet very well.

Jacque (and anyone else that uses them), you must have the patience of a saint and the eyes of a hawk, or at least the corrective lenses that get you close enough.

I'll stick to my larger less portable devices.