Stretching fonts?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
SteveTX
Posts: 170
Joined: Sun Jan 17, 2010 9:00 pm

Stretching fonts?

Post by SteveTX » Mon Jun 24, 2013 2:14 am

I've mocked up my interface in Illustrator, but LC doesn't seem to have an obvious way of letting me squeeze a font to 90% of its normal width. Is there a method for this or should I take the TTF and modify it and try to include it in the stack? Can I use a custom TTF on iOS and Android mobile platforms?

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

Re: Stretching fonts?

Post by Mark » Mon Jun 24, 2013 8:56 am

Hi,

That's right, you can't do kerning in LiveCode. You'll have to find a different solution. You can make a new font or put the text into a transparent field, import a snapshot of the field to an image object and resize the image object.

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

SteveTX
Posts: 170
Joined: Sun Jan 17, 2010 9:00 pm

Re: Stretching fonts?

Post by SteveTX » Mon Jun 24, 2013 11:39 am

Thanks for the info, Mark. I see that revFontLoad only applies to Windows and Mac, not iOS / Android, so I presume making a custom font work native on the device won't work. Clearly the answer is to use images from my mockup, luckily the text is almost entirely static.

To that end, is there a list of fonts that are native to both iOS and Android so we know what fonts will work on those devices?

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

Re: Stretching fonts?

Post by Mark » Mon Jun 24, 2013 11:45 am

Hi,

You can include a font with your standalone on iOS and Android and it will work. For info about fonts, you can search the internet. You can also use the fontNames function.

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

SteveTX
Posts: 170
Joined: Sun Jan 17, 2010 9:00 pm

Re: Stretching fonts?

Post by SteveTX » Mon Jun 24, 2013 6:13 pm

How does the include for fonts on iOS/android work if not through revFontLoad?

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

Re: Stretching fonts?

Post by Mark » Mon Jun 24, 2013 6:21 pm

Hi,

Just include the font in the standalone, e.g. in the Copy Files section of the standalone settings window. The font should load automatically and will then be available for use. Make sure that the font file is in the same directory as the engine, i.e. add the individual files and not a folder.

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

SteveTX
Posts: 170
Joined: Sun Jan 17, 2010 9:00 pm

Re: Stretching fonts?

Post by SteveTX » Tue Jun 25, 2013 9:51 pm

For future, I found a great solution. It turns out Google has released some new open license fonts as per ice cream sandwich. Most fonts, ttf/otf or otherwise, aren't designed for small resolutions and look bad on devices. This one looks great, and is a humanist sans serif.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Stretching fonts?

Post by Simon » Wed Jun 26, 2013 7:09 am

Hi Steve,
For future, I found a great solution
Could you be a bit more specific?
I'm glad you found something useful, but you've only half shared it. The font name? Is it Roboto or a newer one?

Thanks,
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

SteveTX
Posts: 170
Joined: Sun Jan 17, 2010 9:00 pm

Re: Stretching fonts?

Post by SteveTX » Sat Jun 29, 2013 1:34 am

Roboto indeed. Droid Sans is alright as well. Can't wait to see some droid/google fonts on iOS builds.

Post Reply