Drag[en]gine Script Module DragonScript
1.23
|
Public Member Functions | |
Constructors | |
FontBuilder | new () |
Create font builder. More... | |
Management | |
Font | build (String filename, int fontSize) |
Build font using filename. More... | |
void | buildFont () |
Build font. More... | |
void | setIsColorFont (bool isColorFont) |
Set if font is colored. More... | |
void | setUndefinedGlyph (int x, int y, int z, int width, int bearing, int advance) |
Set undefined glyph parameters. More... | |
void | setGlyphCount (int count) |
Set count of glyphs. More... | |
void | setGlyphAt (int index, int unicode, int x, int y, int z, int width, int bearing, int advance) |
Set glyph parameters. More... | |
Font builder.
Builds font resource without requiring a font resource file. The created font can either be unnamed (if filename is empty string) or named (if filename is not empty string). Named fonts can not clash with filenames present in the virtual file system. For this reason use unnamed fonts if possible. Using named fonts though can be useful if you want to provide font resources to scripts not needing to know if the path they try to load is a build font instead of a resource one.
To use the font builder create a subclass and implement FontBuilder.buildFont() . You are only allowed to call methods from FontBuilder from inside this function call. To create the font call FontBuilder.build() . This will call FontBuilder.buildFont() to fill a new font resource with content. Once finished the build method returns the ready to use font resource. Otherwise an exception is thrown.
This is a native class.
Font Dragengine.Gui.FontBuilder.build | ( | String | filename, |
int | fontSize | ||
) |
Build font using filename.
The created font can either be unnamed (if filename is empty string) or named (if filename is not empty string). Named fonts can not clash with filenames present in the virtual file system. For this reason use unnamed fonts if possible. Using named fonts though can be useful if you want to provide font resources to scripts not needing to know if the path they try to load is a build font instead of a resource one.
To create the font call build() . This will call buildFont() to fill a new font resource with content. Once finished the build method returns the ready to use font resource. Otherwise an exception is thrown.
|
protected |
Build font.
Called by build(String) to fill a new font resource with content. You are only allowed to call methods from FontBuilder from inside this function call.
FontBuilder Dragengine.Gui.FontBuilder.new | ( | ) |
Create font builder.
|
protected |
Set glyph parameters.
|
protected |
Set count of glyphs.
|
protected |
Set if font is colored.
|
protected |
Set undefined glyph parameters.