BitmapFont

Inherits: Font < Resource < Reference < Object

Category: Core

Brief Description

Member Functions

void

add_char ( int character, int texture, Rect2 rect, Vector2 align=Vector2(0, 0), float advance=-1 )

void

add_kerning_pair ( int char_a, int char_b, int kerning )

void

add_texture ( Texture texture )

void

clear ( )

int

create_from_fnt ( String path )

Vector2

get_char_size ( int char, int next=0 ) const

Object

get_fallback ( ) const

int

get_kerning_pair ( int char_a, int char_b ) const

Texture

get_texture ( int idx ) const

int

get_texture_count ( ) const

void

set_ascent ( float px )

void

set_distance_field_hint ( bool enable )

void

set_fallback ( Object fallback )

void

set_height ( float px )

Member Function Description

Add a character to the font, where character is the unicode value, texture is the texture index, rect is the region in the texture (in pixels!), align is the (optional) alignment for the character and advance is the (optional) advance.

  • void add_kerning_pair ( int char_a, int char_b, int kerning )

Add a kerning pair to the BitmapFont as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.

  • void add_texture ( Texture texture )

Add a texture to the BitmapFont.

  • void clear ( )

Clear all the font data.

Return the size of a character, optionally taking kerning into account if the next character is provided.

  • Object get_fallback ( ) const

  • int get_kerning_pair ( int char_a, int char_b ) const

Return a kerning pair as a difference.

  • int get_texture_count ( ) const

  • void set_ascent ( float px )

Set the font ascent (number of pixels above the baseline).

  • void set_distance_field_hint ( bool enable )

  • void set_fallback ( Object fallback )

  • void set_height ( float px )

Set the total font height (ascent plus descent) in pixels.