class_fontfile.rst 94 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483
  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. Holds font source data and prerendered glyph cache, imported from a dynamic or a bitmap font.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **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.
  15. Use :ref:`FontVariation<class_FontVariation>` to access specific OpenType variation of the font, create simulated bold / slanted version, and draw lines of text.
  16. For more complex text processing, use :ref:`FontVariation<class_FontVariation>` in conjunction with :ref:`TextLine<class_TextLine>` or :ref:`TextParagraph<class_TextParagraph>`.
  17. Supported font formats:
  18. - Dynamic font importer: TrueType (.ttf), TrueType collection (.ttc), OpenType (.otf), OpenType collection (.otc), WOFF (.woff), WOFF2 (.woff2), Type 1 (.pfb, .pfm).
  19. - Bitmap font importer: AngelCode BMFont (.fnt, .font), text and binary (version 3) format variants.
  20. - Monospace image font importer: All supported image formats.
  21. \ **Note:** A character is a symbol that represents an item (letter, digit etc.) in an abstract way.
  22. \ **Note:** A glyph is a bitmap or a shape used to draw one or more characters in a context-dependent manner. Glyph indices are bound to the specific font data source.
  23. \ **Note:** If 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.
  24. .. tabs::
  25. .. code-tab:: gdscript
  26. var f = load("res://BarlowCondensed-Bold.ttf")
  27. $Label.add_theme_font_override("font", f)
  28. $Label.add_theme_font_size_override("font_size", 64)
  29. .. code-tab:: csharp
  30. var f = ResourceLoader.Load<FontFile>("res://BarlowCondensed-Bold.ttf");
  31. GetNode("Label").AddThemeFontOverride("font", f);
  32. GetNode("Label").AddThemeFontSizeOverride("font_size", 64);
  33. .. rst-class:: classref-introduction-group
  34. Tutorials
  35. ---------
  36. - :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>`
  37. .. rst-class:: classref-reftable-group
  38. Properties
  39. ----------
  40. .. table::
  41. :widths: auto
  42. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  43. | :ref:`bool<class_bool>` | :ref:`allow_system_fallback<class_FontFile_property_allow_system_fallback>` | ``true`` |
  44. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  45. | :ref:`FontAntialiasing<enum_TextServer_FontAntialiasing>` | :ref:`antialiasing<class_FontFile_property_antialiasing>` | ``1`` |
  46. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  47. | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`data<class_FontFile_property_data>` | ``PackedByteArray()`` |
  48. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  49. | :ref:`bool<class_bool>` | :ref:`disable_embedded_bitmaps<class_FontFile_property_disable_embedded_bitmaps>` | ``true`` |
  50. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  51. | :ref:`int<class_int>` | :ref:`fixed_size<class_FontFile_property_fixed_size>` | ``0`` |
  52. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  53. | :ref:`FixedSizeScaleMode<enum_TextServer_FixedSizeScaleMode>` | :ref:`fixed_size_scale_mode<class_FontFile_property_fixed_size_scale_mode>` | ``0`` |
  54. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  55. | :ref:`String<class_String>` | :ref:`font_name<class_FontFile_property_font_name>` | ``""`` |
  56. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  57. | :ref:`int<class_int>` | :ref:`font_stretch<class_FontFile_property_font_stretch>` | ``100`` |
  58. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  59. | |bitfield|\[:ref:`FontStyle<enum_TextServer_FontStyle>`\] | :ref:`font_style<class_FontFile_property_font_style>` | ``0`` |
  60. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  61. | :ref:`int<class_int>` | :ref:`font_weight<class_FontFile_property_font_weight>` | ``400`` |
  62. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  63. | :ref:`bool<class_bool>` | :ref:`force_autohinter<class_FontFile_property_force_autohinter>` | ``false`` |
  64. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  65. | :ref:`bool<class_bool>` | :ref:`generate_mipmaps<class_FontFile_property_generate_mipmaps>` | ``false`` |
  66. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  67. | :ref:`Hinting<enum_TextServer_Hinting>` | :ref:`hinting<class_FontFile_property_hinting>` | ``1`` |
  68. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  69. | :ref:`bool<class_bool>` | :ref:`keep_rounding_remainders<class_FontFile_property_keep_rounding_remainders>` | ``true`` |
  70. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  71. | :ref:`bool<class_bool>` | :ref:`modulate_color_glyphs<class_FontFile_property_modulate_color_glyphs>` | ``false`` |
  72. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  73. | :ref:`int<class_int>` | :ref:`msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` | ``16`` |
  74. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  75. | :ref:`int<class_int>` | :ref:`msdf_size<class_FontFile_property_msdf_size>` | ``48`` |
  76. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  77. | :ref:`bool<class_bool>` | :ref:`multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` | ``false`` |
  78. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  79. | :ref:`Dictionary<class_Dictionary>` | :ref:`opentype_feature_overrides<class_FontFile_property_opentype_feature_overrides>` | ``{}`` |
  80. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  81. | :ref:`float<class_float>` | :ref:`oversampling<class_FontFile_property_oversampling>` | ``0.0`` |
  82. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  83. | :ref:`String<class_String>` | :ref:`style_name<class_FontFile_property_style_name>` | ``""`` |
  84. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  85. | :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>` | :ref:`subpixel_positioning<class_FontFile_property_subpixel_positioning>` | ``1`` |
  86. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  87. .. rst-class:: classref-reftable-group
  88. Methods
  89. -------
  90. .. table::
  91. :widths: auto
  92. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | |void| | :ref:`clear_cache<class_FontFile_method_clear_cache>`\ (\ ) |
  94. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | |void| | :ref:`clear_glyphs<class_FontFile_method_clear_glyphs>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) |
  96. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | |void| | :ref:`clear_kerning_map<class_FontFile_method_clear_kerning_map>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |
  98. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | |void| | :ref:`clear_size_cache<class_FontFile_method_clear_size_cache>`\ (\ cache_index\: :ref:`int<class_int>`\ ) |
  100. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | |void| | :ref:`clear_textures<class_FontFile_method_clear_textures>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) |
  102. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`float<class_float>` | :ref:`get_cache_ascent<class_FontFile_method_get_cache_ascent>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| |
  104. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`int<class_int>` | :ref:`get_cache_count<class_FontFile_method_get_cache_count>`\ (\ ) |const| |
  106. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`float<class_float>` | :ref:`get_cache_descent<class_FontFile_method_get_cache_descent>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| |
  108. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`float<class_float>` | :ref:`get_cache_scale<class_FontFile_method_get_cache_scale>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| |
  110. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`float<class_float>` | :ref:`get_cache_underline_position<class_FontFile_method_get_cache_underline_position>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| |
  112. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`float<class_float>` | :ref:`get_cache_underline_thickness<class_FontFile_method_get_cache_underline_thickness>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| |
  114. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :ref:`int<class_int>` | :ref:`get_char_from_glyph_index<class_FontFile_method_get_char_from_glyph_index>`\ (\ size\: :ref:`int<class_int>`, glyph_index\: :ref:`int<class_int>`\ ) |const| |
  116. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | :ref:`float<class_float>` | :ref:`get_embolden<class_FontFile_method_get_embolden>`\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| |
  118. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | :ref:`float<class_float>` | :ref:`get_extra_baseline_offset<class_FontFile_method_get_extra_baseline_offset>`\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| |
  120. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | :ref:`int<class_int>` | :ref:`get_extra_spacing<class_FontFile_method_get_extra_spacing>`\ (\ cache_index\: :ref:`int<class_int>`, spacing\: :ref:`SpacingType<enum_TextServer_SpacingType>`\ ) |const| |
  122. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | :ref:`int<class_int>` | :ref:`get_face_index<class_FontFile_method_get_face_index>`\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| |
  124. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | :ref:`Vector2<class_Vector2>` | :ref:`get_glyph_advance<class_FontFile_method_get_glyph_advance>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph\: :ref:`int<class_int>`\ ) |const| |
  126. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | :ref:`int<class_int>` | :ref:`get_glyph_index<class_FontFile_method_get_glyph_index>`\ (\ size\: :ref:`int<class_int>`, char\: :ref:`int<class_int>`, variation_selector\: :ref:`int<class_int>`\ ) |const| |
  128. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_glyph_list<class_FontFile_method_get_glyph_list>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) |const| |
  130. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | :ref:`Vector2<class_Vector2>` | :ref:`get_glyph_offset<class_FontFile_method_get_glyph_offset>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |const| |
  132. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | :ref:`Vector2<class_Vector2>` | :ref:`get_glyph_size<class_FontFile_method_get_glyph_size>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |const| |
  134. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | :ref:`int<class_int>` | :ref:`get_glyph_texture_idx<class_FontFile_method_get_glyph_texture_idx>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |const| |
  136. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | :ref:`Rect2<class_Rect2>` | :ref:`get_glyph_uv_rect<class_FontFile_method_get_glyph_uv_rect>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |const| |
  138. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | :ref:`Vector2<class_Vector2>` | :ref:`get_kerning<class_FontFile_method_get_kerning>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph_pair\: :ref:`Vector2i<class_Vector2i>`\ ) |const| |
  140. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | :ref:`Array<class_Array>`\[:ref:`Vector2i<class_Vector2i>`\] | :ref:`get_kerning_list<class_FontFile_method_get_kerning_list>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| |
  142. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | :ref:`bool<class_bool>` | :ref:`get_language_support_override<class_FontFile_method_get_language_support_override>`\ (\ language\: :ref:`String<class_String>`\ ) |const| |
  144. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_language_support_overrides<class_FontFile_method_get_language_support_overrides>`\ (\ ) |const| |
  146. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | :ref:`bool<class_bool>` | :ref:`get_script_support_override<class_FontFile_method_get_script_support_override>`\ (\ script\: :ref:`String<class_String>`\ ) |const| |
  148. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_script_support_overrides<class_FontFile_method_get_script_support_overrides>`\ (\ ) |const| |
  150. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | :ref:`Array<class_Array>`\[:ref:`Vector2i<class_Vector2i>`\] | :ref:`get_size_cache_list<class_FontFile_method_get_size_cache_list>`\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| |
  152. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | :ref:`int<class_int>` | :ref:`get_texture_count<class_FontFile_method_get_texture_count>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) |const| |
  154. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | :ref:`Image<class_Image>` | :ref:`get_texture_image<class_FontFile_method_get_texture_image>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`\ ) |const| |
  156. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_texture_offsets<class_FontFile_method_get_texture_offsets>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`\ ) |const| |
  158. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | :ref:`Transform2D<class_Transform2D>` | :ref:`get_transform<class_FontFile_method_get_transform>`\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| |
  160. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_variation_coordinates<class_FontFile_method_get_variation_coordinates>`\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| |
  162. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  163. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_bitmap_font<class_FontFile_method_load_bitmap_font>`\ (\ path\: :ref:`String<class_String>`\ ) |
  164. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  165. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_dynamic_font<class_FontFile_method_load_dynamic_font>`\ (\ path\: :ref:`String<class_String>`\ ) |
  166. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  167. | |void| | :ref:`remove_cache<class_FontFile_method_remove_cache>`\ (\ cache_index\: :ref:`int<class_int>`\ ) |
  168. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  169. | |void| | :ref:`remove_glyph<class_FontFile_method_remove_glyph>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |
  170. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  171. | |void| | :ref:`remove_kerning<class_FontFile_method_remove_kerning>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph_pair\: :ref:`Vector2i<class_Vector2i>`\ ) |
  172. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  173. | |void| | :ref:`remove_language_support_override<class_FontFile_method_remove_language_support_override>`\ (\ language\: :ref:`String<class_String>`\ ) |
  174. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  175. | |void| | :ref:`remove_script_support_override<class_FontFile_method_remove_script_support_override>`\ (\ script\: :ref:`String<class_String>`\ ) |
  176. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  177. | |void| | :ref:`remove_size_cache<class_FontFile_method_remove_size_cache>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) |
  178. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  179. | |void| | :ref:`remove_texture<class_FontFile_method_remove_texture>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`\ ) |
  180. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  181. | |void| | :ref:`render_glyph<class_FontFile_method_render_glyph>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, index\: :ref:`int<class_int>`\ ) |
  182. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  183. | |void| | :ref:`render_range<class_FontFile_method_render_range>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, start\: :ref:`int<class_int>`, end\: :ref:`int<class_int>`\ ) |
  184. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  185. | |void| | :ref:`set_cache_ascent<class_FontFile_method_set_cache_ascent>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, ascent\: :ref:`float<class_float>`\ ) |
  186. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  187. | |void| | :ref:`set_cache_descent<class_FontFile_method_set_cache_descent>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, descent\: :ref:`float<class_float>`\ ) |
  188. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  189. | |void| | :ref:`set_cache_scale<class_FontFile_method_set_cache_scale>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, scale\: :ref:`float<class_float>`\ ) |
  190. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  191. | |void| | :ref:`set_cache_underline_position<class_FontFile_method_set_cache_underline_position>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, underline_position\: :ref:`float<class_float>`\ ) |
  192. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  193. | |void| | :ref:`set_cache_underline_thickness<class_FontFile_method_set_cache_underline_thickness>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, underline_thickness\: :ref:`float<class_float>`\ ) |
  194. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  195. | |void| | :ref:`set_embolden<class_FontFile_method_set_embolden>`\ (\ cache_index\: :ref:`int<class_int>`, strength\: :ref:`float<class_float>`\ ) |
  196. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  197. | |void| | :ref:`set_extra_baseline_offset<class_FontFile_method_set_extra_baseline_offset>`\ (\ cache_index\: :ref:`int<class_int>`, baseline_offset\: :ref:`float<class_float>`\ ) |
  198. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  199. | |void| | :ref:`set_extra_spacing<class_FontFile_method_set_extra_spacing>`\ (\ cache_index\: :ref:`int<class_int>`, spacing\: :ref:`SpacingType<enum_TextServer_SpacingType>`, value\: :ref:`int<class_int>`\ ) |
  200. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  201. | |void| | :ref:`set_face_index<class_FontFile_method_set_face_index>`\ (\ cache_index\: :ref:`int<class_int>`, face_index\: :ref:`int<class_int>`\ ) |
  202. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  203. | |void| | :ref:`set_glyph_advance<class_FontFile_method_set_glyph_advance>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph\: :ref:`int<class_int>`, advance\: :ref:`Vector2<class_Vector2>`\ ) |
  204. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  205. | |void| | :ref:`set_glyph_offset<class_FontFile_method_set_glyph_offset>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`, offset\: :ref:`Vector2<class_Vector2>`\ ) |
  206. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  207. | |void| | :ref:`set_glyph_size<class_FontFile_method_set_glyph_size>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`, gl_size\: :ref:`Vector2<class_Vector2>`\ ) |
  208. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  209. | |void| | :ref:`set_glyph_texture_idx<class_FontFile_method_set_glyph_texture_idx>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`, texture_idx\: :ref:`int<class_int>`\ ) |
  210. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  211. | |void| | :ref:`set_glyph_uv_rect<class_FontFile_method_set_glyph_uv_rect>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`, uv_rect\: :ref:`Rect2<class_Rect2>`\ ) |
  212. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  213. | |void| | :ref:`set_kerning<class_FontFile_method_set_kerning>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph_pair\: :ref:`Vector2i<class_Vector2i>`, kerning\: :ref:`Vector2<class_Vector2>`\ ) |
  214. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  215. | |void| | :ref:`set_language_support_override<class_FontFile_method_set_language_support_override>`\ (\ language\: :ref:`String<class_String>`, supported\: :ref:`bool<class_bool>`\ ) |
  216. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  217. | |void| | :ref:`set_script_support_override<class_FontFile_method_set_script_support_override>`\ (\ script\: :ref:`String<class_String>`, supported\: :ref:`bool<class_bool>`\ ) |
  218. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  219. | |void| | :ref:`set_texture_image<class_FontFile_method_set_texture_image>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`, image\: :ref:`Image<class_Image>`\ ) |
  220. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  221. | |void| | :ref:`set_texture_offsets<class_FontFile_method_set_texture_offsets>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`, offset\: :ref:`PackedInt32Array<class_PackedInt32Array>`\ ) |
  222. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  223. | |void| | :ref:`set_transform<class_FontFile_method_set_transform>`\ (\ cache_index\: :ref:`int<class_int>`, transform\: :ref:`Transform2D<class_Transform2D>`\ ) |
  224. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  225. | |void| | :ref:`set_variation_coordinates<class_FontFile_method_set_variation_coordinates>`\ (\ cache_index\: :ref:`int<class_int>`, variation_coordinates\: :ref:`Dictionary<class_Dictionary>`\ ) |
  226. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  227. .. rst-class:: classref-section-separator
  228. ----
  229. .. rst-class:: classref-descriptions-group
  230. Property Descriptions
  231. ---------------------
  232. .. _class_FontFile_property_allow_system_fallback:
  233. .. rst-class:: classref-property
  234. :ref:`bool<class_bool>` **allow_system_fallback** = ``true`` :ref:`🔗<class_FontFile_property_allow_system_fallback>`
  235. .. rst-class:: classref-property-setget
  236. - |void| **set_allow_system_fallback**\ (\ value\: :ref:`bool<class_bool>`\ )
  237. - :ref:`bool<class_bool>` **is_allow_system_fallback**\ (\ )
  238. If set to ``true``, system fonts can be automatically used as fallbacks.
  239. .. rst-class:: classref-item-separator
  240. ----
  241. .. _class_FontFile_property_antialiasing:
  242. .. rst-class:: classref-property
  243. :ref:`FontAntialiasing<enum_TextServer_FontAntialiasing>` **antialiasing** = ``1`` :ref:`🔗<class_FontFile_property_antialiasing>`
  244. .. rst-class:: classref-property-setget
  245. - |void| **set_antialiasing**\ (\ value\: :ref:`FontAntialiasing<enum_TextServer_FontAntialiasing>`\ )
  246. - :ref:`FontAntialiasing<enum_TextServer_FontAntialiasing>` **get_antialiasing**\ (\ )
  247. Font anti-aliasing mode.
  248. .. rst-class:: classref-item-separator
  249. ----
  250. .. _class_FontFile_property_data:
  251. .. rst-class:: classref-property
  252. :ref:`PackedByteArray<class_PackedByteArray>` **data** = ``PackedByteArray()`` :ref:`🔗<class_FontFile_property_data>`
  253. .. rst-class:: classref-property-setget
  254. - |void| **set_data**\ (\ value\: :ref:`PackedByteArray<class_PackedByteArray>`\ )
  255. - :ref:`PackedByteArray<class_PackedByteArray>` **get_data**\ (\ )
  256. Contents of the dynamic font source file.
  257. **Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedByteArray<class_PackedByteArray>` for more details.
  258. .. rst-class:: classref-item-separator
  259. ----
  260. .. _class_FontFile_property_disable_embedded_bitmaps:
  261. .. rst-class:: classref-property
  262. :ref:`bool<class_bool>` **disable_embedded_bitmaps** = ``true`` :ref:`🔗<class_FontFile_property_disable_embedded_bitmaps>`
  263. .. rst-class:: classref-property-setget
  264. - |void| **set_disable_embedded_bitmaps**\ (\ value\: :ref:`bool<class_bool>`\ )
  265. - :ref:`bool<class_bool>` **get_disable_embedded_bitmaps**\ (\ )
  266. If set to ``true``, embedded font bitmap loading is disabled (bitmap-only and color fonts ignore this property).
  267. .. rst-class:: classref-item-separator
  268. ----
  269. .. _class_FontFile_property_fixed_size:
  270. .. rst-class:: classref-property
  271. :ref:`int<class_int>` **fixed_size** = ``0`` :ref:`🔗<class_FontFile_property_fixed_size>`
  272. .. rst-class:: classref-property-setget
  273. - |void| **set_fixed_size**\ (\ value\: :ref:`int<class_int>`\ )
  274. - :ref:`int<class_int>` **get_fixed_size**\ (\ )
  275. Font size, used only for the bitmap fonts.
  276. .. rst-class:: classref-item-separator
  277. ----
  278. .. _class_FontFile_property_fixed_size_scale_mode:
  279. .. rst-class:: classref-property
  280. :ref:`FixedSizeScaleMode<enum_TextServer_FixedSizeScaleMode>` **fixed_size_scale_mode** = ``0`` :ref:`🔗<class_FontFile_property_fixed_size_scale_mode>`
  281. .. rst-class:: classref-property-setget
  282. - |void| **set_fixed_size_scale_mode**\ (\ value\: :ref:`FixedSizeScaleMode<enum_TextServer_FixedSizeScaleMode>`\ )
  283. - :ref:`FixedSizeScaleMode<enum_TextServer_FixedSizeScaleMode>` **get_fixed_size_scale_mode**\ (\ )
  284. Scaling mode, used only for the bitmap fonts with :ref:`fixed_size<class_FontFile_property_fixed_size>` greater than zero.
  285. .. rst-class:: classref-item-separator
  286. ----
  287. .. _class_FontFile_property_font_name:
  288. .. rst-class:: classref-property
  289. :ref:`String<class_String>` **font_name** = ``""`` :ref:`🔗<class_FontFile_property_font_name>`
  290. .. rst-class:: classref-property-setget
  291. - |void| **set_font_name**\ (\ value\: :ref:`String<class_String>`\ )
  292. - :ref:`String<class_String>` **get_font_name**\ (\ )
  293. Font family name.
  294. .. rst-class:: classref-item-separator
  295. ----
  296. .. _class_FontFile_property_font_stretch:
  297. .. rst-class:: classref-property
  298. :ref:`int<class_int>` **font_stretch** = ``100`` :ref:`🔗<class_FontFile_property_font_stretch>`
  299. .. rst-class:: classref-property-setget
  300. - |void| **set_font_stretch**\ (\ value\: :ref:`int<class_int>`\ )
  301. - :ref:`int<class_int>` **get_font_stretch**\ (\ )
  302. Font stretch amount, compared to a normal width. A percentage value between ``50%`` and ``200%``.
  303. .. rst-class:: classref-item-separator
  304. ----
  305. .. _class_FontFile_property_font_style:
  306. .. rst-class:: classref-property
  307. |bitfield|\[:ref:`FontStyle<enum_TextServer_FontStyle>`\] **font_style** = ``0`` :ref:`🔗<class_FontFile_property_font_style>`
  308. .. rst-class:: classref-property-setget
  309. - |void| **set_font_style**\ (\ value\: |bitfield|\[:ref:`FontStyle<enum_TextServer_FontStyle>`\]\ )
  310. - |bitfield|\[:ref:`FontStyle<enum_TextServer_FontStyle>`\] **get_font_style**\ (\ )
  311. Font style flags.
  312. .. rst-class:: classref-item-separator
  313. ----
  314. .. _class_FontFile_property_font_weight:
  315. .. rst-class:: classref-property
  316. :ref:`int<class_int>` **font_weight** = ``400`` :ref:`🔗<class_FontFile_property_font_weight>`
  317. .. rst-class:: classref-property-setget
  318. - |void| **set_font_weight**\ (\ value\: :ref:`int<class_int>`\ )
  319. - :ref:`int<class_int>` **get_font_weight**\ (\ )
  320. Weight (boldness) of the font. A value in the ``100...999`` range, normal font weight is ``400``, bold font weight is ``700``.
  321. .. rst-class:: classref-item-separator
  322. ----
  323. .. _class_FontFile_property_force_autohinter:
  324. .. rst-class:: classref-property
  325. :ref:`bool<class_bool>` **force_autohinter** = ``false`` :ref:`🔗<class_FontFile_property_force_autohinter>`
  326. .. rst-class:: classref-property-setget
  327. - |void| **set_force_autohinter**\ (\ value\: :ref:`bool<class_bool>`\ )
  328. - :ref:`bool<class_bool>` **is_force_autohinter**\ (\ )
  329. If set to ``true``, auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only (MSDF fonts don't support hinting).
  330. .. rst-class:: classref-item-separator
  331. ----
  332. .. _class_FontFile_property_generate_mipmaps:
  333. .. rst-class:: classref-property
  334. :ref:`bool<class_bool>` **generate_mipmaps** = ``false`` :ref:`🔗<class_FontFile_property_generate_mipmaps>`
  335. .. rst-class:: classref-property-setget
  336. - |void| **set_generate_mipmaps**\ (\ value\: :ref:`bool<class_bool>`\ )
  337. - :ref:`bool<class_bool>` **get_generate_mipmaps**\ (\ )
  338. If set to ``true``, generate mipmaps for the font textures.
  339. .. rst-class:: classref-item-separator
  340. ----
  341. .. _class_FontFile_property_hinting:
  342. .. rst-class:: classref-property
  343. :ref:`Hinting<enum_TextServer_Hinting>` **hinting** = ``1`` :ref:`🔗<class_FontFile_property_hinting>`
  344. .. rst-class:: classref-property-setget
  345. - |void| **set_hinting**\ (\ value\: :ref:`Hinting<enum_TextServer_Hinting>`\ )
  346. - :ref:`Hinting<enum_TextServer_Hinting>` **get_hinting**\ (\ )
  347. Font hinting mode. Used by dynamic fonts only.
  348. .. rst-class:: classref-item-separator
  349. ----
  350. .. _class_FontFile_property_keep_rounding_remainders:
  351. .. rst-class:: classref-property
  352. :ref:`bool<class_bool>` **keep_rounding_remainders** = ``true`` :ref:`🔗<class_FontFile_property_keep_rounding_remainders>`
  353. .. rst-class:: classref-property-setget
  354. - |void| **set_keep_rounding_remainders**\ (\ value\: :ref:`bool<class_bool>`\ )
  355. - :ref:`bool<class_bool>` **get_keep_rounding_remainders**\ (\ )
  356. If set to ``true``, when aligning glyphs to the pixel boundaries rounding remainders are accumulated to ensure more uniform glyph distribution. This setting has no effect if subpixel positioning is enabled.
  357. .. rst-class:: classref-item-separator
  358. ----
  359. .. _class_FontFile_property_modulate_color_glyphs:
  360. .. rst-class:: classref-property
  361. :ref:`bool<class_bool>` **modulate_color_glyphs** = ``false`` :ref:`🔗<class_FontFile_property_modulate_color_glyphs>`
  362. .. rst-class:: classref-property-setget
  363. - |void| **set_modulate_color_glyphs**\ (\ value\: :ref:`bool<class_bool>`\ )
  364. - :ref:`bool<class_bool>` **is_modulate_color_glyphs**\ (\ )
  365. If set to ``true``, color modulation is applied when drawing colored glyphs, otherwise it's applied to the monochrome glyphs only.
  366. .. rst-class:: classref-item-separator
  367. ----
  368. .. _class_FontFile_property_msdf_pixel_range:
  369. .. rst-class:: classref-property
  370. :ref:`int<class_int>` **msdf_pixel_range** = ``16`` :ref:`🔗<class_FontFile_property_msdf_pixel_range>`
  371. .. rst-class:: classref-property-setget
  372. - |void| **set_msdf_pixel_range**\ (\ value\: :ref:`int<class_int>`\ )
  373. - :ref:`int<class_int>` **get_msdf_pixel_range**\ (\ )
  374. The width of the range around the shape between the minimum and maximum representable signed distance. If using font outlines, :ref:`msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` must be set to at least *twice* the size of the largest font outline. The default :ref:`msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` value of ``16`` allows outline sizes up to ``8`` to look correct.
  375. .. rst-class:: classref-item-separator
  376. ----
  377. .. _class_FontFile_property_msdf_size:
  378. .. rst-class:: classref-property
  379. :ref:`int<class_int>` **msdf_size** = ``48`` :ref:`🔗<class_FontFile_property_msdf_size>`
  380. .. rst-class:: classref-property-setget
  381. - |void| **set_msdf_size**\ (\ value\: :ref:`int<class_int>`\ )
  382. - :ref:`int<class_int>` **get_msdf_size**\ (\ )
  383. Source font size used to generate MSDF textures. Higher values allow for more precision, but are slower to render and require more memory. Only increase this value if you notice a visible lack of precision in glyph rendering.
  384. .. rst-class:: classref-item-separator
  385. ----
  386. .. _class_FontFile_property_multichannel_signed_distance_field:
  387. .. rst-class:: classref-property
  388. :ref:`bool<class_bool>` **multichannel_signed_distance_field** = ``false`` :ref:`🔗<class_FontFile_property_multichannel_signed_distance_field>`
  389. .. rst-class:: classref-property-setget
  390. - |void| **set_multichannel_signed_distance_field**\ (\ value\: :ref:`bool<class_bool>`\ )
  391. - :ref:`bool<class_bool>` **is_multichannel_signed_distance_field**\ (\ )
  392. If set to ``true``, glyphs of all sizes are rendered using single multichannel signed distance field (MSDF) generated from the dynamic font vector data. Since this approach does not rely on rasterizing the font every time its size changes, this allows for resizing the font in real-time without any performance penalty. Text will also not look grainy for :ref:`Control<class_Control>`\ s that are scaled down (or for :ref:`Label3D<class_Label3D>`\ s viewed from a long distance). As a downside, font hinting is not available with MSDF. The lack of font hinting may result in less crisp and less readable fonts at small sizes.
  393. \ **Note:** If using font outlines, :ref:`msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` must be set to at least *twice* the size of the largest font outline.
  394. \ **Note:** MSDF font rendering does not render glyphs with overlapping shapes correctly. Overlapping shapes are not valid per the OpenType standard, but are still commonly found in many font files, especially those converted by Google Fonts. To avoid issues with overlapping glyphs, consider downloading the font file directly from the type foundry instead of relying on Google Fonts.
  395. .. rst-class:: classref-item-separator
  396. ----
  397. .. _class_FontFile_property_opentype_feature_overrides:
  398. .. rst-class:: classref-property
  399. :ref:`Dictionary<class_Dictionary>` **opentype_feature_overrides** = ``{}`` :ref:`🔗<class_FontFile_property_opentype_feature_overrides>`
  400. .. rst-class:: classref-property-setget
  401. - |void| **set_opentype_feature_overrides**\ (\ value\: :ref:`Dictionary<class_Dictionary>`\ )
  402. - :ref:`Dictionary<class_Dictionary>` **get_opentype_feature_overrides**\ (\ )
  403. Font OpenType feature set override.
  404. .. rst-class:: classref-item-separator
  405. ----
  406. .. _class_FontFile_property_oversampling:
  407. .. rst-class:: classref-property
  408. :ref:`float<class_float>` **oversampling** = ``0.0`` :ref:`🔗<class_FontFile_property_oversampling>`
  409. .. rst-class:: classref-property-setget
  410. - |void| **set_oversampling**\ (\ value\: :ref:`float<class_float>`\ )
  411. - :ref:`float<class_float>` **get_oversampling**\ (\ )
  412. If set to a positive value, overrides the oversampling factor of the viewport this font is used in. See :ref:`Viewport.oversampling<class_Viewport_property_oversampling>`. This value doesn't override the ``oversampling`` parameter of ``draw_*`` methods.
  413. .. rst-class:: classref-item-separator
  414. ----
  415. .. _class_FontFile_property_style_name:
  416. .. rst-class:: classref-property
  417. :ref:`String<class_String>` **style_name** = ``""`` :ref:`🔗<class_FontFile_property_style_name>`
  418. .. rst-class:: classref-property-setget
  419. - |void| **set_font_style_name**\ (\ value\: :ref:`String<class_String>`\ )
  420. - :ref:`String<class_String>` **get_font_style_name**\ (\ )
  421. Font style name.
  422. .. rst-class:: classref-item-separator
  423. ----
  424. .. _class_FontFile_property_subpixel_positioning:
  425. .. rst-class:: classref-property
  426. :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>` **subpixel_positioning** = ``1`` :ref:`🔗<class_FontFile_property_subpixel_positioning>`
  427. .. rst-class:: classref-property-setget
  428. - |void| **set_subpixel_positioning**\ (\ value\: :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>`\ )
  429. - :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>` **get_subpixel_positioning**\ (\ )
  430. Font glyph subpixel positioning mode. Subpixel positioning provides shaper text and better kerning for smaller font sizes, at the cost of higher memory usage and lower font rasterization speed. Use :ref:`TextServer.SUBPIXEL_POSITIONING_AUTO<class_TextServer_constant_SUBPIXEL_POSITIONING_AUTO>` to automatically enable it based on the font size.
  431. .. rst-class:: classref-section-separator
  432. ----
  433. .. rst-class:: classref-descriptions-group
  434. Method Descriptions
  435. -------------------
  436. .. _class_FontFile_method_clear_cache:
  437. .. rst-class:: classref-method
  438. |void| **clear_cache**\ (\ ) :ref:`🔗<class_FontFile_method_clear_cache>`
  439. Removes all font cache entries.
  440. .. rst-class:: classref-item-separator
  441. ----
  442. .. _class_FontFile_method_clear_glyphs:
  443. .. rst-class:: classref-method
  444. |void| **clear_glyphs**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_FontFile_method_clear_glyphs>`
  445. Removes all rendered glyph information from the cache entry.
  446. \ **Note:** This function will not remove textures associated with the glyphs, use :ref:`remove_texture()<class_FontFile_method_remove_texture>` to remove them manually.
  447. .. rst-class:: classref-item-separator
  448. ----
  449. .. _class_FontFile_method_clear_kerning_map:
  450. .. rst-class:: classref-method
  451. |void| **clear_kerning_map**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_clear_kerning_map>`
  452. Removes all kerning overrides.
  453. .. rst-class:: classref-item-separator
  454. ----
  455. .. _class_FontFile_method_clear_size_cache:
  456. .. rst-class:: classref-method
  457. |void| **clear_size_cache**\ (\ cache_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_clear_size_cache>`
  458. Removes all font sizes from the cache entry.
  459. .. rst-class:: classref-item-separator
  460. ----
  461. .. _class_FontFile_method_clear_textures:
  462. .. rst-class:: classref-method
  463. |void| **clear_textures**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_FontFile_method_clear_textures>`
  464. Removes all textures from font cache entry.
  465. \ **Note:** This function will not remove glyphs associated with the texture, use :ref:`remove_glyph()<class_FontFile_method_remove_glyph>` to remove them manually.
  466. .. rst-class:: classref-item-separator
  467. ----
  468. .. _class_FontFile_method_get_cache_ascent:
  469. .. rst-class:: classref-method
  470. :ref:`float<class_float>` **get_cache_ascent**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_cache_ascent>`
  471. Returns the font ascent (number of pixels above the baseline).
  472. .. rst-class:: classref-item-separator
  473. ----
  474. .. _class_FontFile_method_get_cache_count:
  475. .. rst-class:: classref-method
  476. :ref:`int<class_int>` **get_cache_count**\ (\ ) |const| :ref:`🔗<class_FontFile_method_get_cache_count>`
  477. Returns number of the font cache entries.
  478. .. rst-class:: classref-item-separator
  479. ----
  480. .. _class_FontFile_method_get_cache_descent:
  481. .. rst-class:: classref-method
  482. :ref:`float<class_float>` **get_cache_descent**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_cache_descent>`
  483. Returns the font descent (number of pixels below the baseline).
  484. .. rst-class:: classref-item-separator
  485. ----
  486. .. _class_FontFile_method_get_cache_scale:
  487. .. rst-class:: classref-method
  488. :ref:`float<class_float>` **get_cache_scale**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_cache_scale>`
  489. Returns scaling factor of the color bitmap font.
  490. .. rst-class:: classref-item-separator
  491. ----
  492. .. _class_FontFile_method_get_cache_underline_position:
  493. .. rst-class:: classref-method
  494. :ref:`float<class_float>` **get_cache_underline_position**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_cache_underline_position>`
  495. Returns pixel offset of the underline below the baseline.
  496. .. rst-class:: classref-item-separator
  497. ----
  498. .. _class_FontFile_method_get_cache_underline_thickness:
  499. .. rst-class:: classref-method
  500. :ref:`float<class_float>` **get_cache_underline_thickness**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_cache_underline_thickness>`
  501. Returns thickness of the underline in pixels.
  502. .. rst-class:: classref-item-separator
  503. ----
  504. .. _class_FontFile_method_get_char_from_glyph_index:
  505. .. rst-class:: classref-method
  506. :ref:`int<class_int>` **get_char_from_glyph_index**\ (\ size\: :ref:`int<class_int>`, glyph_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_char_from_glyph_index>`
  507. Returns character code associated with ``glyph_index``, or ``0`` if ``glyph_index`` is invalid. See :ref:`get_glyph_index()<class_FontFile_method_get_glyph_index>`.
  508. .. rst-class:: classref-item-separator
  509. ----
  510. .. _class_FontFile_method_get_embolden:
  511. .. rst-class:: classref-method
  512. :ref:`float<class_float>` **get_embolden**\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_embolden>`
  513. Returns embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness.
  514. .. rst-class:: classref-item-separator
  515. ----
  516. .. _class_FontFile_method_get_extra_baseline_offset:
  517. .. rst-class:: classref-method
  518. :ref:`float<class_float>` **get_extra_baseline_offset**\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_extra_baseline_offset>`
  519. Returns extra baseline offset (as a fraction of font height).
  520. .. rst-class:: classref-item-separator
  521. ----
  522. .. _class_FontFile_method_get_extra_spacing:
  523. .. rst-class:: classref-method
  524. :ref:`int<class_int>` **get_extra_spacing**\ (\ cache_index\: :ref:`int<class_int>`, spacing\: :ref:`SpacingType<enum_TextServer_SpacingType>`\ ) |const| :ref:`🔗<class_FontFile_method_get_extra_spacing>`
  525. Returns spacing for ``spacing`` in pixels (not relative to the font size).
  526. .. rst-class:: classref-item-separator
  527. ----
  528. .. _class_FontFile_method_get_face_index:
  529. .. rst-class:: classref-method
  530. :ref:`int<class_int>` **get_face_index**\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_face_index>`
  531. Returns an active face index in the TrueType / OpenType collection.
  532. .. rst-class:: classref-item-separator
  533. ----
  534. .. _class_FontFile_method_get_glyph_advance:
  535. .. rst-class:: classref-method
  536. :ref:`Vector2<class_Vector2>` **get_glyph_advance**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_glyph_advance>`
  537. Returns glyph advance (offset of the next glyph).
  538. \ **Note:** Advance for glyphs outlines is the same as the base glyph advance and is not saved.
  539. .. rst-class:: classref-item-separator
  540. ----
  541. .. _class_FontFile_method_get_glyph_index:
  542. .. rst-class:: classref-method
  543. :ref:`int<class_int>` **get_glyph_index**\ (\ size\: :ref:`int<class_int>`, char\: :ref:`int<class_int>`, variation_selector\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_glyph_index>`
  544. Returns the glyph index of a ``char``, optionally modified by the ``variation_selector``.
  545. .. rst-class:: classref-item-separator
  546. ----
  547. .. _class_FontFile_method_get_glyph_list:
  548. .. rst-class:: classref-method
  549. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_glyph_list**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) |const| :ref:`🔗<class_FontFile_method_get_glyph_list>`
  550. Returns list of rendered glyphs in the cache entry.
  551. .. rst-class:: classref-item-separator
  552. ----
  553. .. _class_FontFile_method_get_glyph_offset:
  554. .. rst-class:: classref-method
  555. :ref:`Vector2<class_Vector2>` **get_glyph_offset**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_glyph_offset>`
  556. Returns glyph offset from the baseline.
  557. .. rst-class:: classref-item-separator
  558. ----
  559. .. _class_FontFile_method_get_glyph_size:
  560. .. rst-class:: classref-method
  561. :ref:`Vector2<class_Vector2>` **get_glyph_size**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_glyph_size>`
  562. Returns glyph size.
  563. .. rst-class:: classref-item-separator
  564. ----
  565. .. _class_FontFile_method_get_glyph_texture_idx:
  566. .. rst-class:: classref-method
  567. :ref:`int<class_int>` **get_glyph_texture_idx**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_glyph_texture_idx>`
  568. Returns index of the cache texture containing the glyph.
  569. .. rst-class:: classref-item-separator
  570. ----
  571. .. _class_FontFile_method_get_glyph_uv_rect:
  572. .. rst-class:: classref-method
  573. :ref:`Rect2<class_Rect2>` **get_glyph_uv_rect**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_glyph_uv_rect>`
  574. Returns rectangle in the cache texture containing the glyph.
  575. .. rst-class:: classref-item-separator
  576. ----
  577. .. _class_FontFile_method_get_kerning:
  578. .. rst-class:: classref-method
  579. :ref:`Vector2<class_Vector2>` **get_kerning**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph_pair\: :ref:`Vector2i<class_Vector2i>`\ ) |const| :ref:`🔗<class_FontFile_method_get_kerning>`
  580. Returns kerning for the pair of glyphs.
  581. .. rst-class:: classref-item-separator
  582. ----
  583. .. _class_FontFile_method_get_kerning_list:
  584. .. rst-class:: classref-method
  585. :ref:`Array<class_Array>`\[:ref:`Vector2i<class_Vector2i>`\] **get_kerning_list**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_kerning_list>`
  586. Returns list of the kerning overrides.
  587. .. rst-class:: classref-item-separator
  588. ----
  589. .. _class_FontFile_method_get_language_support_override:
  590. .. rst-class:: classref-method
  591. :ref:`bool<class_bool>` **get_language_support_override**\ (\ language\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_FontFile_method_get_language_support_override>`
  592. Returns ``true`` if support override is enabled for the ``language``.
  593. .. rst-class:: classref-item-separator
  594. ----
  595. .. _class_FontFile_method_get_language_support_overrides:
  596. .. rst-class:: classref-method
  597. :ref:`PackedStringArray<class_PackedStringArray>` **get_language_support_overrides**\ (\ ) |const| :ref:`🔗<class_FontFile_method_get_language_support_overrides>`
  598. Returns list of language support overrides.
  599. .. rst-class:: classref-item-separator
  600. ----
  601. .. _class_FontFile_method_get_script_support_override:
  602. .. rst-class:: classref-method
  603. :ref:`bool<class_bool>` **get_script_support_override**\ (\ script\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_FontFile_method_get_script_support_override>`
  604. Returns ``true`` if support override is enabled for the ``script``.
  605. .. rst-class:: classref-item-separator
  606. ----
  607. .. _class_FontFile_method_get_script_support_overrides:
  608. .. rst-class:: classref-method
  609. :ref:`PackedStringArray<class_PackedStringArray>` **get_script_support_overrides**\ (\ ) |const| :ref:`🔗<class_FontFile_method_get_script_support_overrides>`
  610. Returns list of script support overrides.
  611. .. rst-class:: classref-item-separator
  612. ----
  613. .. _class_FontFile_method_get_size_cache_list:
  614. .. rst-class:: classref-method
  615. :ref:`Array<class_Array>`\[:ref:`Vector2i<class_Vector2i>`\] **get_size_cache_list**\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_size_cache_list>`
  616. Returns list of the font sizes in the cache. Each size is :ref:`Vector2i<class_Vector2i>` with font size and outline size.
  617. .. rst-class:: classref-item-separator
  618. ----
  619. .. _class_FontFile_method_get_texture_count:
  620. .. rst-class:: classref-method
  621. :ref:`int<class_int>` **get_texture_count**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) |const| :ref:`🔗<class_FontFile_method_get_texture_count>`
  622. Returns number of textures used by font cache entry.
  623. .. rst-class:: classref-item-separator
  624. ----
  625. .. _class_FontFile_method_get_texture_image:
  626. .. rst-class:: classref-method
  627. :ref:`Image<class_Image>` **get_texture_image**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_texture_image>`
  628. Returns a copy of the font cache texture image.
  629. .. rst-class:: classref-item-separator
  630. ----
  631. .. _class_FontFile_method_get_texture_offsets:
  632. .. rst-class:: classref-method
  633. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_texture_offsets**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_texture_offsets>`
  634. Returns a copy of the array containing glyph packing data.
  635. .. rst-class:: classref-item-separator
  636. ----
  637. .. _class_FontFile_method_get_transform:
  638. .. rst-class:: classref-method
  639. :ref:`Transform2D<class_Transform2D>` **get_transform**\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_transform>`
  640. Returns 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs.
  641. .. rst-class:: classref-item-separator
  642. ----
  643. .. _class_FontFile_method_get_variation_coordinates:
  644. .. rst-class:: classref-method
  645. :ref:`Dictionary<class_Dictionary>` **get_variation_coordinates**\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_variation_coordinates>`
  646. 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.
  647. .. rst-class:: classref-item-separator
  648. ----
  649. .. _class_FontFile_method_load_bitmap_font:
  650. .. rst-class:: classref-method
  651. :ref:`Error<enum_@GlobalScope_Error>` **load_bitmap_font**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_FontFile_method_load_bitmap_font>`
  652. Loads an AngelCode BMFont (.fnt, .font) bitmap font from file ``path``.
  653. \ **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.
  654. .. rst-class:: classref-item-separator
  655. ----
  656. .. _class_FontFile_method_load_dynamic_font:
  657. .. rst-class:: classref-method
  658. :ref:`Error<enum_@GlobalScope_Error>` **load_dynamic_font**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_FontFile_method_load_dynamic_font>`
  659. Loads a TrueType (.ttf), OpenType (.otf), WOFF (.woff), WOFF2 (.woff2) or Type 1 (.pfb, .pfm) dynamic font from file ``path``.
  660. \ **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.
  661. .. rst-class:: classref-item-separator
  662. ----
  663. .. _class_FontFile_method_remove_cache:
  664. .. rst-class:: classref-method
  665. |void| **remove_cache**\ (\ cache_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_remove_cache>`
  666. Removes specified font cache entry.
  667. .. rst-class:: classref-item-separator
  668. ----
  669. .. _class_FontFile_method_remove_glyph:
  670. .. rst-class:: classref-method
  671. |void| **remove_glyph**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_remove_glyph>`
  672. Removes specified rendered glyph information from the cache entry.
  673. \ **Note:** This function will not remove textures associated with the glyphs, use :ref:`remove_texture()<class_FontFile_method_remove_texture>` to remove them manually.
  674. .. rst-class:: classref-item-separator
  675. ----
  676. .. _class_FontFile_method_remove_kerning:
  677. .. rst-class:: classref-method
  678. |void| **remove_kerning**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph_pair\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_FontFile_method_remove_kerning>`
  679. Removes kerning override for the pair of glyphs.
  680. .. rst-class:: classref-item-separator
  681. ----
  682. .. _class_FontFile_method_remove_language_support_override:
  683. .. rst-class:: classref-method
  684. |void| **remove_language_support_override**\ (\ language\: :ref:`String<class_String>`\ ) :ref:`🔗<class_FontFile_method_remove_language_support_override>`
  685. Remove language support override.
  686. .. rst-class:: classref-item-separator
  687. ----
  688. .. _class_FontFile_method_remove_script_support_override:
  689. .. rst-class:: classref-method
  690. |void| **remove_script_support_override**\ (\ script\: :ref:`String<class_String>`\ ) :ref:`🔗<class_FontFile_method_remove_script_support_override>`
  691. Removes script support override.
  692. .. rst-class:: classref-item-separator
  693. ----
  694. .. _class_FontFile_method_remove_size_cache:
  695. .. rst-class:: classref-method
  696. |void| **remove_size_cache**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_FontFile_method_remove_size_cache>`
  697. Removes specified font size from the cache entry.
  698. .. rst-class:: classref-item-separator
  699. ----
  700. .. _class_FontFile_method_remove_texture:
  701. .. rst-class:: classref-method
  702. |void| **remove_texture**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_remove_texture>`
  703. Removes specified texture from the cache entry.
  704. \ **Note:** This function will not remove glyphs associated with the texture. Remove them manually using :ref:`remove_glyph()<class_FontFile_method_remove_glyph>`.
  705. .. rst-class:: classref-item-separator
  706. ----
  707. .. _class_FontFile_method_render_glyph:
  708. .. rst-class:: classref-method
  709. |void| **render_glyph**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_render_glyph>`
  710. Renders specified glyph to the font cache texture.
  711. .. rst-class:: classref-item-separator
  712. ----
  713. .. _class_FontFile_method_render_range:
  714. .. rst-class:: classref-method
  715. |void| **render_range**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, start\: :ref:`int<class_int>`, end\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_render_range>`
  716. Renders the range of characters to the font cache texture.
  717. .. rst-class:: classref-item-separator
  718. ----
  719. .. _class_FontFile_method_set_cache_ascent:
  720. .. rst-class:: classref-method
  721. |void| **set_cache_ascent**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, ascent\: :ref:`float<class_float>`\ ) :ref:`🔗<class_FontFile_method_set_cache_ascent>`
  722. Sets the font ascent (number of pixels above the baseline).
  723. .. rst-class:: classref-item-separator
  724. ----
  725. .. _class_FontFile_method_set_cache_descent:
  726. .. rst-class:: classref-method
  727. |void| **set_cache_descent**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, descent\: :ref:`float<class_float>`\ ) :ref:`🔗<class_FontFile_method_set_cache_descent>`
  728. Sets the font descent (number of pixels below the baseline).
  729. .. rst-class:: classref-item-separator
  730. ----
  731. .. _class_FontFile_method_set_cache_scale:
  732. .. rst-class:: classref-method
  733. |void| **set_cache_scale**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, scale\: :ref:`float<class_float>`\ ) :ref:`🔗<class_FontFile_method_set_cache_scale>`
  734. Sets scaling factor of the color bitmap font.
  735. .. rst-class:: classref-item-separator
  736. ----
  737. .. _class_FontFile_method_set_cache_underline_position:
  738. .. rst-class:: classref-method
  739. |void| **set_cache_underline_position**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, underline_position\: :ref:`float<class_float>`\ ) :ref:`🔗<class_FontFile_method_set_cache_underline_position>`
  740. Sets pixel offset of the underline below the baseline.
  741. .. rst-class:: classref-item-separator
  742. ----
  743. .. _class_FontFile_method_set_cache_underline_thickness:
  744. .. rst-class:: classref-method
  745. |void| **set_cache_underline_thickness**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, underline_thickness\: :ref:`float<class_float>`\ ) :ref:`🔗<class_FontFile_method_set_cache_underline_thickness>`
  746. Sets thickness of the underline in pixels.
  747. .. rst-class:: classref-item-separator
  748. ----
  749. .. _class_FontFile_method_set_embolden:
  750. .. rst-class:: classref-method
  751. |void| **set_embolden**\ (\ cache_index\: :ref:`int<class_int>`, strength\: :ref:`float<class_float>`\ ) :ref:`🔗<class_FontFile_method_set_embolden>`
  752. Sets embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness.
  753. .. rst-class:: classref-item-separator
  754. ----
  755. .. _class_FontFile_method_set_extra_baseline_offset:
  756. .. rst-class:: classref-method
  757. |void| **set_extra_baseline_offset**\ (\ cache_index\: :ref:`int<class_int>`, baseline_offset\: :ref:`float<class_float>`\ ) :ref:`🔗<class_FontFile_method_set_extra_baseline_offset>`
  758. Sets extra baseline offset (as a fraction of font height).
  759. .. rst-class:: classref-item-separator
  760. ----
  761. .. _class_FontFile_method_set_extra_spacing:
  762. .. rst-class:: classref-method
  763. |void| **set_extra_spacing**\ (\ cache_index\: :ref:`int<class_int>`, spacing\: :ref:`SpacingType<enum_TextServer_SpacingType>`, value\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_set_extra_spacing>`
  764. Sets the spacing for ``spacing`` to ``value`` in pixels (not relative to the font size).
  765. .. rst-class:: classref-item-separator
  766. ----
  767. .. _class_FontFile_method_set_face_index:
  768. .. rst-class:: classref-method
  769. |void| **set_face_index**\ (\ cache_index\: :ref:`int<class_int>`, face_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_set_face_index>`
  770. Sets an active face index in the TrueType / OpenType collection.
  771. .. rst-class:: classref-item-separator
  772. ----
  773. .. _class_FontFile_method_set_glyph_advance:
  774. .. rst-class:: classref-method
  775. |void| **set_glyph_advance**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph\: :ref:`int<class_int>`, advance\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_FontFile_method_set_glyph_advance>`
  776. Sets glyph advance (offset of the next glyph).
  777. \ **Note:** Advance for glyphs outlines is the same as the base glyph advance and is not saved.
  778. .. rst-class:: classref-item-separator
  779. ----
  780. .. _class_FontFile_method_set_glyph_offset:
  781. .. rst-class:: classref-method
  782. |void| **set_glyph_offset**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`, offset\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_FontFile_method_set_glyph_offset>`
  783. Sets glyph offset from the baseline.
  784. .. rst-class:: classref-item-separator
  785. ----
  786. .. _class_FontFile_method_set_glyph_size:
  787. .. rst-class:: classref-method
  788. |void| **set_glyph_size**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`, gl_size\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_FontFile_method_set_glyph_size>`
  789. Sets glyph size.
  790. .. rst-class:: classref-item-separator
  791. ----
  792. .. _class_FontFile_method_set_glyph_texture_idx:
  793. .. rst-class:: classref-method
  794. |void| **set_glyph_texture_idx**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`, texture_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_set_glyph_texture_idx>`
  795. Sets index of the cache texture containing the glyph.
  796. .. rst-class:: classref-item-separator
  797. ----
  798. .. _class_FontFile_method_set_glyph_uv_rect:
  799. .. rst-class:: classref-method
  800. |void| **set_glyph_uv_rect**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`, uv_rect\: :ref:`Rect2<class_Rect2>`\ ) :ref:`🔗<class_FontFile_method_set_glyph_uv_rect>`
  801. Sets rectangle in the cache texture containing the glyph.
  802. .. rst-class:: classref-item-separator
  803. ----
  804. .. _class_FontFile_method_set_kerning:
  805. .. rst-class:: classref-method
  806. |void| **set_kerning**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph_pair\: :ref:`Vector2i<class_Vector2i>`, kerning\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_FontFile_method_set_kerning>`
  807. Sets kerning for the pair of glyphs.
  808. .. rst-class:: classref-item-separator
  809. ----
  810. .. _class_FontFile_method_set_language_support_override:
  811. .. rst-class:: classref-method
  812. |void| **set_language_support_override**\ (\ language\: :ref:`String<class_String>`, supported\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_FontFile_method_set_language_support_override>`
  813. Adds override for :ref:`Font.is_language_supported()<class_Font_method_is_language_supported>`.
  814. .. rst-class:: classref-item-separator
  815. ----
  816. .. _class_FontFile_method_set_script_support_override:
  817. .. rst-class:: classref-method
  818. |void| **set_script_support_override**\ (\ script\: :ref:`String<class_String>`, supported\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_FontFile_method_set_script_support_override>`
  819. Adds override for :ref:`Font.is_script_supported()<class_Font_method_is_script_supported>`.
  820. .. rst-class:: classref-item-separator
  821. ----
  822. .. _class_FontFile_method_set_texture_image:
  823. .. rst-class:: classref-method
  824. |void| **set_texture_image**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`, image\: :ref:`Image<class_Image>`\ ) :ref:`🔗<class_FontFile_method_set_texture_image>`
  825. Sets font cache texture image.
  826. .. rst-class:: classref-item-separator
  827. ----
  828. .. _class_FontFile_method_set_texture_offsets:
  829. .. rst-class:: classref-method
  830. |void| **set_texture_offsets**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`, offset\: :ref:`PackedInt32Array<class_PackedInt32Array>`\ ) :ref:`🔗<class_FontFile_method_set_texture_offsets>`
  831. Sets array containing glyph packing data.
  832. .. rst-class:: classref-item-separator
  833. ----
  834. .. _class_FontFile_method_set_transform:
  835. .. rst-class:: classref-method
  836. |void| **set_transform**\ (\ cache_index\: :ref:`int<class_int>`, transform\: :ref:`Transform2D<class_Transform2D>`\ ) :ref:`🔗<class_FontFile_method_set_transform>`
  837. Sets 2D transform, applied to the font outlines, can be used for slanting, flipping, and rotating glyphs.
  838. .. rst-class:: classref-item-separator
  839. ----
  840. .. _class_FontFile_method_set_variation_coordinates:
  841. .. rst-class:: classref-method
  842. |void| **set_variation_coordinates**\ (\ cache_index\: :ref:`int<class_int>`, variation_coordinates\: :ref:`Dictionary<class_Dictionary>`\ ) :ref:`🔗<class_FontFile_method_set_variation_coordinates>`
  843. 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.
  844. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  845. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  846. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  847. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  848. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  849. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  850. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  851. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  852. .. |void| replace:: :abbr:`void (No return value.)`