Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

ATSFontActivate error

26 views
Skip to first unread message

joekoomen

unread,
Jun 6, 2018, 12:43:07 PM6/6/18
to SuperCard Discussion
Not sure if this is a problem with ATSFontActivate, the projectPath, or just my skill level...

If the font name has a space in it I get an error 41 "Never heard of that function name". The script below works, but if the font name is changed to "Anglo Regular.otf" it fails.

on startUp
     
global gFontRef1
     put
ATSFontActivate(MediaPath(AngloRegular.otf)) into gFontRef1
     open wd
2
end startUp


function MediaPath tShortFileName -- returns path to the resources folder
     
return projectPath(this proj) & "Resources:" & tShortFileName
end MediaPath

on closeProject
     
global gFontRef1
     
get ATSFontDeactivate(gFontRef1)
end closeProject

Should the font name be in quotes maybe?

Mike Yenco

unread,
Jun 6, 2018, 1:22:25 PM6/6/18
to SuperCard Discussion
Hi Joe,

In my projects I'm using:

global gUIFont
put projPath(this project) & "Yenco UI.otf" into tYencoUI
put ATSFontActivate(tYencoUI) into gUIFont

That seems to be working fine for me.  So yeah, I'm thinking the lack of quotes would be throwing things off.

Joe Koomen

unread,
Jun 6, 2018, 5:02:25 PM6/6/18
to SuperCard Discussion
Yep. This is something that should be added to the Help docs I think.

Thanks Mike

--
You received this message because you are subscribed to the Google Groups "SuperCard Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supercard-talk+unsubscribe@googlegroups.com.
To post to this group, send email to supercard-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/supercard-talk/3af44457-5b4d-446a-b2c7-f4618001d1e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Joe Koomen

Scott

unread,
Jun 6, 2018, 5:37:58 PM6/6/18
to SuperCard Discussion


On Wednesday, June 6, 2018 at 2:02:25 PM UTC-7, joekoomen wrote:
Yep. This is something that should be added to the Help docs I think.

I just looked at that entry in the help system and the fontPath is indeed quoted in the example.

Joe Koomen

unread,
Jun 6, 2018, 7:09:41 PM6/6/18
to SuperCard Discussion
Yes, but I was constructing a path to the font and I don't normally need to put the final file in quotes (although maybe I should). This is the first time it's failed for me.

--
You received this message because you are subscribed to the Google Groups "SuperCard Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supercard-talk+unsubscribe@googlegroups.com.
To post to this group, send email to supercard-talk@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Joe Koomen

Scott

unread,
Jun 7, 2018, 7:31:10 AM6/7/18
to SuperCard Discussion


On Wednesday, June 6, 2018 at 4:09:41 PM UTC-7, joekoomen wrote:
Yes, but I was constructing a path to the font and I don't normally need to put the final file in quotes (although maybe I should). This is the first time it's failed for me.

So is Mike... but he's doing it correctly.

Reply all
Reply to author
Forward
0 new messages