Class SystemFont
- Namespace
- Godot
- Assembly
- GodotSharp.dll
SystemFont loads a font from a system font with the first matching name from FontNames.
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.
public class SystemFont : Font, IDisposable
- Inheritance
-
SystemFont
- Implements
- Inherited Members
Constructors
SystemFont()
public SystemFont()
Properties
AllowSystemFallback
If set to true
, system fonts can be automatically used as fallbacks.
public bool AllowSystemFallback { get; set; }
Property Value
Antialiasing
Font anti-aliasing mode.
public TextServer.FontAntialiasing Antialiasing { get; set; }
Property Value
FontItalic
If set to true
, italic or oblique font is preferred.
public bool FontItalic { get; set; }
Property Value
FontNames
Array of font family names to search, first matching font found is used.
public string[] FontNames { get; set; }
Property Value
- string[]
FontStretch
Preferred font stretch amount, compared to a normal width. A percentage value between 50%
and 200%
.
public int FontStretch { get; set; }
Property Value
FontWeight
Preferred weight (boldness) of the font. A value in the 100...999
range, normal font weight is 400
, bold font weight is 700
.
public int FontWeight { get; set; }
Property Value
ForceAutohinter
If set to true
, auto-hinting is supported and preferred over font built-in hinting.
public bool ForceAutohinter { get; set; }
Property Value
GenerateMipmaps
If set to true
, generate mipmaps for the font textures.
public bool GenerateMipmaps { get; set; }
Property Value
Hinting
Font hinting mode.
public TextServer.Hinting Hinting { get; set; }
Property Value
MsdfPixelRange
The width of the range around the shape between the minimum and maximum representable signed distance. If using font outlines, MsdfPixelRange must be set to at least twice the size of the largest font outline. The default MsdfPixelRange value of 16
allows outline sizes up to 8
to look correct.
public int MsdfPixelRange { get; set; }
Property Value
MsdfSize
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.
public int MsdfSize { get; set; }
Property Value
MultichannelSignedDistanceField
If set to true
, glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
public bool MultichannelSignedDistanceField { get; set; }
Property Value
Oversampling
Font oversampling factor, if set to 0.0
global oversampling factor is used instead.
public float Oversampling { get; set; }
Property Value
SubpixelPositioning
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 Auto to automatically enable it based on the font size.
public TextServer.SubpixelPositioning SubpixelPositioning { get; set; }
Property Value
Methods
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.