Importing fonts?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
massung
Posts: 93
Joined: Thu Mar 19, 2009 5:34 pm

Importing fonts?

Post by massung » Tue Jan 12, 2010 6:49 pm

I don't know if this is possible, but before I post a feature request I thought I'd see what others do.

Problem: The Win32 and Mac versions of my app are visually different due primarily to fonts. I develop on Mac and all the default fonts don't exist on Windows.

Solutions: I've tried several things so far, some work better than others, but I really don't like any of them currently:
  • Choose a font that does exist commonly between platforms (like "Courier"). Yuck.
  • On openStack run through fields and buttons and change the font if "Win32". Annoying.
  • Import a TT font that I like into the stack and be able to use that on all platforms. Ideal.
I'd like to to the last option there, but I don't know if that's possible. Is it? Anyone have any other suggestions?

Thanks!

Jeff M.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Importing fonts?

Post by Mark » Wed Jan 13, 2010 12:06 pm

Hi Jeff,

Download this font and save the individual font files in custom properties inside your stack.

When you stack opens, write the contents of the custom properties to files in the temporary files directory. Make sure to sure to use the original file names again, to avoid confusion. Now use the revFont external to activate the fonts when your stack opens. De-activate the fonts before the standalone quits.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: Importing fonts?

Post by teacherguy » Sat Dec 31, 2011 5:02 am

Mark wrote:...write the contents of the custom properties to files in the temporary files directory...
Mark if you have the time and inclination could you provide a brief example or explanation of how this would play out. I have read the dictionary entry and can't get my feeble brain wrapped around it. :?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Importing fonts?

Post by Mark » Sat Dec 31, 2011 4:32 pm

Hi,

You can save any file in a custom property with

Code: Select all

set the cSomeProperty of this stack to url "binfile:/Path/To/File.xyz"
and create the file with

Code: Select all

put the cSomeProperty of this stack into url "binfile:/Path/To/File.xyz"
This works with font files too.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: Importing fonts?

Post by teacherguy » Sat Dec 31, 2011 6:12 pm

Thank you

Post Reply