mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
222 lines
11 KiB
ReStructuredText
222 lines
11 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. DO NOT EDIT THIS FILE!!!
|
|
.. Generated automatically from Godot engine sources.
|
|
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
|
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/SystemFont.xml.
|
|
|
|
.. _class_SystemFont:
|
|
|
|
SystemFont
|
|
==========
|
|
|
|
**Inherits:** :ref:`Font<class_Font>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
|
|
|
Font loaded from a system font.
|
|
|
|
\ **Note:** This class is implemented on iOS, Linux, macOS and Windows, on other platforms it will fallback to default theme font.
|
|
|
|
Description
|
|
-----------
|
|
|
|
``SystemFont`` loads a font from a system font with the first matching name from :ref:`font_names<class_SystemFont_property_font_names>`.
|
|
|
|
It will attempt to match font style, but it's not guaranteed.
|
|
|
|
The returned font might be part of a font collection or be a variable font with OpenType "weight" and/or "italic" features set.
|
|
|
|
You can create :ref:`FontVariation<class_FontVariation>` of the system font for fine control over its features.
|
|
|
|
Properties
|
|
----------
|
|
|
|
+-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`FontAntialiasing<enum_TextServer_FontAntialiasing>` | :ref:`antialiasing<class_SystemFont_property_antialiasing>` | ``1`` |
|
|
+-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`Font[]<class_Font>` | :ref:`fallbacks<class_SystemFont_property_fallbacks>` | ``[]`` |
|
|
+-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`font_names<class_SystemFont_property_font_names>` | ``PackedStringArray()`` |
|
|
+-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`FontStyle<enum_TextServer_FontStyle>` | :ref:`font_style<class_SystemFont_property_font_style>` | ``0`` |
|
|
+-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`force_autohinter<class_SystemFont_property_force_autohinter>` | ``false`` |
|
|
+-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`generate_mipmaps<class_SystemFont_property_generate_mipmaps>` | ``false`` |
|
|
+-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`Hinting<enum_TextServer_Hinting>` | :ref:`hinting<class_SystemFont_property_hinting>` | ``1`` |
|
|
+-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`multichannel_signed_distance_field<class_SystemFont_property_multichannel_signed_distance_field>` | ``false`` |
|
|
+-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`float<class_float>` | :ref:`oversampling<class_SystemFont_property_oversampling>` | ``0.0`` |
|
|
+-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>` | :ref:`subpixel_positioning<class_SystemFont_property_subpixel_positioning>` | ``1`` |
|
|
+-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------+
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_SystemFont_property_antialiasing:
|
|
|
|
- :ref:`FontAntialiasing<enum_TextServer_FontAntialiasing>` **antialiasing**
|
|
|
|
+-----------+-------------------------+
|
|
| *Default* | ``1`` |
|
|
+-----------+-------------------------+
|
|
| *Setter* | set_antialiasing(value) |
|
|
+-----------+-------------------------+
|
|
| *Getter* | get_antialiasing() |
|
|
+-----------+-------------------------+
|
|
|
|
Font anti-aliasing mode.
|
|
|
|
----
|
|
|
|
.. _class_SystemFont_property_fallbacks:
|
|
|
|
- :ref:`Font[]<class_Font>` **fallbacks**
|
|
|
|
+-----------+----------------------+
|
|
| *Default* | ``[]`` |
|
|
+-----------+----------------------+
|
|
| *Setter* | set_fallbacks(value) |
|
|
+-----------+----------------------+
|
|
| *Getter* | get_fallbacks() |
|
|
+-----------+----------------------+
|
|
|
|
Array of fallback :ref:`Font<class_Font>`\ s.
|
|
|
|
----
|
|
|
|
.. _class_SystemFont_property_font_names:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **font_names**
|
|
|
|
+-----------+-------------------------+
|
|
| *Default* | ``PackedStringArray()`` |
|
|
+-----------+-------------------------+
|
|
| *Setter* | set_font_names(value) |
|
|
+-----------+-------------------------+
|
|
| *Getter* | get_font_names() |
|
|
+-----------+-------------------------+
|
|
|
|
Array of font family names to search, first matching font found is used.
|
|
|
|
----
|
|
|
|
.. _class_SystemFont_property_font_style:
|
|
|
|
- :ref:`FontStyle<enum_TextServer_FontStyle>` **font_style**
|
|
|
|
+-----------+-----------------------+
|
|
| *Default* | ``0`` |
|
|
+-----------+-----------------------+
|
|
| *Setter* | set_font_style(value) |
|
|
+-----------+-----------------------+
|
|
| *Getter* | get_font_style() |
|
|
+-----------+-----------------------+
|
|
|
|
Font style flags, see :ref:`FontStyle<enum_TextServer_FontStyle>`.
|
|
|
|
----
|
|
|
|
.. _class_SystemFont_property_force_autohinter:
|
|
|
|
- :ref:`bool<class_bool>` **force_autohinter**
|
|
|
|
+-----------+-----------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+-----------------------------+
|
|
| *Setter* | set_force_autohinter(value) |
|
|
+-----------+-----------------------------+
|
|
| *Getter* | is_force_autohinter() |
|
|
+-----------+-----------------------------+
|
|
|
|
If set to ``true``, auto-hinting is supported and preferred over font built-in hinting.
|
|
|
|
----
|
|
|
|
.. _class_SystemFont_property_generate_mipmaps:
|
|
|
|
- :ref:`bool<class_bool>` **generate_mipmaps**
|
|
|
|
+-----------+-----------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+-----------------------------+
|
|
| *Setter* | set_generate_mipmaps(value) |
|
|
+-----------+-----------------------------+
|
|
| *Getter* | get_generate_mipmaps() |
|
|
+-----------+-----------------------------+
|
|
|
|
If set to ``true``, generate mipmaps for the font textures.
|
|
|
|
----
|
|
|
|
.. _class_SystemFont_property_hinting:
|
|
|
|
- :ref:`Hinting<enum_TextServer_Hinting>` **hinting**
|
|
|
|
+-----------+--------------------+
|
|
| *Default* | ``1`` |
|
|
+-----------+--------------------+
|
|
| *Setter* | set_hinting(value) |
|
|
+-----------+--------------------+
|
|
| *Getter* | get_hinting() |
|
|
+-----------+--------------------+
|
|
|
|
Font hinting mode.
|
|
|
|
----
|
|
|
|
.. _class_SystemFont_property_multichannel_signed_distance_field:
|
|
|
|
- :ref:`bool<class_bool>` **multichannel_signed_distance_field**
|
|
|
|
+-----------+-----------------------------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+-----------------------------------------------+
|
|
| *Setter* | set_multichannel_signed_distance_field(value) |
|
|
+-----------+-----------------------------------------------+
|
|
| *Getter* | is_multichannel_signed_distance_field() |
|
|
+-----------+-----------------------------------------------+
|
|
|
|
If set to ``true``, glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
|
|
|
|
----
|
|
|
|
.. _class_SystemFont_property_oversampling:
|
|
|
|
- :ref:`float<class_float>` **oversampling**
|
|
|
|
+-----------+-------------------------+
|
|
| *Default* | ``0.0`` |
|
|
+-----------+-------------------------+
|
|
| *Setter* | set_oversampling(value) |
|
|
+-----------+-------------------------+
|
|
| *Getter* | get_oversampling() |
|
|
+-----------+-------------------------+
|
|
|
|
Font oversampling factor, if set to ``0.0`` global oversampling factor is used instead.
|
|
|
|
----
|
|
|
|
.. _class_SystemFont_property_subpixel_positioning:
|
|
|
|
- :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>` **subpixel_positioning**
|
|
|
|
+-----------+---------------------------------+
|
|
| *Default* | ``1`` |
|
|
+-----------+---------------------------------+
|
|
| *Setter* | set_subpixel_positioning(value) |
|
|
+-----------+---------------------------------+
|
|
| *Getter* | get_subpixel_positioning() |
|
|
+-----------+---------------------------------+
|
|
|
|
Font glyph subpixel positioning mode. Subpixel positioning provides shaper text and better kerning for smaller font sizes, at the cost of memory usage and font rasterization speed. Use :ref:`TextServer.SUBPIXEL_POSITIONING_AUTO<class_TextServer_constant_SUBPIXEL_POSITIONING_AUTO>` to automatically enable it based on the font size.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|
|
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
|
|
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
|
|
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
|