altFont: Load a font

Chipp Walters chipp at chipp.com
Tue Nov 28 17:09:25 EST 2006


Adrian,

Here's a handler to load a font named "fred.ttf" located in the default folder.

on loadFont pFont
  if "/" is not in pFont then
  --> pFont IS NOT FULL PATHNAME SO MUST CREATE FULLPATH
    put the defaultFolder into tPath
    put tPath &"/"& pFont into pFont
  end if
  --> NOW LOAD THE FONT
  XLOAD_FONT tPath
  put the result into tResult
  if tResult is not empty then
    answer warning tResult
  end if
end loadFont

You can call this handler from a handler in the card script of card 1
of your stack:

on openStack
  loadFont "fred.ttf"
end openStack

On 11/28/06, Adrian Williams <adrian at clubtype.co.uk> wrote:

> I did get a solution from the altFont author Chris Bohnert, but it
> lacked
> enough comment for this newbie to understand how to use uFileName and
> uEmbeddedFile and where to put the script.



More information about the use-livecode mailing list