mirror of
https://github.com/godotengine/godot-docs.git
synced 2025-12-31 17:49:03 +03:00
1017 lines
71 KiB
ReStructuredText
1017 lines
71 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. DO NOT EDIT THIS FILE!!!
|
|
.. Generated automatically from Godot engine sources.
|
|
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
|
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/FontFile.xml.
|
|
|
|
.. _class_FontFile:
|
|
|
|
FontFile
|
|
========
|
|
|
|
**Inherits:** :ref:`Font<class_Font>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
|
|
|
Font source data and prerendered glyph cache, imported from dynamic or bitmap font.
|
|
|
|
Description
|
|
-----------
|
|
|
|
``FontFile`` contains a set of glyphs to represent Unicode characters imported from a font file, as well as a cache of rasterized glyphs, and a set of fallback :ref:`Font<class_Font>`\ s to use.
|
|
|
|
Use :ref:`FontVariation<class_FontVariation>` to access specific OpenType variation of the font, create simulated bold / slanted version, and draw lines of text.
|
|
|
|
For more complex text processing, use :ref:`FontVariation<class_FontVariation>` in conjunction with :ref:`TextLine<class_TextLine>` or :ref:`TextParagraph<class_TextParagraph>`.
|
|
|
|
Supported font formats:
|
|
|
|
- Dynamic font importer: TrueType (.ttf), TrueType collection (.ttc), OpenType (.otf), OpenType collection (.otc), WOFF (.woff), WOFF2 (.woff2), Type 1 (.pfb, .pfm).
|
|
|
|
- Bitmap font importer: AngelCode BMFont (.fnt, .font), text and binary (version 3) format variants.
|
|
|
|
- Monospace image font importer: All supported image formats.
|
|
|
|
\ **Note:** A character is a symbol that represents an item (letter, digit etc.) in an abstract way.
|
|
|
|
\ **Note:** A glyph is a bitmap or shape used to draw a one or more characters in a context-dependent manner. Glyph indices are bound to the specific font data source.
|
|
|
|
\ **Note:** If a none of the font data sources contain glyphs for a character used in a string, the character in question will be replaced with a box displaying its hexadecimal code.
|
|
|
|
|
|
.. tabs::
|
|
|
|
.. code-tab:: gdscript
|
|
|
|
var f = load("res://BarlowCondensed-Bold.ttf")
|
|
$"Label".set("custom_fonts/font", f)
|
|
$"Label".set("custom_fonts/font_size", 64)
|
|
|
|
.. code-tab:: csharp
|
|
|
|
var f = ResourceLoader.Load<FontFile>("res://BarlowCondensed-Bold.ttf");
|
|
GetNode("Label").Set("custom_fonts/font", f);
|
|
GetNode("Label").Set("custom_font_sizes/font_size", 64);
|
|
|
|
|
|
|
|
Properties
|
|
----------
|
|
|
|
+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
|
|
| :ref:`FontAntialiasing<enum_TextServer_FontAntialiasing>` | :ref:`antialiasing<class_FontFile_property_antialiasing>` | ``1`` |
|
|
+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
|
|
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`data<class_FontFile_property_data>` | ``PackedByteArray()`` |
|
|
+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
|
|
| :ref:`Font[]<class_Font>` | :ref:`fallbacks<class_FontFile_property_fallbacks>` | ``[]`` |
|
|
+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
|
|
| :ref:`int<class_int>` | :ref:`fixed_size<class_FontFile_property_fixed_size>` | ``0`` |
|
|
+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
|
|
| :ref:`String<class_String>` | :ref:`font_name<class_FontFile_property_font_name>` | ``""`` |
|
|
+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
|
|
| :ref:`FontStyle<enum_TextServer_FontStyle>` | :ref:`font_style<class_FontFile_property_font_style>` | ``0`` |
|
|
+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`force_autohinter<class_FontFile_property_force_autohinter>` | ``false`` |
|
|
+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`generate_mipmaps<class_FontFile_property_generate_mipmaps>` | ``false`` |
|
|
+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
|
|
| :ref:`Hinting<enum_TextServer_Hinting>` | :ref:`hinting<class_FontFile_property_hinting>` | ``1`` |
|
|
+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
|
|
| :ref:`int<class_int>` | :ref:`msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` | ``16`` |
|
|
+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
|
|
| :ref:`int<class_int>` | :ref:`msdf_size<class_FontFile_property_msdf_size>` | ``48`` |
|
|
+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` | ``false`` |
|
|
+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
|
|
| :ref:`Dictionary<class_Dictionary>` | :ref:`opentype_feature_overrides<class_FontFile_property_opentype_feature_overrides>` | ``{}`` |
|
|
+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
|
|
| :ref:`float<class_float>` | :ref:`oversampling<class_FontFile_property_oversampling>` | ``0.0`` |
|
|
+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
|
|
| :ref:`String<class_String>` | :ref:`style_name<class_FontFile_property_style_name>` | ``""`` |
|
|
+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
|
|
| :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>` | :ref:`subpixel_positioning<class_FontFile_property_subpixel_positioning>` | ``1`` |
|
|
+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
|
|
|
|
Methods
|
|
-------
|
|
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_cache<class_FontFile_method_clear_cache>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_glyphs<class_FontFile_method_clear_glyphs>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_kerning_map<class_FontFile_method_clear_kerning_map>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_size_cache<class_FontFile_method_clear_size_cache>` **(** :ref:`int<class_int>` cache_index **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_textures<class_FontFile_method_clear_textures>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_cache_ascent<class_FontFile_method_get_cache_ascent>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_cache_count<class_FontFile_method_get_cache_count>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_cache_descent<class_FontFile_method_get_cache_descent>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_cache_scale<class_FontFile_method_get_cache_scale>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_cache_underline_position<class_FontFile_method_get_cache_underline_position>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_cache_underline_thickness<class_FontFile_method_get_cache_underline_thickness>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_embolden<class_FontFile_method_get_embolden>` **(** :ref:`int<class_int>` cache_index **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_face_index<class_FontFile_method_get_face_index>` **(** :ref:`int<class_int>` cache_index **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`get_glyph_advance<class_FontFile_method_get_glyph_advance>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`int<class_int>` glyph **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_glyph_index<class_FontFile_method_get_glyph_index>` **(** :ref:`int<class_int>` size, :ref:`int<class_int>` char, :ref:`int<class_int>` variation_selector **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_glyph_list<class_FontFile_method_get_glyph_list>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`get_glyph_offset<class_FontFile_method_get_glyph_offset>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`get_glyph_size<class_FontFile_method_get_glyph_size>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_glyph_texture_idx<class_FontFile_method_get_glyph_texture_idx>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Rect2<class_Rect2>` | :ref:`get_glyph_uv_rect<class_FontFile_method_get_glyph_uv_rect>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`get_kerning<class_FontFile_method_get_kerning>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`Vector2i<class_Vector2i>` glyph_pair **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2i[]<class_Vector2i>` | :ref:`get_kerning_list<class_FontFile_method_get_kerning_list>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`get_language_support_override<class_FontFile_method_get_language_support_override>` **(** :ref:`String<class_String>` language **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_language_support_overrides<class_FontFile_method_get_language_support_overrides>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`get_script_support_override<class_FontFile_method_get_script_support_override>` **(** :ref:`String<class_String>` script **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_script_support_overrides<class_FontFile_method_get_script_support_overrides>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2i[]<class_Vector2i>` | :ref:`get_size_cache_list<class_FontFile_method_get_size_cache_list>` **(** :ref:`int<class_int>` cache_index **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_texture_count<class_FontFile_method_get_texture_count>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Image<class_Image>` | :ref:`get_texture_image<class_FontFile_method_get_texture_image>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_texture_offsets<class_FontFile_method_get_texture_offsets>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Transform2D<class_Transform2D>` | :ref:`get_transform<class_FontFile_method_get_transform>` **(** :ref:`int<class_int>` cache_index **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Dictionary<class_Dictionary>` | :ref:`get_variation_coordinates<class_FontFile_method_get_variation_coordinates>` **(** :ref:`int<class_int>` cache_index **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_bitmap_font<class_FontFile_method_load_bitmap_font>` **(** :ref:`String<class_String>` path **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_dynamic_font<class_FontFile_method_load_dynamic_font>` **(** :ref:`String<class_String>` path **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`remove_cache<class_FontFile_method_remove_cache>` **(** :ref:`int<class_int>` cache_index **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`remove_glyph<class_FontFile_method_remove_glyph>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`remove_kerning<class_FontFile_method_remove_kerning>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`Vector2i<class_Vector2i>` glyph_pair **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`remove_language_support_override<class_FontFile_method_remove_language_support_override>` **(** :ref:`String<class_String>` language **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`remove_script_support_override<class_FontFile_method_remove_script_support_override>` **(** :ref:`String<class_String>` script **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`remove_size_cache<class_FontFile_method_remove_size_cache>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`remove_texture<class_FontFile_method_remove_texture>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`render_glyph<class_FontFile_method_render_glyph>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` index **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`render_range<class_FontFile_method_render_range>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` start, :ref:`int<class_int>` end **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_cache_ascent<class_FontFile_method_set_cache_ascent>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` ascent **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_cache_descent<class_FontFile_method_set_cache_descent>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` descent **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_cache_scale<class_FontFile_method_set_cache_scale>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` scale **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_cache_underline_position<class_FontFile_method_set_cache_underline_position>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` underline_position **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_cache_underline_thickness<class_FontFile_method_set_cache_underline_thickness>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` underline_thickness **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_embolden<class_FontFile_method_set_embolden>` **(** :ref:`int<class_int>` cache_index, :ref:`float<class_float>` strength **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_face_index<class_FontFile_method_set_face_index>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` face_index **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_glyph_advance<class_FontFile_method_set_glyph_advance>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`int<class_int>` glyph, :ref:`Vector2<class_Vector2>` advance **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_glyph_offset<class_FontFile_method_set_glyph_offset>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph, :ref:`Vector2<class_Vector2>` offset **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_glyph_size<class_FontFile_method_set_glyph_size>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph, :ref:`Vector2<class_Vector2>` gl_size **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_glyph_texture_idx<class_FontFile_method_set_glyph_texture_idx>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph, :ref:`int<class_int>` texture_idx **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_glyph_uv_rect<class_FontFile_method_set_glyph_uv_rect>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph, :ref:`Rect2<class_Rect2>` uv_rect **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_kerning<class_FontFile_method_set_kerning>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`Vector2i<class_Vector2i>` glyph_pair, :ref:`Vector2<class_Vector2>` kerning **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_language_support_override<class_FontFile_method_set_language_support_override>` **(** :ref:`String<class_String>` language, :ref:`bool<class_bool>` supported **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_script_support_override<class_FontFile_method_set_script_support_override>` **(** :ref:`String<class_String>` script, :ref:`bool<class_bool>` supported **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_texture_image<class_FontFile_method_set_texture_image>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index, :ref:`Image<class_Image>` image **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_texture_offsets<class_FontFile_method_set_texture_offsets>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index, :ref:`PackedInt32Array<class_PackedInt32Array>` offset **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_transform<class_FontFile_method_set_transform>` **(** :ref:`int<class_int>` cache_index, :ref:`Transform2D<class_Transform2D>` transform **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_variation_coordinates<class_FontFile_method_set_variation_coordinates>` **(** :ref:`int<class_int>` cache_index, :ref:`Dictionary<class_Dictionary>` variation_coordinates **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_FontFile_property_antialiasing:
|
|
|
|
- :ref:`FontAntialiasing<enum_TextServer_FontAntialiasing>` **antialiasing**
|
|
|
|
+-----------+-------------------------+
|
|
| *Default* | ``1`` |
|
|
+-----------+-------------------------+
|
|
| *Setter* | set_antialiasing(value) |
|
|
+-----------+-------------------------+
|
|
| *Getter* | get_antialiasing() |
|
|
+-----------+-------------------------+
|
|
|
|
Font anti-aliasing mode.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_property_data:
|
|
|
|
- :ref:`PackedByteArray<class_PackedByteArray>` **data**
|
|
|
|
+-----------+-----------------------+
|
|
| *Default* | ``PackedByteArray()`` |
|
|
+-----------+-----------------------+
|
|
| *Setter* | set_data(value) |
|
|
+-----------+-----------------------+
|
|
| *Getter* | get_data() |
|
|
+-----------+-----------------------+
|
|
|
|
Contents of the dynamic font source file.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_property_fallbacks:
|
|
|
|
- :ref:`Font[]<class_Font>` **fallbacks**
|
|
|
|
+-----------+----------------------+
|
|
| *Default* | ``[]`` |
|
|
+-----------+----------------------+
|
|
| *Setter* | set_fallbacks(value) |
|
|
+-----------+----------------------+
|
|
| *Getter* | get_fallbacks() |
|
|
+-----------+----------------------+
|
|
|
|
Array of fallback :ref:`Font<class_Font>`\ s.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_property_fixed_size:
|
|
|
|
- :ref:`int<class_int>` **fixed_size**
|
|
|
|
+-----------+-----------------------+
|
|
| *Default* | ``0`` |
|
|
+-----------+-----------------------+
|
|
| *Setter* | set_fixed_size(value) |
|
|
+-----------+-----------------------+
|
|
| *Getter* | get_fixed_size() |
|
|
+-----------+-----------------------+
|
|
|
|
Font size, used only for the bitmap fonts.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_property_font_name:
|
|
|
|
- :ref:`String<class_String>` **font_name**
|
|
|
|
+-----------+----------------------+
|
|
| *Default* | ``""`` |
|
|
+-----------+----------------------+
|
|
| *Setter* | set_font_name(value) |
|
|
+-----------+----------------------+
|
|
| *Getter* | get_font_name() |
|
|
+-----------+----------------------+
|
|
|
|
Font family name.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_property_font_style:
|
|
|
|
- :ref:`FontStyle<enum_TextServer_FontStyle>` **font_style**
|
|
|
|
+-----------+-----------------------+
|
|
| *Default* | ``0`` |
|
|
+-----------+-----------------------+
|
|
| *Setter* | set_font_style(value) |
|
|
+-----------+-----------------------+
|
|
| *Getter* | get_font_style() |
|
|
+-----------+-----------------------+
|
|
|
|
Font style flags, see :ref:`FontStyle<enum_TextServer_FontStyle>`.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_property_force_autohinter:
|
|
|
|
- :ref:`bool<class_bool>` **force_autohinter**
|
|
|
|
+-----------+-----------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+-----------------------------+
|
|
| *Setter* | set_force_autohinter(value) |
|
|
+-----------+-----------------------------+
|
|
| *Getter* | is_force_autohinter() |
|
|
+-----------+-----------------------------+
|
|
|
|
If set to ``true``, auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_property_generate_mipmaps:
|
|
|
|
- :ref:`bool<class_bool>` **generate_mipmaps**
|
|
|
|
+-----------+-----------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+-----------------------------+
|
|
| *Setter* | set_generate_mipmaps(value) |
|
|
+-----------+-----------------------------+
|
|
| *Getter* | get_generate_mipmaps() |
|
|
+-----------+-----------------------------+
|
|
|
|
If set to ``true``, generate mipmaps for the font textures.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_property_hinting:
|
|
|
|
- :ref:`Hinting<enum_TextServer_Hinting>` **hinting**
|
|
|
|
+-----------+--------------------+
|
|
| *Default* | ``1`` |
|
|
+-----------+--------------------+
|
|
| *Setter* | set_hinting(value) |
|
|
+-----------+--------------------+
|
|
| *Getter* | get_hinting() |
|
|
+-----------+--------------------+
|
|
|
|
Font hinting mode. Used by dynamic fonts only.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_property_msdf_pixel_range:
|
|
|
|
- :ref:`int<class_int>` **msdf_pixel_range**
|
|
|
|
+-----------+-----------------------------+
|
|
| *Default* | ``16`` |
|
|
+-----------+-----------------------------+
|
|
| *Setter* | set_msdf_pixel_range(value) |
|
|
+-----------+-----------------------------+
|
|
| *Getter* | get_msdf_pixel_range() |
|
|
+-----------+-----------------------------+
|
|
|
|
The width of the range around the shape between the minimum and maximum representable signed distance.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_property_msdf_size:
|
|
|
|
- :ref:`int<class_int>` **msdf_size**
|
|
|
|
+-----------+----------------------+
|
|
| *Default* | ``48`` |
|
|
+-----------+----------------------+
|
|
| *Setter* | set_msdf_size(value) |
|
|
+-----------+----------------------+
|
|
| *Getter* | get_msdf_size() |
|
|
+-----------+----------------------+
|
|
|
|
Source font size used to generate MSDF textures.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_property_multichannel_signed_distance_field:
|
|
|
|
- :ref:`bool<class_bool>` **multichannel_signed_distance_field**
|
|
|
|
+-----------+-----------------------------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+-----------------------------------------------+
|
|
| *Setter* | set_multichannel_signed_distance_field(value) |
|
|
+-----------+-----------------------------------------------+
|
|
| *Getter* | is_multichannel_signed_distance_field() |
|
|
+-----------+-----------------------------------------------+
|
|
|
|
If set to ``true``, glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_property_opentype_feature_overrides:
|
|
|
|
- :ref:`Dictionary<class_Dictionary>` **opentype_feature_overrides**
|
|
|
|
+-----------+---------------------------------------+
|
|
| *Default* | ``{}`` |
|
|
+-----------+---------------------------------------+
|
|
| *Setter* | set_opentype_feature_overrides(value) |
|
|
+-----------+---------------------------------------+
|
|
| *Getter* | get_opentype_feature_overrides() |
|
|
+-----------+---------------------------------------+
|
|
|
|
Font OpenType feature set override.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_property_oversampling:
|
|
|
|
- :ref:`float<class_float>` **oversampling**
|
|
|
|
+-----------+-------------------------+
|
|
| *Default* | ``0.0`` |
|
|
+-----------+-------------------------+
|
|
| *Setter* | set_oversampling(value) |
|
|
+-----------+-------------------------+
|
|
| *Getter* | get_oversampling() |
|
|
+-----------+-------------------------+
|
|
|
|
Font oversampling factor, if set to ``0.0`` global oversampling factor is used instead. Used by dynamic fonts only.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_property_style_name:
|
|
|
|
- :ref:`String<class_String>` **style_name**
|
|
|
|
+-----------+----------------------------+
|
|
| *Default* | ``""`` |
|
|
+-----------+----------------------------+
|
|
| *Setter* | set_font_style_name(value) |
|
|
+-----------+----------------------------+
|
|
| *Getter* | get_font_style_name() |
|
|
+-----------+----------------------------+
|
|
|
|
Font style name.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_property_subpixel_positioning:
|
|
|
|
- :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>` **subpixel_positioning**
|
|
|
|
+-----------+---------------------------------+
|
|
| *Default* | ``1`` |
|
|
+-----------+---------------------------------+
|
|
| *Setter* | set_subpixel_positioning(value) |
|
|
+-----------+---------------------------------+
|
|
| *Getter* | get_subpixel_positioning() |
|
|
+-----------+---------------------------------+
|
|
|
|
Font glyph subpixel positioning mode. Subpixel positioning provides shaper text and better kerning for smaller font sizes, at the cost of memory usage and font rasterization speed. Use :ref:`TextServer.SUBPIXEL_POSITIONING_AUTO<class_TextServer_constant_SUBPIXEL_POSITIONING_AUTO>` to automatically enable it based on the font size.
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_FontFile_method_clear_cache:
|
|
|
|
- void **clear_cache** **(** **)**
|
|
|
|
Removes all font cache entries.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_clear_glyphs:
|
|
|
|
- void **clear_glyphs** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)**
|
|
|
|
Removes all rendered glyphs information from the cache entry.
|
|
|
|
\ **Note:** This function will not remove textures associated with the glyphs, use :ref:`remove_texture<class_FontFile_method_remove_texture>` to remove them manually.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_clear_kerning_map:
|
|
|
|
- void **clear_kerning_map** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)**
|
|
|
|
Removes all kerning overrides.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_clear_size_cache:
|
|
|
|
- void **clear_size_cache** **(** :ref:`int<class_int>` cache_index **)**
|
|
|
|
Removes all font sizes from the cache entry
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_clear_textures:
|
|
|
|
- void **clear_textures** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)**
|
|
|
|
Removes all textures from font cache entry.
|
|
|
|
\ **Note:** This function will not remove glyphs associated with the texture, use :ref:`remove_glyph<class_FontFile_method_remove_glyph>` to remove them manually.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_cache_ascent:
|
|
|
|
- :ref:`float<class_float>` **get_cache_ascent** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
|
|
|
|
Returns the font ascent (number of pixels above the baseline).
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_cache_count:
|
|
|
|
- :ref:`int<class_int>` **get_cache_count** **(** **)** |const|
|
|
|
|
Returns number of the font cache entries.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_cache_descent:
|
|
|
|
- :ref:`float<class_float>` **get_cache_descent** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
|
|
|
|
.. container:: contribute
|
|
|
|
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_cache_scale:
|
|
|
|
- :ref:`float<class_float>` **get_cache_scale** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
|
|
|
|
.. container:: contribute
|
|
|
|
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_cache_underline_position:
|
|
|
|
- :ref:`float<class_float>` **get_cache_underline_position** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
|
|
|
|
.. container:: contribute
|
|
|
|
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_cache_underline_thickness:
|
|
|
|
- :ref:`float<class_float>` **get_cache_underline_thickness** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
|
|
|
|
.. container:: contribute
|
|
|
|
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_embolden:
|
|
|
|
- :ref:`float<class_float>` **get_embolden** **(** :ref:`int<class_int>` cache_index **)** |const|
|
|
|
|
Returns embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_face_index:
|
|
|
|
- :ref:`int<class_int>` **get_face_index** **(** :ref:`int<class_int>` cache_index **)** |const|
|
|
|
|
Recturns an active face index in the TrueType / OpenType collection.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_glyph_advance:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **get_glyph_advance** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`int<class_int>` glyph **)** |const|
|
|
|
|
Returns glyph advance (offset of the next glyph).
|
|
|
|
\ **Note:** Advance for glyphs outlines is the same as the base glyph advance and is not saved.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_glyph_index:
|
|
|
|
- :ref:`int<class_int>` **get_glyph_index** **(** :ref:`int<class_int>` size, :ref:`int<class_int>` char, :ref:`int<class_int>` variation_selector **)** |const|
|
|
|
|
Returns the glyph index of a ``char``, optionally modified by the ``variation_selector``.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_glyph_list:
|
|
|
|
- :ref:`PackedInt32Array<class_PackedInt32Array>` **get_glyph_list** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |const|
|
|
|
|
Returns list of rendered glyphs in the cache entry.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_glyph_offset:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **get_glyph_offset** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const|
|
|
|
|
Returns glyph offset from the baseline.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_glyph_size:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **get_glyph_size** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const|
|
|
|
|
Returns glyph size.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_glyph_texture_idx:
|
|
|
|
- :ref:`int<class_int>` **get_glyph_texture_idx** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const|
|
|
|
|
Returns index of the cache texture containing the glyph.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_glyph_uv_rect:
|
|
|
|
- :ref:`Rect2<class_Rect2>` **get_glyph_uv_rect** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const|
|
|
|
|
Returns rectangle in the cache texture containing the glyph.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_kerning:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **get_kerning** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`Vector2i<class_Vector2i>` glyph_pair **)** |const|
|
|
|
|
Returns kerning for the pair of glyphs.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_kerning_list:
|
|
|
|
- :ref:`Vector2i[]<class_Vector2i>` **get_kerning_list** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
|
|
|
|
Returns list of the kerning overrides.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_language_support_override:
|
|
|
|
- :ref:`bool<class_bool>` **get_language_support_override** **(** :ref:`String<class_String>` language **)** |const|
|
|
|
|
Returns ``true`` if support override is enabled for the ``language``.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_language_support_overrides:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_language_support_overrides** **(** **)** |const|
|
|
|
|
Returns list of language support overrides.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_script_support_override:
|
|
|
|
- :ref:`bool<class_bool>` **get_script_support_override** **(** :ref:`String<class_String>` script **)** |const|
|
|
|
|
Returns ``true`` if support override is enabled for the ``script``.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_script_support_overrides:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_script_support_overrides** **(** **)** |const|
|
|
|
|
Returns list of script support overrides.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_size_cache_list:
|
|
|
|
- :ref:`Vector2i[]<class_Vector2i>` **get_size_cache_list** **(** :ref:`int<class_int>` cache_index **)** |const|
|
|
|
|
Returns list of the font sizes in the cache. Each size is ``Vector2i`` with font size and outline size.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_texture_count:
|
|
|
|
- :ref:`int<class_int>` **get_texture_count** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |const|
|
|
|
|
Returns number of textures used by font cache entry.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_texture_image:
|
|
|
|
- :ref:`Image<class_Image>` **get_texture_image** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index **)** |const|
|
|
|
|
Returns a copy of the font cache texture image.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_texture_offsets:
|
|
|
|
- :ref:`PackedInt32Array<class_PackedInt32Array>` **get_texture_offsets** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index **)** |const|
|
|
|
|
Returns a copy of the array containing glyph packing data.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_transform:
|
|
|
|
- :ref:`Transform2D<class_Transform2D>` **get_transform** **(** :ref:`int<class_int>` cache_index **)** |const|
|
|
|
|
Returns 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_get_variation_coordinates:
|
|
|
|
- :ref:`Dictionary<class_Dictionary>` **get_variation_coordinates** **(** :ref:`int<class_int>` cache_index **)** |const|
|
|
|
|
Returns variation coordinates for the specified font cache entry. See :ref:`Font.get_supported_variation_list<class_Font_method_get_supported_variation_list>` for more info.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_load_bitmap_font:
|
|
|
|
- :ref:`Error<enum_@GlobalScope_Error>` **load_bitmap_font** **(** :ref:`String<class_String>` path **)**
|
|
|
|
Loads an AngelCode BMFont (.fnt, .font) bitmap font from file ``path``.
|
|
|
|
\ **Warning:** This method should only be used in the editor or in cases when you need to load external fonts at run-time, such as fonts located at the ``user://`` directory.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_load_dynamic_font:
|
|
|
|
- :ref:`Error<enum_@GlobalScope_Error>` **load_dynamic_font** **(** :ref:`String<class_String>` path **)**
|
|
|
|
Loads a TrueType (.ttf), OpenType (.otf), WOFF (.woff), WOFF2 (.woff2) or Type 1 (.pfb, .pfm) dynamic font from file ``path``.
|
|
|
|
\ **Warning:** This method should only be used in the editor or in cases when you need to load external fonts at run-time, such as fonts located at the ``user://`` directory.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_remove_cache:
|
|
|
|
- void **remove_cache** **(** :ref:`int<class_int>` cache_index **)**
|
|
|
|
Removes specified font cache entry.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_remove_glyph:
|
|
|
|
- void **remove_glyph** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)**
|
|
|
|
Removes specified rendered glyph information from the cache entry.
|
|
|
|
\ **Note:** This function will not remove textures associated with the glyphs, use :ref:`remove_texture<class_FontFile_method_remove_texture>` to remove them manually.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_remove_kerning:
|
|
|
|
- void **remove_kerning** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`Vector2i<class_Vector2i>` glyph_pair **)**
|
|
|
|
Removes kerning override for the pair of glyphs.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_remove_language_support_override:
|
|
|
|
- void **remove_language_support_override** **(** :ref:`String<class_String>` language **)**
|
|
|
|
Remove language support override.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_remove_script_support_override:
|
|
|
|
- void **remove_script_support_override** **(** :ref:`String<class_String>` script **)**
|
|
|
|
Removes script support override.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_remove_size_cache:
|
|
|
|
- void **remove_size_cache** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)**
|
|
|
|
Removes specified font size from the cache entry.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_remove_texture:
|
|
|
|
- void **remove_texture** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index **)**
|
|
|
|
Removes specified texture from the cache entry.
|
|
|
|
\ **Note:** This function will not remove glyphs associated with the texture. Remove them manually using :ref:`remove_glyph<class_FontFile_method_remove_glyph>`.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_render_glyph:
|
|
|
|
- void **render_glyph** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` index **)**
|
|
|
|
Renders specified glyph to the font cache texture.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_render_range:
|
|
|
|
- void **render_range** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` start, :ref:`int<class_int>` end **)**
|
|
|
|
Renders the range of characters to the font cache texture.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_cache_ascent:
|
|
|
|
- void **set_cache_ascent** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` ascent **)**
|
|
|
|
.. container:: contribute
|
|
|
|
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_cache_descent:
|
|
|
|
- void **set_cache_descent** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` descent **)**
|
|
|
|
.. container:: contribute
|
|
|
|
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_cache_scale:
|
|
|
|
- void **set_cache_scale** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` scale **)**
|
|
|
|
.. container:: contribute
|
|
|
|
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_cache_underline_position:
|
|
|
|
- void **set_cache_underline_position** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` underline_position **)**
|
|
|
|
.. container:: contribute
|
|
|
|
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_cache_underline_thickness:
|
|
|
|
- void **set_cache_underline_thickness** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` underline_thickness **)**
|
|
|
|
.. container:: contribute
|
|
|
|
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_embolden:
|
|
|
|
- void **set_embolden** **(** :ref:`int<class_int>` cache_index, :ref:`float<class_float>` strength **)**
|
|
|
|
Sets embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_face_index:
|
|
|
|
- void **set_face_index** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` face_index **)**
|
|
|
|
Sets an active face index in the TrueType / OpenType collection.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_glyph_advance:
|
|
|
|
- void **set_glyph_advance** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`int<class_int>` glyph, :ref:`Vector2<class_Vector2>` advance **)**
|
|
|
|
Sets glyph advance (offset of the next glyph).
|
|
|
|
\ **Note:** Advance for glyphs outlines is the same as the base glyph advance and is not saved.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_glyph_offset:
|
|
|
|
- void **set_glyph_offset** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph, :ref:`Vector2<class_Vector2>` offset **)**
|
|
|
|
Sets glyph offset from the baseline.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_glyph_size:
|
|
|
|
- void **set_glyph_size** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph, :ref:`Vector2<class_Vector2>` gl_size **)**
|
|
|
|
Sets glyph size.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_glyph_texture_idx:
|
|
|
|
- void **set_glyph_texture_idx** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph, :ref:`int<class_int>` texture_idx **)**
|
|
|
|
Sets index of the cache texture containing the glyph.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_glyph_uv_rect:
|
|
|
|
- void **set_glyph_uv_rect** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph, :ref:`Rect2<class_Rect2>` uv_rect **)**
|
|
|
|
Sets rectangle in the cache texture containing the glyph.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_kerning:
|
|
|
|
- void **set_kerning** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`Vector2i<class_Vector2i>` glyph_pair, :ref:`Vector2<class_Vector2>` kerning **)**
|
|
|
|
Sets kerning for the pair of glyphs.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_language_support_override:
|
|
|
|
- void **set_language_support_override** **(** :ref:`String<class_String>` language, :ref:`bool<class_bool>` supported **)**
|
|
|
|
Adds override for :ref:`Font.is_language_supported<class_Font_method_is_language_supported>`.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_script_support_override:
|
|
|
|
- void **set_script_support_override** **(** :ref:`String<class_String>` script, :ref:`bool<class_bool>` supported **)**
|
|
|
|
Adds override for :ref:`Font.is_script_supported<class_Font_method_is_script_supported>`.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_texture_image:
|
|
|
|
- void **set_texture_image** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index, :ref:`Image<class_Image>` image **)**
|
|
|
|
Sets font cache texture image.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_texture_offsets:
|
|
|
|
- void **set_texture_offsets** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index, :ref:`PackedInt32Array<class_PackedInt32Array>` offset **)**
|
|
|
|
Sets array containing glyph packing data.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_transform:
|
|
|
|
- void **set_transform** **(** :ref:`int<class_int>` cache_index, :ref:`Transform2D<class_Transform2D>` transform **)**
|
|
|
|
Sets 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs.
|
|
|
|
----
|
|
|
|
.. _class_FontFile_method_set_variation_coordinates:
|
|
|
|
- void **set_variation_coordinates** **(** :ref:`int<class_int>` cache_index, :ref:`Dictionary<class_Dictionary>` variation_coordinates **)**
|
|
|
|
Sets variation coordinates for the specified font cache entry. See :ref:`Font.get_supported_variation_list<class_Font_method_get_supported_variation_list>` for more info.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|
|
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
|
|
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
|
|
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
|