class_fontfile.rst 70 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/FontFile.xml.
  6. .. _class_FontFile:
  7. FontFile
  8. ========
  9. **Inherits:** :ref:`Font<class_Font>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Font source data and prerendered glyph cache, imported from dynamic or bitmap font.
  11. Description
  12. -----------
  13. ``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.
  14. Use :ref:`FontVariation<class_FontVariation>` to access specific OpenType variation of the font, create simulated bold / slanted version, and draw lines of text.
  15. For more complex text processing, use :ref:`FontVariation<class_FontVariation>` in conjunction with :ref:`TextLine<class_TextLine>` or :ref:`TextParagraph<class_TextParagraph>`.
  16. Supported font formats:
  17. - Dynamic font importer: TrueType (.ttf), TrueType collection (.ttc), OpenType (.otf), OpenType collection (.otc), WOFF (.woff), WOFF2 (.woff2), Type 1 (.pfb, .pfm).
  18. - Bitmap font importer: AngelCode BMFont (.fnt, .font), text and binary (version 3) format variants.
  19. - Monospace image font importer: All supported image formats.
  20. \ **Note:** A character is a symbol that represents an item (letter, digit etc.) in an abstract way.
  21. \ **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.
  22. \ **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.
  23. .. tabs::
  24. .. code-tab:: gdscript
  25. var f = load("res://BarlowCondensed-Bold.ttf")
  26. $"Label".set("custom_fonts/font", f)
  27. $"Label".set("custom_fonts/font_size", 64)
  28. .. code-tab:: csharp
  29. var f = ResourceLoader.Load<FontFile>("res://BarlowCondensed-Bold.ttf");
  30. GetNode("Label").Set("custom_fonts/font", f);
  31. GetNode("Label").Set("custom_font_sizes/font_size", 64);
  32. Properties
  33. ----------
  34. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  35. | :ref:`bool<class_bool>` | :ref:`antialiased<class_FontFile_property_antialiased>` | ``true`` |
  36. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  37. | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`data<class_FontFile_property_data>` | ``PackedByteArray()`` |
  38. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  39. | :ref:`Font[]<class_Font>` | :ref:`fallbacks<class_FontFile_property_fallbacks>` | ``[]`` |
  40. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  41. | :ref:`int<class_int>` | :ref:`fixed_size<class_FontFile_property_fixed_size>` | ``0`` |
  42. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  43. | :ref:`String<class_String>` | :ref:`font_name<class_FontFile_property_font_name>` | ``""`` |
  44. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  45. | :ref:`FontStyle<enum_TextServer_FontStyle>` | :ref:`font_style<class_FontFile_property_font_style>` | ``0`` |
  46. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  47. | :ref:`bool<class_bool>` | :ref:`force_autohinter<class_FontFile_property_force_autohinter>` | ``false`` |
  48. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  49. | :ref:`bool<class_bool>` | :ref:`generate_mipmaps<class_FontFile_property_generate_mipmaps>` | ``false`` |
  50. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  51. | :ref:`Hinting<enum_TextServer_Hinting>` | :ref:`hinting<class_FontFile_property_hinting>` | ``1`` |
  52. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  53. | :ref:`int<class_int>` | :ref:`msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` | ``16`` |
  54. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  55. | :ref:`int<class_int>` | :ref:`msdf_size<class_FontFile_property_msdf_size>` | ``48`` |
  56. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  57. | :ref:`bool<class_bool>` | :ref:`multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` | ``false`` |
  58. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  59. | :ref:`Dictionary<class_Dictionary>` | :ref:`opentype_feature_overrides<class_FontFile_property_opentype_feature_overrides>` | ``{}`` |
  60. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  61. | :ref:`float<class_float>` | :ref:`oversampling<class_FontFile_property_oversampling>` | ``0.0`` |
  62. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  63. | :ref:`String<class_String>` | :ref:`style_name<class_FontFile_property_style_name>` | ``""`` |
  64. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  65. | :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>` | :ref:`subpixel_positioning<class_FontFile_property_subpixel_positioning>` | ``1`` |
  66. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  67. Methods
  68. -------
  69. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | void | :ref:`clear_cache<class_FontFile_method_clear_cache>` **(** **)** |
  71. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | void | :ref:`clear_glyphs<class_FontFile_method_clear_glyphs>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |
  73. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | void | :ref:`clear_kerning_map<class_FontFile_method_clear_kerning_map>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |
  75. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | void | :ref:`clear_size_cache<class_FontFile_method_clear_size_cache>` **(** :ref:`int<class_int>` cache_index **)** |
  77. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | void | :ref:`clear_textures<class_FontFile_method_clear_textures>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |
  79. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :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| |
  81. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`int<class_int>` | :ref:`get_cache_count<class_FontFile_method_get_cache_count>` **(** **)** |const| |
  83. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :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| |
  85. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :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| |
  87. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :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| |
  89. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :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| |
  91. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`float<class_float>` | :ref:`get_embolden<class_FontFile_method_get_embolden>` **(** :ref:`int<class_int>` cache_index **)** |const| |
  93. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`int<class_int>` | :ref:`get_face_index<class_FontFile_method_get_face_index>` **(** :ref:`int<class_int>` cache_index **)** |const| |
  95. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :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| |
  97. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :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| |
  99. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`Array<class_Array>` | :ref:`get_glyph_list<class_FontFile_method_get_glyph_list>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |const| |
  101. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :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| |
  103. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :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| |
  105. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :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| |
  107. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :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| |
  109. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :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| |
  111. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`Array<class_Array>` | :ref:`get_kerning_list<class_FontFile_method_get_kerning_list>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const| |
  113. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :ref:`bool<class_bool>` | :ref:`get_language_support_override<class_FontFile_method_get_language_support_override>` **(** :ref:`String<class_String>` language **)** |const| |
  115. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_language_support_overrides<class_FontFile_method_get_language_support_overrides>` **(** **)** |const| |
  117. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :ref:`bool<class_bool>` | :ref:`get_script_support_override<class_FontFile_method_get_script_support_override>` **(** :ref:`String<class_String>` script **)** |const| |
  119. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_script_support_overrides<class_FontFile_method_get_script_support_overrides>` **(** **)** |const| |
  121. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :ref:`Array<class_Array>` | :ref:`get_size_cache_list<class_FontFile_method_get_size_cache_list>` **(** :ref:`int<class_int>` cache_index **)** |const| |
  123. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :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| |
  125. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :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| |
  127. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | :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| |
  129. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`Transform2D<class_Transform2D>` | :ref:`get_transform<class_FontFile_method_get_transform>` **(** :ref:`int<class_int>` cache_index **)** |const| |
  131. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_variation_coordinates<class_FontFile_method_get_variation_coordinates>` **(** :ref:`int<class_int>` cache_index **)** |const| |
  133. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_bitmap_font<class_FontFile_method_load_bitmap_font>` **(** :ref:`String<class_String>` path **)** |
  135. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_dynamic_font<class_FontFile_method_load_dynamic_font>` **(** :ref:`String<class_String>` path **)** |
  137. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | void | :ref:`remove_cache<class_FontFile_method_remove_cache>` **(** :ref:`int<class_int>` cache_index **)** |
  139. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | 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 **)** |
  141. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | 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 **)** |
  143. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | void | :ref:`remove_language_support_override<class_FontFile_method_remove_language_support_override>` **(** :ref:`String<class_String>` language **)** |
  145. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | void | :ref:`remove_script_support_override<class_FontFile_method_remove_script_support_override>` **(** :ref:`String<class_String>` script **)** |
  147. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | void | :ref:`remove_size_cache<class_FontFile_method_remove_size_cache>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |
  149. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | 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 **)** |
  151. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | 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 **)** |
  153. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | 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 **)** |
  155. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | 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 **)** |
  157. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | 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 **)** |
  159. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | 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 **)** |
  161. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | 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 **)** |
  163. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | 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 **)** |
  165. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | void | :ref:`set_embolden<class_FontFile_method_set_embolden>` **(** :ref:`int<class_int>` cache_index, :ref:`float<class_float>` strength **)** |
  167. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | void | :ref:`set_face_index<class_FontFile_method_set_face_index>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` face_index **)** |
  169. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | 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 **)** |
  171. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | 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 **)** |
  173. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | 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 **)** |
  175. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | 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 **)** |
  177. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | 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 **)** |
  179. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | 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 **)** |
  181. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | void | :ref:`set_language_support_override<class_FontFile_method_set_language_support_override>` **(** :ref:`String<class_String>` language, :ref:`bool<class_bool>` supported **)** |
  183. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | void | :ref:`set_script_support_override<class_FontFile_method_set_script_support_override>` **(** :ref:`String<class_String>` script, :ref:`bool<class_bool>` supported **)** |
  185. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | 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 **)** |
  187. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | 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 **)** |
  189. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | void | :ref:`set_transform<class_FontFile_method_set_transform>` **(** :ref:`int<class_int>` cache_index, :ref:`Transform2D<class_Transform2D>` transform **)** |
  191. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | void | :ref:`set_variation_coordinates<class_FontFile_method_set_variation_coordinates>` **(** :ref:`int<class_int>` cache_index, :ref:`Dictionary<class_Dictionary>` variation_coordinates **)** |
  193. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. Property Descriptions
  195. ---------------------
  196. .. _class_FontFile_property_antialiased:
  197. - :ref:`bool<class_bool>` **antialiased**
  198. +-----------+------------------------+
  199. | *Default* | ``true`` |
  200. +-----------+------------------------+
  201. | *Setter* | set_antialiased(value) |
  202. +-----------+------------------------+
  203. | *Getter* | is_antialiased() |
  204. +-----------+------------------------+
  205. If set to ``true``, font 8-bit anitialiased glyph rendering is supported and enabled.
  206. ----
  207. .. _class_FontFile_property_data:
  208. - :ref:`PackedByteArray<class_PackedByteArray>` **data**
  209. +-----------+-----------------------+
  210. | *Default* | ``PackedByteArray()`` |
  211. +-----------+-----------------------+
  212. | *Setter* | set_data(value) |
  213. +-----------+-----------------------+
  214. | *Getter* | get_data() |
  215. +-----------+-----------------------+
  216. Contents of the dynamic font source file.
  217. ----
  218. .. _class_FontFile_property_fallbacks:
  219. - :ref:`Font[]<class_Font>` **fallbacks**
  220. +-----------+----------------------+
  221. | *Default* | ``[]`` |
  222. +-----------+----------------------+
  223. | *Setter* | set_fallbacks(value) |
  224. +-----------+----------------------+
  225. | *Getter* | get_fallbacks() |
  226. +-----------+----------------------+
  227. Array of fallback :ref:`Font<class_Font>`\ s.
  228. ----
  229. .. _class_FontFile_property_fixed_size:
  230. - :ref:`int<class_int>` **fixed_size**
  231. +-----------+-----------------------+
  232. | *Default* | ``0`` |
  233. +-----------+-----------------------+
  234. | *Setter* | set_fixed_size(value) |
  235. +-----------+-----------------------+
  236. | *Getter* | get_fixed_size() |
  237. +-----------+-----------------------+
  238. Font size, used only for the bitmap fonts.
  239. ----
  240. .. _class_FontFile_property_font_name:
  241. - :ref:`String<class_String>` **font_name**
  242. +-----------+----------------------+
  243. | *Default* | ``""`` |
  244. +-----------+----------------------+
  245. | *Setter* | set_font_name(value) |
  246. +-----------+----------------------+
  247. | *Getter* | get_font_name() |
  248. +-----------+----------------------+
  249. Font family name.
  250. ----
  251. .. _class_FontFile_property_font_style:
  252. - :ref:`FontStyle<enum_TextServer_FontStyle>` **font_style**
  253. +-----------+-----------------------+
  254. | *Default* | ``0`` |
  255. +-----------+-----------------------+
  256. | *Setter* | set_font_style(value) |
  257. +-----------+-----------------------+
  258. | *Getter* | get_font_style() |
  259. +-----------+-----------------------+
  260. Font style flags, see :ref:`FontStyle<enum_TextServer_FontStyle>`.
  261. ----
  262. .. _class_FontFile_property_force_autohinter:
  263. - :ref:`bool<class_bool>` **force_autohinter**
  264. +-----------+-----------------------------+
  265. | *Default* | ``false`` |
  266. +-----------+-----------------------------+
  267. | *Setter* | set_force_autohinter(value) |
  268. +-----------+-----------------------------+
  269. | *Getter* | is_force_autohinter() |
  270. +-----------+-----------------------------+
  271. If set to ``true``, auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only.
  272. ----
  273. .. _class_FontFile_property_generate_mipmaps:
  274. - :ref:`bool<class_bool>` **generate_mipmaps**
  275. +-----------+-----------------------------+
  276. | *Default* | ``false`` |
  277. +-----------+-----------------------------+
  278. | *Setter* | set_generate_mipmaps(value) |
  279. +-----------+-----------------------------+
  280. | *Getter* | get_generate_mipmaps() |
  281. +-----------+-----------------------------+
  282. If set to ``true``, generate mipmaps for the font textures.
  283. ----
  284. .. _class_FontFile_property_hinting:
  285. - :ref:`Hinting<enum_TextServer_Hinting>` **hinting**
  286. +-----------+--------------------+
  287. | *Default* | ``1`` |
  288. +-----------+--------------------+
  289. | *Setter* | set_hinting(value) |
  290. +-----------+--------------------+
  291. | *Getter* | get_hinting() |
  292. +-----------+--------------------+
  293. Font hinting mode. Used by dynamic fonts only.
  294. ----
  295. .. _class_FontFile_property_msdf_pixel_range:
  296. - :ref:`int<class_int>` **msdf_pixel_range**
  297. +-----------+-----------------------------+
  298. | *Default* | ``16`` |
  299. +-----------+-----------------------------+
  300. | *Setter* | set_msdf_pixel_range(value) |
  301. +-----------+-----------------------------+
  302. | *Getter* | get_msdf_pixel_range() |
  303. +-----------+-----------------------------+
  304. The width of the range around the shape between the minimum and maximum representable signed distance.
  305. ----
  306. .. _class_FontFile_property_msdf_size:
  307. - :ref:`int<class_int>` **msdf_size**
  308. +-----------+----------------------+
  309. | *Default* | ``48`` |
  310. +-----------+----------------------+
  311. | *Setter* | set_msdf_size(value) |
  312. +-----------+----------------------+
  313. | *Getter* | get_msdf_size() |
  314. +-----------+----------------------+
  315. Source font size used to generate MSDF textures.
  316. ----
  317. .. _class_FontFile_property_multichannel_signed_distance_field:
  318. - :ref:`bool<class_bool>` **multichannel_signed_distance_field**
  319. +-----------+-----------------------------------------------+
  320. | *Default* | ``false`` |
  321. +-----------+-----------------------------------------------+
  322. | *Setter* | set_multichannel_signed_distance_field(value) |
  323. +-----------+-----------------------------------------------+
  324. | *Getter* | is_multichannel_signed_distance_field() |
  325. +-----------+-----------------------------------------------+
  326. If set to ``true``, glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
  327. ----
  328. .. _class_FontFile_property_opentype_feature_overrides:
  329. - :ref:`Dictionary<class_Dictionary>` **opentype_feature_overrides**
  330. +-----------+---------------------------------------+
  331. | *Default* | ``{}`` |
  332. +-----------+---------------------------------------+
  333. | *Setter* | set_opentype_feature_overrides(value) |
  334. +-----------+---------------------------------------+
  335. | *Getter* | get_opentype_feature_overrides() |
  336. +-----------+---------------------------------------+
  337. Font OpenType feature set override.
  338. ----
  339. .. _class_FontFile_property_oversampling:
  340. - :ref:`float<class_float>` **oversampling**
  341. +-----------+-------------------------+
  342. | *Default* | ``0.0`` |
  343. +-----------+-------------------------+
  344. | *Setter* | set_oversampling(value) |
  345. +-----------+-------------------------+
  346. | *Getter* | get_oversampling() |
  347. +-----------+-------------------------+
  348. Font oversampling factor, if set to ``0.0`` global oversampling factor is used instead. Used by dynamic fonts only.
  349. ----
  350. .. _class_FontFile_property_style_name:
  351. - :ref:`String<class_String>` **style_name**
  352. +-----------+----------------------------+
  353. | *Default* | ``""`` |
  354. +-----------+----------------------------+
  355. | *Setter* | set_font_style_name(value) |
  356. +-----------+----------------------------+
  357. | *Getter* | get_font_style_name() |
  358. +-----------+----------------------------+
  359. Font style name.
  360. ----
  361. .. _class_FontFile_property_subpixel_positioning:
  362. - :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>` **subpixel_positioning**
  363. +-----------+---------------------------------+
  364. | *Default* | ``1`` |
  365. +-----------+---------------------------------+
  366. | *Setter* | set_subpixel_positioning(value) |
  367. +-----------+---------------------------------+
  368. | *Getter* | get_subpixel_positioning() |
  369. +-----------+---------------------------------+
  370. Font glyph sub-pixel 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.
  371. Method Descriptions
  372. -------------------
  373. .. _class_FontFile_method_clear_cache:
  374. - void **clear_cache** **(** **)**
  375. Removes all font cache entries.
  376. ----
  377. .. _class_FontFile_method_clear_glyphs:
  378. - void **clear_glyphs** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)**
  379. Removes all rendered glyphs information from the cache entry.
  380. \ **Note:** This function will not remove textures associated with the glyphs, use :ref:`remove_texture<class_FontFile_method_remove_texture>` to remove them manually.
  381. ----
  382. .. _class_FontFile_method_clear_kerning_map:
  383. - void **clear_kerning_map** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)**
  384. Removes all kerning overrides.
  385. ----
  386. .. _class_FontFile_method_clear_size_cache:
  387. - void **clear_size_cache** **(** :ref:`int<class_int>` cache_index **)**
  388. Removes all font sizes from the cache entry
  389. ----
  390. .. _class_FontFile_method_clear_textures:
  391. - void **clear_textures** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)**
  392. Removes all textures from font cache entry.
  393. \ **Note:** This function will not remove glyphs associated with the texture, use :ref:`remove_glyph<class_FontFile_method_remove_glyph>` to remove them manually.
  394. ----
  395. .. _class_FontFile_method_get_cache_ascent:
  396. - :ref:`float<class_float>` **get_cache_ascent** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  397. Returns the font ascent (number of pixels above the baseline).
  398. ----
  399. .. _class_FontFile_method_get_cache_count:
  400. - :ref:`int<class_int>` **get_cache_count** **(** **)** |const|
  401. Returns number of the font cache entries.
  402. ----
  403. .. _class_FontFile_method_get_cache_descent:
  404. - :ref:`float<class_float>` **get_cache_descent** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  405. ----
  406. .. _class_FontFile_method_get_cache_scale:
  407. - :ref:`float<class_float>` **get_cache_scale** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  408. ----
  409. .. _class_FontFile_method_get_cache_underline_position:
  410. - :ref:`float<class_float>` **get_cache_underline_position** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  411. ----
  412. .. _class_FontFile_method_get_cache_underline_thickness:
  413. - :ref:`float<class_float>` **get_cache_underline_thickness** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  414. ----
  415. .. _class_FontFile_method_get_embolden:
  416. - :ref:`float<class_float>` **get_embolden** **(** :ref:`int<class_int>` cache_index **)** |const|
  417. Returns embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness.
  418. ----
  419. .. _class_FontFile_method_get_face_index:
  420. - :ref:`int<class_int>` **get_face_index** **(** :ref:`int<class_int>` cache_index **)** |const|
  421. Recturns an active face index in the TrueType / OpenType collection.
  422. ----
  423. .. _class_FontFile_method_get_glyph_advance:
  424. - :ref:`Vector2<class_Vector2>` **get_glyph_advance** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`int<class_int>` glyph **)** |const|
  425. Returns glyph advance (offset of the next glyph).
  426. \ **Note:** Advance for glyphs outlines is the same as the base glyph advance and is not saved.
  427. ----
  428. .. _class_FontFile_method_get_glyph_index:
  429. - :ref:`int<class_int>` **get_glyph_index** **(** :ref:`int<class_int>` size, :ref:`int<class_int>` char, :ref:`int<class_int>` variation_selector **)** |const|
  430. Returns the glyph index of a ``char``, optionally modified by the ``variation_selector``.
  431. ----
  432. .. _class_FontFile_method_get_glyph_list:
  433. - :ref:`Array<class_Array>` **get_glyph_list** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |const|
  434. Returns list of rendered glyphs in the cache entry.
  435. ----
  436. .. _class_FontFile_method_get_glyph_offset:
  437. - :ref:`Vector2<class_Vector2>` **get_glyph_offset** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const|
  438. Returns glyph offset from the baseline.
  439. ----
  440. .. _class_FontFile_method_get_glyph_size:
  441. - :ref:`Vector2<class_Vector2>` **get_glyph_size** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const|
  442. Returns glyph size.
  443. ----
  444. .. _class_FontFile_method_get_glyph_texture_idx:
  445. - :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|
  446. Returns index of the cache texture containing the glyph.
  447. ----
  448. .. _class_FontFile_method_get_glyph_uv_rect:
  449. - :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|
  450. Returns rectangle in the cache texture containing the glyph.
  451. ----
  452. .. _class_FontFile_method_get_kerning:
  453. - :ref:`Vector2<class_Vector2>` **get_kerning** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`Vector2i<class_Vector2i>` glyph_pair **)** |const|
  454. Returns kerning for the pair of glyphs.
  455. ----
  456. .. _class_FontFile_method_get_kerning_list:
  457. - :ref:`Array<class_Array>` **get_kerning_list** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  458. Returns list of the kerning overrides.
  459. ----
  460. .. _class_FontFile_method_get_language_support_override:
  461. - :ref:`bool<class_bool>` **get_language_support_override** **(** :ref:`String<class_String>` language **)** |const|
  462. Returns ``true`` if support override is enabled for the ``language``.
  463. ----
  464. .. _class_FontFile_method_get_language_support_overrides:
  465. - :ref:`PackedStringArray<class_PackedStringArray>` **get_language_support_overrides** **(** **)** |const|
  466. Returns list of language support overrides.
  467. ----
  468. .. _class_FontFile_method_get_script_support_override:
  469. - :ref:`bool<class_bool>` **get_script_support_override** **(** :ref:`String<class_String>` script **)** |const|
  470. Returns ``true`` if support override is enabled for the ``script``.
  471. ----
  472. .. _class_FontFile_method_get_script_support_overrides:
  473. - :ref:`PackedStringArray<class_PackedStringArray>` **get_script_support_overrides** **(** **)** |const|
  474. Returns list of script support overrides.
  475. ----
  476. .. _class_FontFile_method_get_size_cache_list:
  477. - :ref:`Array<class_Array>` **get_size_cache_list** **(** :ref:`int<class_int>` cache_index **)** |const|
  478. Returns list of the font sizes in the cache. Each size is ``Vector2i`` with font size and outline size.
  479. ----
  480. .. _class_FontFile_method_get_texture_count:
  481. - :ref:`int<class_int>` **get_texture_count** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |const|
  482. Returns number of textures used by font cache entry.
  483. ----
  484. .. _class_FontFile_method_get_texture_image:
  485. - :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|
  486. Returns a copy of the font cache texture image.
  487. ----
  488. .. _class_FontFile_method_get_texture_offsets:
  489. - :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|
  490. Returns a copy of the array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty.
  491. ----
  492. .. _class_FontFile_method_get_transform:
  493. - :ref:`Transform2D<class_Transform2D>` **get_transform** **(** :ref:`int<class_int>` cache_index **)** |const|
  494. Returns 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs.
  495. ----
  496. .. _class_FontFile_method_get_variation_coordinates:
  497. - :ref:`Dictionary<class_Dictionary>` **get_variation_coordinates** **(** :ref:`int<class_int>` cache_index **)** |const|
  498. 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.
  499. ----
  500. .. _class_FontFile_method_load_bitmap_font:
  501. - :ref:`Error<enum_@GlobalScope_Error>` **load_bitmap_font** **(** :ref:`String<class_String>` path **)**
  502. Loads an AngelCode BMFont (.fnt, .font) bitmap font from file ``path``.
  503. \ **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.
  504. ----
  505. .. _class_FontFile_method_load_dynamic_font:
  506. - :ref:`Error<enum_@GlobalScope_Error>` **load_dynamic_font** **(** :ref:`String<class_String>` path **)**
  507. Loads a TrueType (.ttf), OpenType (.otf), WOFF (.woff), WOFF2 (.woff2) or Type 1 (.pfb, .pfm) dynamic font from file ``path``.
  508. \ **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.
  509. ----
  510. .. _class_FontFile_method_remove_cache:
  511. - void **remove_cache** **(** :ref:`int<class_int>` cache_index **)**
  512. Removes specified font cache entry.
  513. ----
  514. .. _class_FontFile_method_remove_glyph:
  515. - void **remove_glyph** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)**
  516. Removes specified rendered glyph information from the cache entry.
  517. \ **Note:** This function will not remove textures associated with the glyphs, use :ref:`remove_texture<class_FontFile_method_remove_texture>` to remove them manually.
  518. ----
  519. .. _class_FontFile_method_remove_kerning:
  520. - void **remove_kerning** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`Vector2i<class_Vector2i>` glyph_pair **)**
  521. Removes kerning override for the pair of glyphs.
  522. ----
  523. .. _class_FontFile_method_remove_language_support_override:
  524. - void **remove_language_support_override** **(** :ref:`String<class_String>` language **)**
  525. Remove language support override.
  526. ----
  527. .. _class_FontFile_method_remove_script_support_override:
  528. - void **remove_script_support_override** **(** :ref:`String<class_String>` script **)**
  529. Removes script support override.
  530. ----
  531. .. _class_FontFile_method_remove_size_cache:
  532. - void **remove_size_cache** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)**
  533. Removes specified font size from the cache entry.
  534. ----
  535. .. _class_FontFile_method_remove_texture:
  536. - void **remove_texture** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index **)**
  537. Removes specified texture from the cache entry.
  538. \ **Note:** This function will not remove glyphs associated with the texture. Remove them manually using :ref:`remove_glyph<class_FontFile_method_remove_glyph>`.
  539. ----
  540. .. _class_FontFile_method_render_glyph:
  541. - void **render_glyph** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` index **)**
  542. Renders specified glyph to the font cache texture.
  543. ----
  544. .. _class_FontFile_method_render_range:
  545. - void **render_range** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` start, :ref:`int<class_int>` end **)**
  546. Renders the range of characters to the font cache texture.
  547. ----
  548. .. _class_FontFile_method_set_cache_ascent:
  549. - void **set_cache_ascent** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` ascent **)**
  550. ----
  551. .. _class_FontFile_method_set_cache_descent:
  552. - void **set_cache_descent** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` descent **)**
  553. ----
  554. .. _class_FontFile_method_set_cache_scale:
  555. - void **set_cache_scale** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` scale **)**
  556. ----
  557. .. _class_FontFile_method_set_cache_underline_position:
  558. - void **set_cache_underline_position** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` underline_position **)**
  559. ----
  560. .. _class_FontFile_method_set_cache_underline_thickness:
  561. - void **set_cache_underline_thickness** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` underline_thickness **)**
  562. ----
  563. .. _class_FontFile_method_set_embolden:
  564. - void **set_embolden** **(** :ref:`int<class_int>` cache_index, :ref:`float<class_float>` strength **)**
  565. Sets embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness.
  566. ----
  567. .. _class_FontFile_method_set_face_index:
  568. - void **set_face_index** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` face_index **)**
  569. Sets an active face index in the TrueType / OpenType collection.
  570. ----
  571. .. _class_FontFile_method_set_glyph_advance:
  572. - 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 **)**
  573. Sets glyph advance (offset of the next glyph).
  574. \ **Note:** Advance for glyphs outlines is the same as the base glyph advance and is not saved.
  575. ----
  576. .. _class_FontFile_method_set_glyph_offset:
  577. - 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 **)**
  578. Sets glyph offset from the baseline.
  579. ----
  580. .. _class_FontFile_method_set_glyph_size:
  581. - 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 **)**
  582. Sets glyph size.
  583. ----
  584. .. _class_FontFile_method_set_glyph_texture_idx:
  585. - 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 **)**
  586. Sets index of the cache texture containing the glyph.
  587. ----
  588. .. _class_FontFile_method_set_glyph_uv_rect:
  589. - 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 **)**
  590. Sets rectangle in the cache texture containing the glyph.
  591. ----
  592. .. _class_FontFile_method_set_kerning:
  593. - 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 **)**
  594. Sets kerning for the pair of glyphs.
  595. ----
  596. .. _class_FontFile_method_set_language_support_override:
  597. - void **set_language_support_override** **(** :ref:`String<class_String>` language, :ref:`bool<class_bool>` supported **)**
  598. Adds override for :ref:`Font.is_language_supported<class_Font_method_is_language_supported>`.
  599. ----
  600. .. _class_FontFile_method_set_script_support_override:
  601. - void **set_script_support_override** **(** :ref:`String<class_String>` script, :ref:`bool<class_bool>` supported **)**
  602. Adds override for :ref:`Font.is_script_supported<class_Font_method_is_script_supported>`.
  603. ----
  604. .. _class_FontFile_method_set_texture_image:
  605. - 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 **)**
  606. Sets font cache texture image.
  607. ----
  608. .. _class_FontFile_method_set_texture_offsets:
  609. - 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 **)**
  610. Sets array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty (for the fonts without dynamic glyph generation support).
  611. ----
  612. .. _class_FontFile_method_set_transform:
  613. - void **set_transform** **(** :ref:`int<class_int>` cache_index, :ref:`Transform2D<class_Transform2D>` transform **)**
  614. Sets 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs.
  615. ----
  616. .. _class_FontFile_method_set_variation_coordinates:
  617. - void **set_variation_coordinates** **(** :ref:`int<class_int>` cache_index, :ref:`Dictionary<class_Dictionary>` variation_coordinates **)**
  618. 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.
  619. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  620. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  621. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  622. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  623. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  624. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`