Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
SystemFont
繼承: Font < Resource < RefCounted < Object
從系統字形載入的字形。如果未在宿主作業系統上實作,則退回到預設主題字形。
說明
SystemFont loads a font from a system font with the first matching name from 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", "width" and/or "italic" features set.
You can create FontVariation of the system font for precise control over its features.
Note: This class is implemented on iOS, Linux, macOS and Windows, on other platforms it will fallback to default theme font.
屬性
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
屬性說明
bool allow_system_fallback = true 🔗
如果設定為 true,則可以自動將系統字形作為退回使用。
FontAntialiasing antialiasing = 1 🔗
void set_antialiasing(value: FontAntialiasing)
FontAntialiasing get_antialiasing()
字形抗鋸齒模式。
bool disable_embedded_bitmaps = true 🔗
If set to true, embedded font bitmap loading is disabled (bitmap-only and color fonts ignore this property).
如果設定為 true,則優先使用斜體(italic)或偽斜體(oblique)。
PackedStringArray font_names = PackedStringArray() 🔗
void set_font_names(value: PackedStringArray)
PackedStringArray get_font_names()
要搜索的字形家族名稱陣列,會使用第一個與之配對的字形。
Note: The returned array is copied and any changes to it will not update the original property value. See PackedStringArray for more details.
字形優先使用的拉伸量,相對於正常寬度。介於 50% 和 200% 之間的百分比。
字形優先使用的字重(粗度)。在 100...999 範圍內的值,正常字重為 400,粗體字重為 700。
bool force_autohinter = false 🔗
如果設定為 true,則支援自動微調,優先於字形內建微調。
bool generate_mipmaps = false 🔗
如果設定為 true,則為字形紋理生成 mipmap。
字形微調模式。
bool keep_rounding_remainders = true 🔗
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.
bool modulate_color_glyphs = false 🔗
If set to true, color modulation is applied when drawing colored glyphs, otherwise it's applied to the monochrome glyphs only.
最小和最大可表示的有符號距離之間的形狀周圍的範圍寬度。如果使用字形輪廓,msdf_pixel_range 必須至少設定為最大字形輪廓大小的兩倍。msdf_pixel_range 的預設值為 16,允許大小最大到 8 的輪廓看起來正確。
用於生成 MSDF 紋理的源字形大小。較高的值允許更高的精度,但算繪速度較慢並且需要更多記憶體。只有當注意到字形算繪中明顯缺乏精度時,才增加該屬性的值。
bool multichannel_signed_distance_field = false 🔗
void set_multichannel_signed_distance_field(value: bool)
bool is_multichannel_signed_distance_field()
如果設定為 true,則所有大小的字形都將使用從動態字形向量資料生成的單個多通道帶符號距離場算繪。
If set to a positive value, overrides the oversampling factor of the viewport this font is used in. See Viewport.oversampling. This value doesn't override the oversampling parameter of draw_* methods.
SubpixelPositioning subpixel_positioning = 1 🔗
void set_subpixel_positioning(value: SubpixelPositioning)
SubpixelPositioning get_subpixel_positioning()
字形字形的次圖元定位模式。次圖元定位為較小的字形提供了更清晰的文字和更好的字偶距,但會犧牲記憶體佔用和字形柵格化速度。使用 TextServer.SUBPIXEL_POSITIONING_AUTO 可以根據字形大小自動啟用。