:github_url: hide

.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the TLFontFace.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.

.. _class_TLFontFace:

TLFontFace
==========

**Inherits:** 

**Inherited By:** :ref:`TLBitmapFontFace<class_TLBitmapFontFace>`, :ref:`TLDynamicFontFace<class_TLDynamicFontFace>`

**Category:** Core

Brief Description
-----------------

\*Virtual class\*



A base font face class.

Properties
----------

+--------+---------------------------------------------------------------+----+
| String | :ref:`font_path<class_TLFontFace_property_font_path>`         | "" |
+--------+---------------------------------------------------------------+----+
| int    | :ref:`texture_flags<class_TLFontFace_property_texture_flags>` | 0  |
+--------+---------------------------------------------------------------+----+

Methods
-------

.. table::
   :class: longtable
   :widths: 7 20

   +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void  | :ref:`draw_glyph<class_TLFontFace_method_draw_glyph>` **(** RID canvas_item, Vector2 pos, int codepoint, Color modulate, int size **)** const                 |
   +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void  | :ref:`draw_glyph_outline<class_TLFontFace_method_draw_glyph_outline>` **(** RID canvas_item, Vector2 pos, int codepoint, Color modulate, int size **)** const |
   +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | float | :ref:`get_ascent<class_TLFontFace_method_get_ascent>` **(** int size **)** const                                                                              |
   +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | int   | :ref:`get_base_size<class_TLFontFace_method_get_base_size>` **(** **)** const                                                                                 |
   +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | float | :ref:`get_descent<class_TLFontFace_method_get_descent>` **(** int size **)** const                                                                            |
   +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | Array | :ref:`get_glyph_outline<class_TLFontFace_method_get_glyph_outline>` **(** Vector2 pos, int codepoint, int size **)** const                                    |
   +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | float | :ref:`get_height<class_TLFontFace_method_get_height>` **(** int size **)** const                                                                              |
   +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | bool  | :ref:`load<class_TLFontFace_method_load>` **(** String resource_path **)**                                                                                    |
   +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | Array | :ref:`unicode_scripts_supported<class_TLFontFace_method_unicode_scripts_supported>` **(** **)** const                                                         |
   +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+

Property Descriptions
---------------------

.. _class_TLFontFace_property_font_path:

- String **font_path**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+----------------------+
   | *Default* | ""                   |
   +-----------+----------------------+
   | *Setter*  | set_font_path(value) |
   +-----------+----------------------+
   | *Getter*  | get_font_path()      |
   +-----------+----------------------+

Path of the font file.

----

.. _class_TLFontFace_property_texture_flags:

- int **texture_flags**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+--------------------------+
   | *Default* | 0                        |
   +-----------+--------------------------+
   | *Setter*  | set_texture_flags(value) |
   +-----------+--------------------------+
   | *Getter*  | get_texture_flags()      |
   +-----------+--------------------------+

Underlaying textures flags, see Texture class documentation https://docs.godotengine.org/en/latest/classes/class_texture.html#enumerations for more info.

Method Descriptions
-------------------

.. _class_TLFontFace_method_draw_glyph:

- void **draw_glyph** **(** RID canvas_item, Vector2 pos, int codepoint, Color modulate, int size **)** const

Draws a single glyph.

----

.. _class_TLFontFace_method_draw_glyph_outline:

- void **draw_glyph_outline** **(** RID canvas_item, Vector2 pos, int codepoint, Color modulate, int size **)** const

Draws single glyph outline.

----

.. _class_TLFontFace_method_get_ascent:

- float **get_ascent** **(** int size **)** const

Returns ascent (distance from the baseline to the highest position characters extend to) of the font.

----

.. _class_TLFontFace_method_get_base_size:

- int **get_base_size** **(** **)** const

Returns default font size for bitmap fonts or ``0`` for dynamic fonts.

----

.. _class_TLFontFace_method_get_descent:

- float **get_descent** **(** int size **)** const

Returns descent (distance from the base line to the lowest point characters extend to) of the font.

----

.. _class_TLFontFace_method_get_glyph_outline:

- Array **get_glyph_outline** **(** Vector2 pos, int codepoint, int size **)** const

Returns array of glyph counture points, if it's supported by font implementation or empty array otherwise.

----

.. _class_TLFontFace_method_get_height:

- float **get_height** **(** int size **)** const

Returns height (vertical distance between two consecutive baselines) of the font.

----

.. _class_TLFontFace_method_load:

- bool **load** **(** String resource_path **)**

Loads font from speified file.

----

.. _class_TLFontFace_method_unicode_scripts_supported:

- Array **unicode_scripts_supported** **(** **)** const

Returns array of supported ISO 15924 script codes.

