class_systemfont.rst 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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/SystemFont.xml.
  6. .. _class_SystemFont:
  7. SystemFont
  8. ==========
  9. **Inherits:** :ref:`Font<class_Font>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Font loaded from a system font.
  11. \ **Note:** This class is implemented on iOS, Linux, macOS and Windows, on other platforms it will fallback to default theme font.
  12. Description
  13. -----------
  14. ``SystemFont`` loads a font from a system font with the first matching name from :ref:`font_names<class_SystemFont_property_font_names>`.
  15. It will attempt to match font style, but it's not guaranteed.
  16. The returned font might be part of a font collection or be a variable font with OpenType "weight" and/or "italic" features set.
  17. You can create :ref:`FontVariation<class_FontVariation>` of the system font for fine control over its features.
  18. Properties
  19. ----------
  20. +-----------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`antialiased<class_SystemFont_property_antialiased>` | ``true`` |
  22. +-----------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------+
  23. | :ref:`Font[]<class_Font>` | :ref:`fallbacks<class_SystemFont_property_fallbacks>` | ``[]`` |
  24. +-----------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------+
  25. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`font_names<class_SystemFont_property_font_names>` | ``PackedStringArray()`` |
  26. +-----------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------+
  27. | :ref:`FontStyle<enum_TextServer_FontStyle>` | :ref:`font_style<class_SystemFont_property_font_style>` | ``0`` |
  28. +-----------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`force_autohinter<class_SystemFont_property_force_autohinter>` | ``false`` |
  30. +-----------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`generate_mipmaps<class_SystemFont_property_generate_mipmaps>` | ``false`` |
  32. +-----------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------+
  33. | :ref:`Hinting<enum_TextServer_Hinting>` | :ref:`hinting<class_SystemFont_property_hinting>` | ``1`` |
  34. +-----------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------+
  35. | :ref:`float<class_float>` | :ref:`oversampling<class_SystemFont_property_oversampling>` | ``0.0`` |
  36. +-----------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------+
  37. | :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>` | :ref:`subpixel_positioning<class_SystemFont_property_subpixel_positioning>` | ``1`` |
  38. +-----------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------+
  39. Property Descriptions
  40. ---------------------
  41. .. _class_SystemFont_property_antialiased:
  42. - :ref:`bool<class_bool>` **antialiased**
  43. +-----------+------------------------+
  44. | *Default* | ``true`` |
  45. +-----------+------------------------+
  46. | *Setter* | set_antialiased(value) |
  47. +-----------+------------------------+
  48. | *Getter* | is_antialiased() |
  49. +-----------+------------------------+
  50. If set to ``true``, font 8-bit anitialiased glyph rendering is supported and enabled.
  51. ----
  52. .. _class_SystemFont_property_fallbacks:
  53. - :ref:`Font[]<class_Font>` **fallbacks**
  54. +-----------+----------------------+
  55. | *Default* | ``[]`` |
  56. +-----------+----------------------+
  57. | *Setter* | set_fallbacks(value) |
  58. +-----------+----------------------+
  59. | *Getter* | get_fallbacks() |
  60. +-----------+----------------------+
  61. Array of fallback :ref:`Font<class_Font>`\ s.
  62. ----
  63. .. _class_SystemFont_property_font_names:
  64. - :ref:`PackedStringArray<class_PackedStringArray>` **font_names**
  65. +-----------+-------------------------+
  66. | *Default* | ``PackedStringArray()`` |
  67. +-----------+-------------------------+
  68. | *Setter* | set_font_names(value) |
  69. +-----------+-------------------------+
  70. | *Getter* | get_font_names() |
  71. +-----------+-------------------------+
  72. Array of font family names to search, first matching font found is used.
  73. ----
  74. .. _class_SystemFont_property_font_style:
  75. - :ref:`FontStyle<enum_TextServer_FontStyle>` **font_style**
  76. +-----------+-----------------------+
  77. | *Default* | ``0`` |
  78. +-----------+-----------------------+
  79. | *Setter* | set_font_style(value) |
  80. +-----------+-----------------------+
  81. | *Getter* | get_font_style() |
  82. +-----------+-----------------------+
  83. Font style flags, see :ref:`FontStyle<enum_TextServer_FontStyle>`.
  84. ----
  85. .. _class_SystemFont_property_force_autohinter:
  86. - :ref:`bool<class_bool>` **force_autohinter**
  87. +-----------+-----------------------------+
  88. | *Default* | ``false`` |
  89. +-----------+-----------------------------+
  90. | *Setter* | set_force_autohinter(value) |
  91. +-----------+-----------------------------+
  92. | *Getter* | is_force_autohinter() |
  93. +-----------+-----------------------------+
  94. If set to ``true``, auto-hinting is supported and preferred over font built-in hinting.
  95. ----
  96. .. _class_SystemFont_property_generate_mipmaps:
  97. - :ref:`bool<class_bool>` **generate_mipmaps**
  98. +-----------+-----------------------------+
  99. | *Default* | ``false`` |
  100. +-----------+-----------------------------+
  101. | *Setter* | set_generate_mipmaps(value) |
  102. +-----------+-----------------------------+
  103. | *Getter* | get_generate_mipmaps() |
  104. +-----------+-----------------------------+
  105. If set to ``true``, generate mipmaps for the font textures.
  106. ----
  107. .. _class_SystemFont_property_hinting:
  108. - :ref:`Hinting<enum_TextServer_Hinting>` **hinting**
  109. +-----------+--------------------+
  110. | *Default* | ``1`` |
  111. +-----------+--------------------+
  112. | *Setter* | set_hinting(value) |
  113. +-----------+--------------------+
  114. | *Getter* | get_hinting() |
  115. +-----------+--------------------+
  116. Font hinting mode.
  117. ----
  118. .. _class_SystemFont_property_oversampling:
  119. - :ref:`float<class_float>` **oversampling**
  120. +-----------+-------------------------+
  121. | *Default* | ``0.0`` |
  122. +-----------+-------------------------+
  123. | *Setter* | set_oversampling(value) |
  124. +-----------+-------------------------+
  125. | *Getter* | get_oversampling() |
  126. +-----------+-------------------------+
  127. Font oversampling factor, if set to ``0.0`` global oversampling factor is used instead.
  128. ----
  129. .. _class_SystemFont_property_subpixel_positioning:
  130. - :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>` **subpixel_positioning**
  131. +-----------+---------------------------------+
  132. | *Default* | ``1`` |
  133. +-----------+---------------------------------+
  134. | *Setter* | set_subpixel_positioning(value) |
  135. +-----------+---------------------------------+
  136. | *Getter* | get_subpixel_positioning() |
  137. +-----------+---------------------------------+
  138. Font glyph sub-pixel positioning mode. Subpixel positioning provides shaper text and better kerning for smaller font sizes, at the cost of memory usage and font rasterization speed. Use :ref:`TextServer.SUBPIXEL_POSITIONING_AUTO<class_TextServer_constant_SUBPIXEL_POSITIONING_AUTO>` to automatically enable it based on the font size.
  139. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  140. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  141. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  142. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  143. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  144. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`