Namespace: fontgen
Language: Lua
Type: Extension
Functions to generate glyphs for fonts at runtime.
Type: FUNCTION Creates a mapping between a .fontc file and a .ttf file. Increases the ref count for both resources.
Parameters
fontc_path (string) - Path to a .fontc file in the projectttf_path (string) - Path to a .ttf file in the projectoptions (table) - Options for generating the glyphs
sdf_padding (number) - The number of padding pixels [0-255]sdf_edge (number) - Where the edge is decided to be [0-255]complete_function (function) - function to call when the animation has completed
self (object) - The context of the calling scriptfontc_hash (hash) - The path hash of the .fontc resourceType: FUNCTION Removes the generator mapping between the .fontc and .ttf file. Decreases the ref count for both resources. Does not remove the previously generated glyphs!
Parameters
fontc_path_hash (hash) - Path hash of the .fontc file in the projectType: FUNCTION Asynchronoously sdds glyphs to the .fontc resource.
Parameters
fontc_path_hash (hash) - Path hash of the .fontc file in the projecttext (string) - Utf-8 string containing glyphs to add to the .fontc Note No checks for duplicate glyphs is done.callback (function) - Function to be called after the last glyph was processed. May be nil.
self (object) - The script instance that called add_glyphsrequest (int) - The request id returned by add_glyphsresult (bool) - True if all glyphs were added successfullyerrmsg (string) - Error string if a glyph wasn’t generated or added successfullyReturns
integer - Returns a request id, used in the callbackType: FUNCTION Removes glyphs from the .fontc resource
Parameters
fontc_path_hash (hash) - Path hash of the .fontc file in the projecttext (string) - Utf-8 string containing glyphs to remove from the .fontc