Font

Internationalized font and text drawing support.

Font contains a unicode compatible character set, as well as the ability to draw it with variable width, ascent, descent and kerning. For creating fonts from TTF files (or other font formats), see the editor support for fonts. TODO check wikipedia for graph of ascent/baseline/descent/height/etc.

Members

Aliases

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

Functions

draw
void draw(RID canvas_item, Vector2 position, StringArg2 string, Color modulate, long clip_w, Color outline_modulate)

Draw "string" into a canvas item using the font at a given position, with "modulate" color, and optionally clipping the width. "position" specifies the baseline, not the top. To draw from the top, ascent must be added to the Y axis.

drawChar
double drawChar(RID canvas_item, Vector2 position, long _char, long next, Color modulate, bool outline)

Draw character "char" into a canvas item using the font at a given position, with "modulate" color, and optionally kerning if "next" is passed. clipping the width. "position" specifies the baseline, not the top. To draw from the top, ascent must be added to the Y axis. The width used by the character is returned, making this function useful for drawing strings character by character.

getAscent
double getAscent()

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

getDescent
double getDescent()

Return the font descent (number of pixels below the baseline).

getHeight
double getHeight()

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

getStringSize
Vector2 getStringSize(StringArg0 string)

Return the size of a string, taking kerning and advance into account.

hasOutline
bool hasOutline()
isDistanceFieldHint
bool isDistanceFieldHint()
opAssign
Font opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Font 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.
updateChanges
void updateChanges()

After editing a font (changing size, ascent, char rects, etc.). Call this function to propagate changes to controls that might use it.

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Static functions

_new
Font _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