BitmapFont

Renders text using *.fnt fonts.

Renders text using *.fnt fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see DynamicFont.

@GodotBaseClass
struct BitmapFont {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

_getChars
PoolIntArray _getChars()
_getKernings
PoolIntArray _getKernings()
_getTextures
Array _getTextures()
_setChars
void _setChars(PoolIntArray arg0)
_setKernings
void _setKernings(PoolIntArray arg0)
_setTextures
void _setTextures(Array arg0)
addChar
void addChar(long character, long texture, Rect2 rect, Vector2 _align, double advance)

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

addKerningPair
void addKerningPair(long char_a, long char_b, long kerning)

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

addTexture
void addTexture(Texture texture)

Adds a texture to the BitmapFont.

clear
void clear()

Clears all the font data and settings.

createFromFnt
GodotError createFromFnt(StringArg0 path)

Creates a BitmapFont from the *.fnt file at path.

getCharSize
Vector2 getCharSize(long _char, long next)

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

getFallback
Ref!BitmapFont getFallback()
getKerningPair
long getKerningPair(long char_a, long char_b)

Returns a kerning pair as a difference.

getTexture
Ref!Texture getTexture(long idx)

Returns the font atlas texture at index idx.

getTextureCount
long getTextureCount()

Returns the number of textures in the BitmapFont atlas.

opAssign
BitmapFont opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(BitmapFont other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
setAscent
void setAscent(double px)
setDistanceFieldHint
void setDistanceFieldHint(bool enable)
setFallback
void setFallback(BitmapFont fallback)
setHeight
void setHeight(double px)

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

ascent
double ascent [@property getter]
double ascent [@property setter]

Ascent (number of pixels above the baseline).

chars
PoolIntArray chars [@property getter]
PoolIntArray chars [@property setter]
distanceField
bool distanceField [@property getter]
bool distanceField [@property setter]

If true distance field hint is enabled.

fallback
BitmapFont fallback [@property getter]
BitmapFont fallback [@property setter]

The fallback font.

height
double height [@property getter]
double height [@property setter]

Total font height (ascent plus descent) in pixels.

kernings
PoolIntArray kernings [@property getter]
PoolIntArray kernings [@property setter]
textures
Array textures [@property getter]
Array textures [@property setter]

Static functions

_new
BitmapFont _new()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

_classBinding
struct _classBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
ToRef as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta