.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_BitmapFont: BitmapFont ========== **Inherits:** :ref:`Font` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Member Functions ---------------- +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_char` **(** :ref:`int` character, :ref:`int` texture, :ref:`Rect2` rect, :ref:`Vector2` align=null, :ref:`float` advance=null **)** | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_kerning_pair` **(** :ref:`int` char_a, :ref:`int` char_b, :ref:`int` kerning **)** | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_texture` **(** :ref:`Texture` texture **)** | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear` **(** **)** | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`create_from_fnt` **(** :ref:`String` path **)** | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_char_size` **(** :ref:`int` char, :ref:`int` next=null **)** const | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`BitmapFont` | :ref:`get_fallback` **(** **)** const | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_kerning_pair` **(** :ref:`int` char_a, :ref:`int` char_b **)** const | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture` | :ref:`get_texture` **(** :ref:`int` idx **)** const | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_texture_count` **(** **)** const | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_ascent` **(** :ref:`float` px **)** | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_distance_field_hint` **(** :ref:`bool` enable **)** | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_fallback` **(** :ref:`BitmapFont` fallback **)** | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_height` **(** :ref:`float` px **)** | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Member Variables ---------------- - :ref:`float` **ascent** - :ref:`PoolIntArray` **chars** - :ref:`bool` **distance_field** - :ref:`BitmapFont` **fallback** - :ref:`float` **height** - :ref:`PoolIntArray` **kernings** - :ref:`Array` **textures** Member Function Description --------------------------- .. _class_BitmapFont_add_char: - void **add_char** **(** :ref:`int` character, :ref:`int` texture, :ref:`Rect2` rect, :ref:`Vector2` align=null, :ref:`float` advance=null **)** 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. .. _class_BitmapFont_add_kerning_pair: - void **add_kerning_pair** **(** :ref:`int` char_a, :ref:`int` char_b, :ref:`int` kerning **)** Add a kerning pair to the :ref:`BitmapFont` as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character. .. _class_BitmapFont_add_texture: - void **add_texture** **(** :ref:`Texture` texture **)** Add a texture to the :ref:`BitmapFont`. .. _class_BitmapFont_clear: - void **clear** **(** **)** Clear all the font data. .. _class_BitmapFont_create_from_fnt: - :ref:`int` **create_from_fnt** **(** :ref:`String` path **)** .. _class_BitmapFont_get_char_size: - :ref:`Vector2` **get_char_size** **(** :ref:`int` char, :ref:`int` next=null **)** const Return the size of a character, optionally taking kerning into account if the next character is provided. .. _class_BitmapFont_get_fallback: - :ref:`BitmapFont` **get_fallback** **(** **)** const .. _class_BitmapFont_get_kerning_pair: - :ref:`int` **get_kerning_pair** **(** :ref:`int` char_a, :ref:`int` char_b **)** const Return a kerning pair as a difference. .. _class_BitmapFont_get_texture: - :ref:`Texture` **get_texture** **(** :ref:`int` idx **)** const .. _class_BitmapFont_get_texture_count: - :ref:`int` **get_texture_count** **(** **)** const .. _class_BitmapFont_set_ascent: - void **set_ascent** **(** :ref:`float` px **)** Set the font ascent (number of pixels above the baseline). .. _class_BitmapFont_set_distance_field_hint: - void **set_distance_field_hint** **(** :ref:`bool` enable **)** .. _class_BitmapFont_set_fallback: - void **set_fallback** **(** :ref:`BitmapFont` fallback **)** .. _class_BitmapFont_set_height: - void **set_height** **(** :ref:`float` px **)** Set the total font height (ascent plus descent) in pixels.