GFX Font Object

This subset of the GFX Library provide an object and some methods to handle font description, it is handy when you have to switch often from a font to another because with a single method call you can recall a font preset previously created.

  • GFX.Font:Apply()
  • GFX.Font:Load(file)
  • GFX.Font:New(params)
  • GFX.Font:Save(file)
  • GFX.Font:Set(Params)


GFX.Font:Apply()

GFX.Font:Apply()

Apply the font object setting for all upcoming text rendering operations.



GFX.Font:Load(file)

GFX.Font:Load(file)

Load and replace the object with the one previously saved in 'file'.

INPUT

  • file : Source font object file to load.


GFX.Font:New(params)

fontObj = GFX.Font:New(params)

Create a new font object useful for handling font definitions easily and quickly.

INPUT

  • params : An optional table with one or more of the following items:
    → Name : Font name or inbuilt constant, default = #SANS
    → Size : Font size, default = 16
    → Color : Font color, default = $FFFFFF
    → Bold : Bold switch, default = False
    → Italic : Italic switch, default = False
    → Underline : Underline switch, default = False
    → Antialias : Antialias switch, default = True
    → Shadow : Shadow switch, default = False
    → ShadowColor : Shadow color, default = $555555
    → ShadowDirection : Shadow direction, default #SHDWSOUTHWEST
    → ShadowDistance : Shadow distance, default = 1
    → Edge : Edge rendering switch, default = False
    → EdgeColor : Edges color, default = $000000
    → EdgeThikness : Edges thikness, default = 1
    → Encoding : Text encoding, default = #ENCODING_ISO8859_1
    → Engine : Text engine, default = #FONTENGINE_INBUILT
    → Cache : Cache text symbols? Default = True

OUTPUT

  • fontObj : A new font object


GFX.Font:Save(file)

GFX.Font:Save(file)

Saves the object to the specified 'file'.

INPUT

  • file : Destination file where you want to save this object


GFX.Font:Set(Params)

GFX.Font:Set(Params)

Change an existing Font object using the parameters specified in the 'params' table. For a list of allowed fields have a look at GFX.Font:New().

INPUT

  • params : A table with one or more parameter to change.
hollywoodlibs/gfx/font.txt · Ultima modifica: 2016/11/18 11:06 da admin
CC Attribution-Noncommercial 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0