Drag[en]gine Script Module DragonScript  1.21
Dragengine.Gui.FontBuilder Class Reference

Font builder. More...

Inheritance diagram for Dragengine.Gui.FontBuilder:

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...
 

Detailed Description

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.

Member Function Documentation

◆ build()

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.

◆ buildFont()

void Dragengine.Gui.FontBuilder.buildFont ( )
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.

◆ new()

FontBuilder Dragengine.Gui.FontBuilder.new ( )

Create font builder.

◆ setGlyphAt()

void Dragengine.Gui.FontBuilder.setGlyphAt ( int  index,
int  unicode,
int  x,
int  y,
int  z,
int  width,
int  bearing,
int  advance 
)
protected

Set glyph parameters.

◆ setGlyphCount()

void Dragengine.Gui.FontBuilder.setGlyphCount ( int  count)
protected

Set count of glyphs.

◆ setIsColorFont()

void Dragengine.Gui.FontBuilder.setIsColorFont ( bool  isColorFont)
protected

Set if font is colored.

◆ setUndefinedGlyph()

void Dragengine.Gui.FontBuilder.setUndefinedGlyph ( int  x,
int  y,
int  z,
int  width,
int  bearing,
int  advance 
)
protected

Set undefined glyph parameters.


The documentation for this class was generated from the following file: