Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Gui.FontBuilder Class Reference

Font builder. More...

Inheritance diagram for Dragengine.Gui.FontBuilder:

Public Member Functions

Constructors
FontBuilder new ()
 Create font builder.

Management

Font build (String filename, int fontSize)
 Build font using filename.
void buildFont ()
 Build font.
void setBaseLine (int baseLine)
 Set base line in pixels from top.
void setIsColorFont (bool isColorFont)
 Set if font is colored.
void setUndefinedGlyph (int x, int y, int z, int width, int bearing, int advance)
 Set undefined glyph parameters.
void setGlyphCount (int count)
 Set count of glyphs.
void setGlyphAt (int index, int unicode, int x, int y, int z, int width, int bearing, int advance)
 Set glyph parameters.
void setGlyphAt (int index, int unicode, int x, int y, int z, int width, int height, int bearing, int bearingY, int advance)
 Set glyph parameters.

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.

References build().

Referenced by build().

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

References buildFont().

Referenced by buildFont().

◆ new()

FontBuilder Dragengine.Gui.FontBuilder.new ( )

Create font builder.

References new().

Referenced by new().

◆ setBaseLine()

void Dragengine.Gui.FontBuilder.setBaseLine ( int baseLine)
protected

Set base line in pixels from top.

Version
1.29

Referenced by setIsColorFont().

◆ setGlyphAt() [1/2]

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.

References setUndefinedGlyph().

Referenced by setGlyphAt().

◆ setGlyphAt() [2/2]

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

Set glyph parameters.

Version
1.29

References setGlyphAt(), and setGlyphCount().

◆ setGlyphCount()

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

Set count of glyphs.

References setIsColorFont().

Referenced by setGlyphAt().

◆ setIsColorFont()

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

Set if font is colored.

References setBaseLine().

Referenced by setGlyphCount().

◆ setUndefinedGlyph()

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

Set undefined glyph parameters.

Referenced by setGlyphAt().


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