Saving a font as a custom property

Klaus on-rev klaus at major.on-rev.com
Fri Feb 17 13:02:46 EST 2012


Hi Lars,

Am 17.02.2012 um 18:33 schrieb Lars Brehmer:

> I have been fooling around with revFontLoad in Windows for quite a while now with varying degrees of succes, nostly very little. I found an old post that suggested saving the font as a custom property, and then when the application loads, saves that custom property as its original font. So far so good.
> 
> revFontload works when this font is already in its place (in aplication data) and so does revFontUnLoad. However I can't get the script that right that gets the custom property and saves it as a font again.
> 
> To set the custom property, I used:
> 
>    set the myFont1 of stack "fireUp" to (url("binfile:" & (specialFolderPath(26) & "/vTrainerFiles/vDeuEng/Ipa93sr.ttf")))
>    set the myFont2 of stack "fireUp" to (url("binfile:" & (specialFolderPath(26) & "/vTrainerFiles/vDeuEng/Ipa93sb.ttf")))
> 
> I think this worked because those two custom properties now contain a whole lot of gibberish characters, just like when I save a stack as a custom property. I am of course not sure if it really worked.
> 
> for then getting the custom property and saving it as its original font, I have tried both
> 
>    get the myFont1 of stack "fireUp"
>    save it as URL(binfile: & specialFolderPath(26) & "\TrainerFiles\vDeuEng\Ipa93sr.ttf")
> 
> and 
> 
>    get the myFont1 of stack "fireUp"
>    save it as (specialFolderPath(26) & "\TrainerFiles\vDeuEng\Ipa93sr.ttf")
> 
> Both of these reult in errors and and the fonts are not saved.

Don't "save as" thiswill only work for stacks!
And always use the SLASH inside of Livecode as the path delimiter!
...
put the myFont1 of stack "fireUp" into url("binfile:" & specialFolderPath(26) & "/TrainerFiles/vDeuEng/Ipa93sr.ttf")
...

> What am I doing wrong? 
> 
> Cheers,
> 
> Lars

Best

Klaus

--
Klaus Major
http://www.major-k.de
klaus at major.on-rev.com





More information about the use-livecode mailing list