TextServer
A server interface for font management and text rendering.
A server interface for font management and text rendering.
TextServer is the API backend for managing fonts and rendering text.
Note: This is a low-level API, consider using TextLine, TextParagraph, and Font classes instead.
This is an abstract class, so to get the currently active TextServer instance, use the following code:
var ts = TextServerManager.GetPrimaryInterface();Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Methods256
CreateFontRid
public Rid CreateFont();Creates a new, empty font cache entry resource. To free the resulting resource, use the TextServer.FreeRid method.
RidCreateFontLinkedVariationRid
public Rid CreateFontLinkedVariation(Rid fontRid);Creates a new variation existing font which is reusing the same glyph cache and font data. To free the resulting resource, use the TextServer.FreeRid method.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
RidCreateShapedTextRid
public Rid CreateShapedText(TextServer.Direction direction = TextServer.Direction.Auto, TextServer.Orientation orientation = TextServer.Orientation.Horizontal);Creates a new buffer for complex text layout, with the given direction and orientation. To free the resulting buffer, use TextServer.FreeRid method.
Note: Direction is ignored if server does not support TextServer.Feature.BidiLayout feature (supported by TextServerAdvanced).
Note: Orientation is ignored if server does not support TextServer.Feature.VerticalLayout feature (supported by TextServerAdvanced).
| Name | Type | Default |
|---|---|---|
direction | TextServer.Direction | TextServer.Direction.Auto |
orientation | TextServer.Orientation | TextServer.Orientation.Horizontal |
RidDrawHexCodeBoxvoid
public void DrawHexCodeBox(Rid canvas, long size, Vector2 pos, long index, Color color);Draws box displaying character hexadecimal code. Used for replacing missing characters.
| Name | Type | Default |
|---|---|---|
canvas | Rid | — |
size | long | — |
pos | Vector2 | — |
index | long | — |
color | Color | — |
FontClearGlyphsvoid
public void FontClearGlyphs(Rid fontRid, Vector2I size);Removes all rendered glyph information from the cache entry.
Note: This function will not remove textures associated with the glyphs, use TextServer.FontRemoveTexture to remove them manually.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
FontClearKerningMapvoid
public void FontClearKerningMap(Rid fontRid, long size);Removes all kerning overrides.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
FontClearSizeCachevoid
public void FontClearSizeCache(Rid fontRid);Removes all font sizes from the cache entry.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
FontClearSystemFallbackCachevoid
public void FontClearSystemFallbackCache();Frees all automatically loaded system fonts.
FontClearTexturesvoid
public void FontClearTextures(Rid fontRid, Vector2I size);Removes all textures from font cache entry.
Note: This function will not remove glyphs associated with the texture, use TextServer.FontRemoveGlyph to remove them manually.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
FontDrawGlyph2 overloads
public void FontDrawGlyph(Rid fontRid, Rid canvas, long size, Vector2 pos, long index, Color? color);Draws single glyph into a canvas item at the position, using font_rid at the size size. If oversampling is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
Note: Glyph index is specific to the font, use glyphs indices returned by TextServer.ShapedTextGetGlyphs or TextServer.FontGetGlyphIndex.
Note: If there are pending glyphs to render, calling this function might trigger the texture cache update.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
canvas | Rid | — |
size | long | — |
pos | Vector2 | — |
index | long | — |
color | Color? | — |
colorIf the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).
public void FontDrawGlyph(Rid fontRid, Rid canvas, long size, Vector2 pos, long index, Color? color = default, float oversampling = 0f);Draws single glyph into a canvas item at the position, using font_rid at the size size. If oversampling is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
Note: Glyph index is specific to the font, use glyphs indices returned by TextServer.ShapedTextGetGlyphs or TextServer.FontGetGlyphIndex.
Note: If there are pending glyphs to render, calling this function might trigger the texture cache update.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
canvas | Rid | — |
size | long | — |
pos | Vector2 | — |
index | long | — |
color | Color? | default |
oversampling | float | 0f |
colorIf the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).
FontDrawGlyphOutline2 overloads
public void FontDrawGlyphOutline(Rid fontRid, Rid canvas, long size, long outlineSize, Vector2 pos, long index, Color? color);Draws single glyph outline of size outline_size into a canvas item at the position, using font_rid at the size size. If oversampling is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
Note: Glyph index is specific to the font, use glyphs indices returned by TextServer.ShapedTextGetGlyphs or TextServer.FontGetGlyphIndex.
Note: If there are pending glyphs to render, calling this function might trigger the texture cache update.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
canvas | Rid | — |
size | long | — |
outlineSize | long | — |
pos | Vector2 | — |
index | long | — |
color | Color? | — |
colorIf the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).
public void FontDrawGlyphOutline(Rid fontRid, Rid canvas, long size, long outlineSize, Vector2 pos, long index, Color? color = default, float oversampling = 0f);Draws single glyph outline of size outline_size into a canvas item at the position, using font_rid at the size size. If oversampling is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
Note: Glyph index is specific to the font, use glyphs indices returned by TextServer.ShapedTextGetGlyphs or TextServer.FontGetGlyphIndex.
Note: If there are pending glyphs to render, calling this function might trigger the texture cache update.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
canvas | Rid | — |
size | long | — |
outlineSize | long | — |
pos | Vector2 | — |
index | long | — |
color | Color? | default |
oversampling | float | 0f |
colorIf the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).
FontGetAntialiasingTextServer.FontAntialiasing
public TextServer.FontAntialiasing FontGetAntialiasing(Rid fontRid);Returns font anti-aliasing mode.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
TextServer.FontAntialiasingFontGetAscentdouble
public double FontGetAscent(Rid fontRid, long size);Returns the font ascent (number of pixels above the baseline).
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
doubleFontGetBaselineOffsetdouble
public double FontGetBaselineOffset(Rid fontRid);Returns extra baseline offset (as a fraction of font height).
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
doubleFontGetCharFromGlyphIndexlong
public long FontGetCharFromGlyphIndex(Rid fontRid, long size, long glyphIndex);Returns character code associated with glyph_index, or 0 if glyph_index is invalid. See TextServer.FontGetGlyphIndex.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
glyphIndex | long | — |
longFontGetDescentdouble
public double FontGetDescent(Rid fontRid, long size);Returns the font descent (number of pixels below the baseline).
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
doubleFontGetDisableEmbeddedBitmapsbool
public bool FontGetDisableEmbeddedBitmaps(Rid fontRid);Returns whether the font's embedded bitmap loading is disabled.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
boolFontGetEmboldendouble
public double FontGetEmbolden(Rid fontRid);Returns font embolden strength.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
doubleFontGetFaceCountlong
public long FontGetFaceCount(Rid fontRid);Returns number of faces in the TrueType / OpenType collection.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
longFontGetFaceIndexlong
public long FontGetFaceIndex(Rid fontRid);Returns an active face index in the TrueType / OpenType collection.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
longFontGetFixedSizelong
public long FontGetFixedSize(Rid fontRid);Returns bitmap font fixed size.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
longFontGetFixedSizeScaleModeTextServer.FixedSizeScaleMode
public TextServer.FixedSizeScaleMode FontGetFixedSizeScaleMode(Rid fontRid);Returns bitmap font scaling mode.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
TextServer.FixedSizeScaleModeFontGetGenerateMipmapsbool
public bool FontGetGenerateMipmaps(Rid fontRid);Returns true if font texture mipmap generation is enabled.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
boolFontGetGlobalOversamplingdouble · Deprecated
public double FontGetGlobalOversampling();This method does nothing and always returns 1.0.
doubleFontGetGlyphAdvanceVector2
public Vector2 FontGetGlyphAdvance(Rid fontRid, long size, long glyph);Returns glyph advance (offset of the next glyph). Note: Advance for glyphs outlines is the same as the base glyph advance and is not saved.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
glyph | long | — |
Vector2FontGetGlyphContoursReckfell.Collections.Dictionary
public Reckfell.Collections.Dictionary FontGetGlyphContours(Rid font, long size, long index);Returns outline contours of the glyph as a Reckfell.Collections.Dictionary with the following contents:
points - Vector3[], containing outline points. x and y are point coordinates. z is the type of the point, using the TextServer.ContourPointTag values.
contours - int[], containing indices the end points of each contour.
orientation - [bool], contour orientation. If true, clockwise contours must be filled.
- Two successive
TextServer.ContourPointTag.Onpoints indicate a line segment. - One
TextServer.ContourPointTag.OffConicpoint between twoTextServer.ContourPointTag.Onpoints indicates a single conic (quadratic) Bézier arc. - Two
TextServer.ContourPointTag.OffCubicpoints between twoTextServer.ContourPointTag.Onpoints indicate a single cubic Bézier arc. - Two successive
TextServer.ContourPointTag.OffConicpoints indicate two successive conic (quadratic) Bézier arcs with a virtualTextServer.ContourPointTag.Onpoint at their middle. - Each contour is closed. The last point of a contour uses the first point of a contour as its next point, and vice versa. The first point can be
TextServer.ContourPointTag.OffConicpoint.
| Name | Type | Default |
|---|---|---|
font | Rid | — |
size | long | — |
index | long | — |
Reckfell.Collections.DictionaryFontGetGlyphIndexlong
public long FontGetGlyphIndex(Rid fontRid, long size, long @char, long variationSelector);Returns the glyph index of a char, optionally modified by the variation_selector. See TextServer.FontGetCharFromGlyphIndex.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
char | long | — |
variationSelector | long | — |
longFontGetGlyphListint[]
public int[] FontGetGlyphList(Rid fontRid, Vector2I size);Returns list of rendered glyphs in the cache entry.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
int[]FontGetGlyphOffsetVector2
public Vector2 FontGetGlyphOffset(Rid fontRid, Vector2I size, long glyph);Returns glyph offset from the baseline.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
glyph | long | — |
Vector2FontGetGlyphSizeVector2
public Vector2 FontGetGlyphSize(Rid fontRid, Vector2I size, long glyph);Returns size of the glyph.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
glyph | long | — |
Vector2FontGetGlyphTextureIdxlong
public long FontGetGlyphTextureIdx(Rid fontRid, Vector2I size, long glyph);Returns index of the cache texture containing the glyph.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
glyph | long | — |
longFontGetGlyphTextureRidRid
public Rid FontGetGlyphTextureRid(Rid fontRid, Vector2I size, long glyph);Returns resource ID of the cache texture containing the glyph. Note: If there are pending glyphs to render, calling this function might trigger the texture cache update.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
glyph | long | — |
RidFontGetGlyphTextureSizeVector2
public Vector2 FontGetGlyphTextureSize(Rid fontRid, Vector2I size, long glyph);Returns size of the cache texture containing the glyph. Note: If there are pending glyphs to render, calling this function might trigger the texture cache update.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
glyph | long | — |
Vector2FontGetGlyphUVRectRect2
public Rect2 FontGetGlyphUVRect(Rid fontRid, Vector2I size, long glyph);Returns rectangle in the cache texture containing the glyph.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
glyph | long | — |
Rect2FontGetHintingTextServer.Hinting
public TextServer.Hinting FontGetHinting(Rid fontRid);Returns the font hinting mode. Used by dynamic fonts only.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
TextServer.HintingFontGetKeepRoundingRemaindersbool
public bool FontGetKeepRoundingRemainders(Rid fontRid);Returns glyph position rounding behavior. 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.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
boolFontGetKerningVector2
public Vector2 FontGetKerning(Rid fontRid, long size, Vector2I glyphPair);Returns kerning for the pair of glyphs.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
glyphPair | Vector2I | — |
Vector2FontGetKerningListReckfell.Collections.Array<Vector2I>
public Reckfell.Collections.Array<Vector2I> FontGetKerningList(Rid fontRid, long size);Returns list of the kerning overrides.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
Reckfell.Collections.Array<Vector2I>FontGetLanguageSupportOverridebool
public bool FontGetLanguageSupportOverride(Rid fontRid, string language);Returns true if support override is enabled for the language.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
language | string | — |
boolFontGetLanguageSupportOverridesstring[]
public string[] FontGetLanguageSupportOverrides(Rid fontRid);Returns list of language support overrides.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
string[]FontGetMsdfPixelRangelong
public long FontGetMsdfPixelRange(Rid fontRid);Returns the width of the range around the shape between the minimum and maximum representable signed distance.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
longFontGetMsdfSizelong
public long FontGetMsdfSize(Rid fontRid);Returns source font size used to generate MSDF textures.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
longFontGetNamestring
public string FontGetName(Rid fontRid);Returns font family name.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
stringFontGetOpentypeFeatureOverridesReckfell.Collections.Dictionary
public Reckfell.Collections.Dictionary FontGetOpentypeFeatureOverrides(Rid fontRid);Returns font OpenType feature set override.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
Reckfell.Collections.DictionaryFontGetOtNameStringsReckfell.Collections.Dictionary
public Reckfell.Collections.Dictionary FontGetOtNameStrings(Rid fontRid);Returns Reckfell.Collections.Dictionary with OpenType font name strings (localized font names, version, description, license information, sample text, etc.).
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
Reckfell.Collections.DictionaryFontGetOversamplingdouble
public double FontGetOversampling(Rid fontRid);Returns oversampling factor override. 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 [code skip-lint]oversampling parameter of [code skip-lint]draw_* methods. Used by dynamic fonts only.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
doubleFontGetPaletteColorsColor[]
public Color[] FontGetPaletteColors(Rid fontRid, long index);Returns the array in the predefined color palette at index. Palette contains all colors used to render font glyphs. Each palette has the same number of colors. Colors can be overridden using TextServer.FontSetPaletteCustomColors.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
index | long | — |
Color[]FontGetPaletteCountlong
public long FontGetPaletteCount(Rid fontRid);Returns the number of predefined color palettes. Palette contains all colors used to render font glyphs. Each palette has the same number of colors.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
longFontGetPaletteCustomColorsColor[]
public Color[] FontGetPaletteCustomColors(Rid fontRid);Returns array of custom colors to override predefined palette.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
Color[]FontGetPaletteNamestring
public string FontGetPaletteName(Rid fontRid, long index);Returns the name of the predefined color palette at index. Palette contains all colors used to render font glyphs. Each palette has the same number of colors.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
index | long | — |
stringFontGetScaledouble
public double FontGetScale(Rid fontRid, long size);Returns scaling factor of the color bitmap font.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
doubleFontGetScriptSupportOverridebool
public bool FontGetScriptSupportOverride(Rid fontRid, string script);Returns true if support override is enabled for the script.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
script | string | — |
boolFontGetScriptSupportOverridesstring[]
public string[] FontGetScriptSupportOverrides(Rid fontRid);Returns list of script support overrides.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
string[]FontGetSizeCacheInfoReckfell.Collections.Array<Reckfell.Collections.Dictionary>
public Reckfell.Collections.Array<Reckfell.Collections.Dictionary> FontGetSizeCacheInfo(Rid fontRid);Returns font cache information, each entry contains the following fields: Vector2i size_px - font size in pixels, float viewport_oversampling - viewport oversampling factor, int glyphs - number of rendered glyphs, int textures - number of used textures, int textures_size - size of texture data in bytes.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
Reckfell.Collections.Array<Reckfell.Collections.Dictionary>FontGetSizeCacheListReckfell.Collections.Array<Vector2I>
public Reckfell.Collections.Array<Vector2I> FontGetSizeCacheList(Rid fontRid);Returns list of the font sizes in the cache. Each size is Vector2I with font size and outline size.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
Reckfell.Collections.Array<Vector2I>FontGetSpacinglong
public long FontGetSpacing(Rid fontRid, TextServer.SpacingType spacing);Returns the spacing for spacing in pixels (not relative to the font size).
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
spacing | TextServer.SpacingType | — |
longFontGetStretchlong
public long FontGetStretch(Rid fontRid);Returns font stretch amount, compared to a normal width. A percentage value between 50% and 200%.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
longFontGetStyleTextServer.FontStyle
public TextServer.FontStyle FontGetStyle(Rid fontRid);Returns font style flags.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
TextServer.FontStyleFontGetStyleNamestring
public string FontGetStyleName(Rid fontRid);Returns font style name.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
stringFontGetSubpixelPositioningTextServer.SubpixelPositioning
public TextServer.SubpixelPositioning FontGetSubpixelPositioning(Rid fontRid);Returns font subpixel glyph positioning mode.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
TextServer.SubpixelPositioningFontGetSupportedCharsstring
public string FontGetSupportedChars(Rid fontRid);Returns a string containing all the characters available in the font.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
stringFontGetSupportedGlyphsint[]
public int[] FontGetSupportedGlyphs(Rid fontRid);Returns an array containing all glyph indices in the font.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
int[]FontGetTextureCountlong
public long FontGetTextureCount(Rid fontRid, Vector2I size);Returns number of textures used by font cache entry.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
longFontGetTextureImageImage
public Image FontGetTextureImage(Rid fontRid, Vector2I size, long textureIndex);Returns font cache texture image data.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
textureIndex | long | — |
ImageFontGetTextureOffsetsint[]
public int[] FontGetTextureOffsets(Rid fontRid, Vector2I size, long textureIndex);Returns array containing glyph packing data.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
textureIndex | long | — |
int[]FontGetTransformTransform2D
public Transform2D FontGetTransform(Rid fontRid);Returns 2D transform applied to the font outlines.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
Transform2DFontGetUnderlinePositiondouble
public double FontGetUnderlinePosition(Rid fontRid, long size);Returns pixel offset of the underline below the baseline.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
doubleFontGetUnderlineThicknessdouble
public double FontGetUnderlineThickness(Rid fontRid, long size);Returns thickness of the underline in pixels.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
doubleFontGetUsedPalettelong
public long FontGetUsedPalette(Rid fontRid);Returns used palette index.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
longFontGetVariationCoordinatesReckfell.Collections.Dictionary
public Reckfell.Collections.Dictionary FontGetVariationCoordinates(Rid fontRid);Returns variation coordinates for the specified font cache entry. See TextServer.FontSupportedVariationList for more info.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
Reckfell.Collections.DictionaryFontGetWeightlong
public long FontGetWeight(Rid fontRid);Returns weight (boldness) of the font. A value in the 100...999 range, normal font weight is 400, bold font weight is 700.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
longFontHasCharbool
public bool FontHasChar(Rid fontRid, long @char);Returns true if a Unicode char is available in the font.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
char | long | — |
boolFontIsAllowSystemFallbackbool
public bool FontIsAllowSystemFallback(Rid fontRid);Returns true if system fonts can be automatically used as fallbacks.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
boolFontIsForceAutohinterbool
public bool FontIsForceAutohinter(Rid fontRid);Returns true if auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
boolFontIsLanguageSupportedbool
public bool FontIsLanguageSupported(Rid fontRid, string language);Returns true if the font supports the given language (as a ISO 639 code).
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
language | string | — |
boolFontIsModulateColorGlyphsbool
public bool FontIsModulateColorGlyphs(Rid fontRid);Returns true if color modulation is applied when drawing the font's colored glyphs.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
boolFontIsMultichannelSignedDistanceFieldbool
public bool FontIsMultichannelSignedDistanceField(Rid fontRid);Returns true if glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
boolFontIsScriptSupportedbool
public bool FontIsScriptSupported(Rid fontRid, string script);Returns true if the font supports the given script (as a ISO 15924 code).
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
script | string | — |
boolFontRemoveGlyphvoid
public void FontRemoveGlyph(Rid fontRid, Vector2I size, long glyph);Removes specified rendered glyph information from the cache entry.
Note: This function will not remove textures associated with the glyphs, use TextServer.FontRemoveTexture to remove them manually.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
glyph | long | — |
FontRemoveKerningvoid
public void FontRemoveKerning(Rid fontRid, long size, Vector2I glyphPair);Removes kerning override for the pair of glyphs.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
glyphPair | Vector2I | — |
FontRemoveLanguageSupportOverridevoid
public void FontRemoveLanguageSupportOverride(Rid fontRid, string language);Remove language support override.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
language | string | — |
FontRemoveScriptSupportOverridevoid
public void FontRemoveScriptSupportOverride(Rid fontRid, string script);Removes script support override.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
script | string | — |
FontRemoveSizeCachevoid
public void FontRemoveSizeCache(Rid fontRid, Vector2I size);Removes specified font size from the cache entry.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
FontRemoveTexturevoid
public void FontRemoveTexture(Rid fontRid, Vector2I size, long textureIndex);Removes specified texture from the cache entry.
Note: This function will not remove glyphs associated with the texture, remove them manually, using TextServer.FontRemoveGlyph.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
textureIndex | long | — |
FontRenderGlyphvoid
public void FontRenderGlyph(Rid fontRid, Vector2I size, long index);Renders specified glyph to the font cache texture.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
index | long | — |
FontRenderRangevoid
public void FontRenderRange(Rid fontRid, Vector2I size, long start, long end);Renders the range of characters to the font cache texture.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
start | long | — |
end | long | — |
FontSetAllowSystemFallbackvoid
public void FontSetAllowSystemFallback(Rid fontRid, bool allowSystemFallback);If set to true, system fonts can be automatically used as fallbacks.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
allowSystemFallback | bool | — |
FontSetAntialiasingvoid
public void FontSetAntialiasing(Rid fontRid, TextServer.FontAntialiasing antialiasing);Sets font anti-aliasing mode.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
antialiasing | TextServer.FontAntialiasing | — |
FontSetAscentvoid
public void FontSetAscent(Rid fontRid, long size, double ascent);Sets the font ascent (number of pixels above the baseline).
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
ascent | double | — |
FontSetBaselineOffsetvoid
public void FontSetBaselineOffset(Rid fontRid, double baselineOffset);Sets extra baseline offset (as a fraction of font height).
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
baselineOffset | double | — |
FontSetData2 overloads
public void FontSetData(Rid fontRid, byte[] data);Sets font source data, e.g contents of the dynamic font source file.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
data | byte[] | — |
public void FontSetData(Rid fontRid, ReadOnlySpan<byte> data);Sets font source data, e.g contents of the dynamic font source file.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
data | ReadOnlySpan<byte> | — |
FontSetDescentvoid
public void FontSetDescent(Rid fontRid, long size, double descent);Sets the font descent (number of pixels below the baseline).
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
descent | double | — |
FontSetDisableEmbeddedBitmapsvoid
public void FontSetDisableEmbeddedBitmaps(Rid fontRid, bool disableEmbeddedBitmaps);If set to true, embedded font bitmap loading is disabled (bitmap-only and color fonts ignore this property).
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
disableEmbeddedBitmaps | bool | — |
FontSetEmboldenvoid
public void FontSetEmbolden(Rid fontRid, double strength);Sets font embolden strength. If strength is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
strength | double | — |
FontSetFaceIndexvoid
public void FontSetFaceIndex(Rid fontRid, long faceIndex);Sets an active face index in the TrueType / OpenType collection.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
faceIndex | long | — |
FontSetFixedSizevoid
public void FontSetFixedSize(Rid fontRid, long fixedSize);Sets bitmap font fixed size. If set to value greater than zero, same cache entry will be used for all font sizes.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
fixedSize | long | — |
FontSetFixedSizeScaleModevoid
public void FontSetFixedSizeScaleMode(Rid fontRid, TextServer.FixedSizeScaleMode fixedSizeScaleMode);Sets bitmap font scaling mode. This property is used only if fixed_size is greater than zero.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
fixedSizeScaleMode | TextServer.FixedSizeScaleMode | — |
FontSetForceAutohintervoid
public void FontSetForceAutohinter(Rid fontRid, bool forceAutohinter);If set to true auto-hinting is preferred over font built-in hinting.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
forceAutohinter | bool | — |
FontSetGenerateMipmapsvoid
public void FontSetGenerateMipmaps(Rid fontRid, bool generateMipmaps);If set to true font texture mipmap generation is enabled.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
generateMipmaps | bool | — |
FontSetGlobalOversamplingvoid · Deprecated
public void FontSetGlobalOversampling(double oversampling);This method does nothing.
| Name | Type | Default |
|---|---|---|
oversampling | double | — |
FontSetGlyphAdvancevoid
public void FontSetGlyphAdvance(Rid fontRid, long size, long glyph, Vector2 advance);Sets glyph advance (offset of the next glyph). Note: Advance for glyphs outlines is the same as the base glyph advance and is not saved.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
glyph | long | — |
advance | Vector2 | — |
FontSetGlyphOffsetvoid
public void FontSetGlyphOffset(Rid fontRid, Vector2I size, long glyph, Vector2 offset);Sets glyph offset from the baseline.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
glyph | long | — |
offset | Vector2 | — |
FontSetGlyphSizevoid
public void FontSetGlyphSize(Rid fontRid, Vector2I size, long glyph, Vector2 glSize);Sets size of the glyph.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
glyph | long | — |
glSize | Vector2 | — |
FontSetGlyphTextureIdxvoid
public void FontSetGlyphTextureIdx(Rid fontRid, Vector2I size, long glyph, long textureIdx);Sets index of the cache texture containing the glyph.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
glyph | long | — |
textureIdx | long | — |
FontSetGlyphUVRectvoid
public void FontSetGlyphUVRect(Rid fontRid, Vector2I size, long glyph, Rect2 uVRect);Sets rectangle in the cache texture containing the glyph.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
glyph | long | — |
uVRect | Rect2 | — |
FontSetHintingvoid
public void FontSetHinting(Rid fontRid, TextServer.Hinting hinting);Sets font hinting mode. Used by dynamic fonts only.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
hinting | TextServer.Hinting | — |
FontSetKeepRoundingRemaindersvoid
public void FontSetKeepRoundingRemainders(Rid fontRid, bool keepRoundingRemainders);Sets glyph position rounding behavior. 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.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
keepRoundingRemainders | bool | — |
FontSetKerningvoid
public void FontSetKerning(Rid fontRid, long size, Vector2I glyphPair, Vector2 kerning);Sets kerning for the pair of glyphs.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
glyphPair | Vector2I | — |
kerning | Vector2 | — |
FontSetLanguageSupportOverridevoid
public void FontSetLanguageSupportOverride(Rid fontRid, string language, bool supported);Adds override for TextServer.FontIsLanguageSupported.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
language | string | — |
supported | bool | — |
FontSetModulateColorGlyphsvoid
public void FontSetModulateColorGlyphs(Rid fontRid, bool modulate);If set to true, color modulation is applied when drawing colored glyphs, otherwise it's applied to the monochrome glyphs only.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
modulate | bool | — |
FontSetMsdfPixelRangevoid
public void FontSetMsdfPixelRange(Rid fontRid, long msdfPixelRange);Sets the width of the range around the shape between the minimum and maximum representable signed distance.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
msdfPixelRange | long | — |
FontSetMsdfSizevoid
public void FontSetMsdfSize(Rid fontRid, long msdfSize);Sets source font size used to generate MSDF textures.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
msdfSize | long | — |
FontSetMultichannelSignedDistanceFieldvoid
public void FontSetMultichannelSignedDistanceField(Rid fontRid, bool msdf);If set to true, glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data. MSDF rendering allows displaying the font at any scaling factor without blurriness, and without incurring a CPU cost when the font size changes (since the font no longer needs to be rasterized on the CPU). 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.
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.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
msdf | bool | — |
FontSetNamevoid
public void FontSetName(Rid fontRid, string name);Sets the font family name.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
name | string | — |
FontSetOpentypeFeatureOverridesvoid
public void FontSetOpentypeFeatureOverrides(Rid fontRid, Reckfell.Collections.Dictionary overrides);Sets font OpenType feature set override.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
overrides | Reckfell.Collections.Dictionary | — |
FontSetOversamplingvoid
public void FontSetOversampling(Rid fontRid, double oversampling);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 [code skip-lint]oversampling parameter of [code skip-lint]draw_* methods. Used by dynamic fonts only.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
oversampling | double | — |
FontSetPaletteCustomColors2 overloads
public void FontSetPaletteCustomColors(Rid fontRid, Color[] colors);Sets array of custom colors to override predefined palette. Set to empty array to reset overrides. Use Color(0, 0, 0, 0), to keep predefined palette color at specific position.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
colors | Color[] | — |
public void FontSetPaletteCustomColors(Rid fontRid, ReadOnlySpan<Color> colors);Sets array of custom colors to override predefined palette. Set to empty array to reset overrides. Use Color(0, 0, 0, 0), to keep predefined palette color at specific position.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
colors | ReadOnlySpan<Color> | — |
FontSetScalevoid
public void FontSetScale(Rid fontRid, long size, double scale);Sets scaling factor of the color bitmap font.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
scale | double | — |
FontSetScriptSupportOverridevoid
public void FontSetScriptSupportOverride(Rid fontRid, string script, bool supported);Adds override for TextServer.FontIsScriptSupported.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
script | string | — |
supported | bool | — |
FontSetSpacingvoid
public void FontSetSpacing(Rid fontRid, TextServer.SpacingType spacing, long value);Sets the spacing for spacing to value in pixels (not relative to the font size).
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
spacing | TextServer.SpacingType | — |
value | long | — |
FontSetStretchvoid
public void FontSetStretch(Rid fontRid, long weight);Sets font stretch amount, compared to a normal width. A percentage value between 50% and 200%.
Note: This value is used for font matching only and will not affect font rendering. Use TextServer.FontSetFaceIndex, TextServer.FontSetVariationCoordinates, or TextServer.FontSetTransform instead.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
weight | long | — |
FontSetStylevoid
public void FontSetStyle(Rid fontRid, TextServer.FontStyle style);Sets the font style flags.
Note: This value is used for font matching only and will not affect font rendering. Use TextServer.FontSetFaceIndex, TextServer.FontSetVariationCoordinates, TextServer.FontSetEmbolden, or TextServer.FontSetTransform instead.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
style | TextServer.FontStyle | — |
FontSetStyleNamevoid
public void FontSetStyleName(Rid fontRid, string name);Sets the font style name.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
name | string | — |
FontSetSubpixelPositioningvoid
public void FontSetSubpixelPositioning(Rid fontRid, TextServer.SubpixelPositioning subpixelPositioning);Sets font subpixel glyph positioning mode.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
subpixelPositioning | TextServer.SubpixelPositioning | — |
FontSetTextureImagevoid
public void FontSetTextureImage(Rid fontRid, Vector2I size, long textureIndex, Image image);Sets font cache texture image data.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
textureIndex | long | — |
image | Image | — |
FontSetTextureOffsets2 overloads
public void FontSetTextureOffsets(Rid fontRid, Vector2I size, long textureIndex, int[] offset);Sets array containing glyph packing data.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
textureIndex | long | — |
offset | int[] | — |
public void FontSetTextureOffsets(Rid fontRid, Vector2I size, long textureIndex, ReadOnlySpan<int> offset);Sets array containing glyph packing data.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | Vector2I | — |
textureIndex | long | — |
offset | ReadOnlySpan<int> | — |
FontSetTransformvoid
public void FontSetTransform(Rid fontRid, Transform2D transform);Sets 2D transform, applied to the font outlines, can be used for slanting, flipping, and rotating glyphs.
For example, to simulate italic typeface by slanting, apply the following transform Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0).
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
transform | Transform2D | — |
FontSetUnderlinePositionvoid
public void FontSetUnderlinePosition(Rid fontRid, long size, double underlinePosition);Sets pixel offset of the underline below the baseline.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
underlinePosition | double | — |
FontSetUnderlineThicknessvoid
public void FontSetUnderlineThickness(Rid fontRid, long size, double underlineThickness);Sets thickness of the underline in pixels.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
size | long | — |
underlineThickness | double | — |
FontSetUsedPalettevoid
public void FontSetUsedPalette(Rid fontRid, long index);Sets used palette index.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
index | long | — |
FontSetVariationCoordinatesvoid
public void FontSetVariationCoordinates(Rid fontRid, Reckfell.Collections.Dictionary variationCoordinates);Sets variation coordinates for the specified font cache entry. See TextServer.FontSupportedVariationList for more info.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
variationCoordinates | Reckfell.Collections.Dictionary | — |
FontSetWeightvoid
public void FontSetWeight(Rid fontRid, long weight);Sets weight (boldness) of the font. A value in the 100...999 range, normal font weight is 400, bold font weight is 700.
Note: This value is used for font matching only and will not affect font rendering. Use TextServer.FontSetFaceIndex, TextServer.FontSetVariationCoordinates, or TextServer.FontSetEmbolden instead.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
weight | long | — |
FontSupportedFeatureListReckfell.Collections.Dictionary
public Reckfell.Collections.Dictionary FontSupportedFeatureList(Rid fontRid);Returns the dictionary of the supported OpenType features.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
Reckfell.Collections.DictionaryFontSupportedVariationListReckfell.Collections.Dictionary
public Reckfell.Collections.Dictionary FontSupportedVariationList(Rid fontRid);Returns the dictionary of the supported OpenType variation coordinates.
| Name | Type | Default |
|---|---|---|
fontRid | Rid | — |
Reckfell.Collections.DictionaryFormatNumberstring · Deprecated
public string FormatNumber(string number, string language = "");Converts a number from Western Arabic (0..9) to the numeral system used in the given language.
If language is an empty string, the active locale will be used.
| Name | Type | Default |
|---|---|---|
number | string | — |
language | string | "" |
stringFreeRidvoid
public void FreeRid(Rid rid);Frees an object created by this TextServer.
| Name | Type | Default |
|---|---|---|
rid | Rid | — |
GetFeatureslong
public long GetFeatures();Returns text server features, see TextServer.Feature.
longGetHexCodeBoxSizeVector2
public Vector2 GetHexCodeBoxSize(long size, long index);Returns size of the replacement character (box with character hexadecimal code that is drawn in place of invalid characters).
| Name | Type | Default |
|---|---|---|
size | long | — |
index | long | — |
Vector2GetNamestring
public string GetName();Returns the name of the server interface.
stringGetShortNamestring
public string GetShortName();Returns the short name of the server interface. This short name can be used as a value for the --text-driver command line argument (the full name is also supported for compatibility, but it must be quoted if it contains spaces).
stringGetSupportDatabyte[]
public byte[] GetSupportData();Returns default TextServer database (e.g. ICU break iterators and dictionaries).
byte[]GetSupportDataFileNamestring
public string GetSupportDataFileName();Returns default TextServer database (e.g. ICU break iterators and dictionaries) filename.
stringGetSupportDataInfostring
public string GetSupportDataInfo();Returns TextServer database (e.g. ICU break iterators and dictionaries) description.
stringHasbool
public bool Has(Rid rid);Returns true if rid is valid resource owned by this text server.
| Name | Type | Default |
|---|---|---|
rid | Rid | — |
boolHasFeaturebool
public bool HasFeature(TextServer.Feature feature);Returns true if the server supports a feature.
| Name | Type | Default |
|---|---|---|
feature | TextServer.Feature | — |
boolIsConfusable2 overloads
public long IsConfusable(string @string, ReadOnlySpan<string> dict);Returns index of the first string in dict which is visually confusable with the string, or -1 if none is found.
Note: This method doesn't detect invisible characters, for spoof detection use it in combination with TextServer.SpoofCheck.
Note: Always returns -1 if the server does not support the TextServer.Feature.UnicodeSecurity feature.
| Name | Type | Default |
|---|---|---|
string | string | — |
dict | ReadOnlySpan<string> | — |
longpublic long IsConfusable(string @string, string[] dict);Returns index of the first string in dict which is visually confusable with the string, or -1 if none is found.
Note: This method doesn't detect invisible characters, for spoof detection use it in combination with TextServer.SpoofCheck.
Note: Always returns -1 if the server does not support the TextServer.Feature.UnicodeSecurity feature.
| Name | Type | Default |
|---|---|---|
string | string | — |
dict | string[] | — |
longIsLocaleRightToLeftbool
public bool IsLocaleRightToLeft(string locale);Returns true if locale is right-to-left.
| Name | Type | Default |
|---|---|---|
locale | string | — |
boolIsLocaleUsingSupportDatabool
public bool IsLocaleUsingSupportData(string locale);Returns true if the locale requires text server support data for line/word breaking.
| Name | Type | Default |
|---|---|---|
locale | string | — |
boolIsValidIdentifierbool
public bool IsValidIdentifier(string @string);Returns true if string is a valid identifier.
If the text server supports the TextServer.Feature.UnicodeIdentifiers feature, a valid identifier must:
- Conform to normalization form C.
- Begin with a Unicode character of class XID_Start or
"_". - May contain Unicode characters of class XID_Continue in the other positions.
- Use UAX #31 recommended scripts only (mixed scripts are allowed).
If the
TextServer.Feature.UnicodeIdentifiersfeature is not supported, a valid identifier must: - Begin with a Unicode character of class XID_Start or
"_". - May contain Unicode characters of class XID_Continue in the other positions.
| Name | Type | Default |
|---|---|---|
string | string | — |
boolIsValidLetterbool
public bool IsValidLetter(ulong unicode);Returns true if the given code point is a valid letter, i.e. it belongs to the Unicode category "L".
| Name | Type | Default |
|---|---|---|
unicode | ulong | — |
boolLoadSupportDatabool
public bool LoadSupportData(string fileName);Loads optional TextServer database (e.g. ICU break iterators and dictionaries). Note: This function should be called before any other TextServer functions used, otherwise it won't have any effect.
| Name | Type | Default |
|---|---|---|
fileName | string | — |
boolNameToTaglong
public long NameToTag(string name);Converts the given readable name of a feature, variation, script, or language to an OpenType tag.
| Name | Type | Default |
|---|---|---|
name | string | — |
longParseNumberstring · Deprecated
public string ParseNumber(string number, string language = "");Converts number from the numeral system used in the given language to Western Arabic (0..9).
If language is an empty string, the active locale will be used.
| Name | Type | Default |
|---|---|---|
number | string | — |
language | string | "" |
stringParseStructuredTextReckfell.Collections.Array<Vector3I>
public Reckfell.Collections.Array<Vector3I> ParseStructuredText(TextServer.StructuredTextParser parserType, Reckfell.Collections.Array args, string text);Default implementation of the BiDi algorithm override function.
| Name | Type | Default |
|---|---|---|
parserType | TextServer.StructuredTextParser | — |
args | Reckfell.Collections.Array | — |
text | string | — |
Reckfell.Collections.Array<Vector3I>PercentSignstring · Deprecated
public string PercentSign(string language = "");Returns the percent sign used in the given language.
If language is an empty string, the active locale will be used.
| Name | Type | Default |
|---|---|---|
language | string | "" |
stringSaveSupportDatabool
public bool SaveSupportData(string fileName);Saves optional TextServer database (e.g. ICU break iterators and dictionaries) to the file. Note: This function is used by during project export, to include TextServer database.
| Name | Type | Default |
|---|---|---|
fileName | string | — |
boolShapedGetRunCountlong
public long ShapedGetRunCount(Rid shaped);Returns the number of uniform text runs in the buffer.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
longShapedGetRunDirectionTextServer.Direction
public TextServer.Direction ShapedGetRunDirection(Rid shaped, long index);Returns the direction of the index text run (in visual order).
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
index | long | — |
TextServer.DirectionShapedGetRunFontRidRid
public Rid ShapedGetRunFontRid(Rid shaped, long index);Returns the font RID of the index text run (in visual order).
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
index | long | — |
RidShapedGetRunFontSizeint
public int ShapedGetRunFontSize(Rid shaped, long index);Returns the font size of the index text run (in visual order).
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
index | long | — |
intShapedGetRunGlyphRangeVector2I
public Vector2I ShapedGetRunGlyphRange(Rid shaped, long index);Returns the glyph range of the index text run (in visual order).
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
index | long | — |
Vector2IShapedGetRunLanguagestring
public string ShapedGetRunLanguage(Rid shaped, long index);Returns the language of the index text run (in visual order).
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
index | long | — |
stringShapedGetRunObjectVariant
public Variant ShapedGetRunObject(Rid shaped, long index);Returns the embedded object of the index text run (in visual order).
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
index | long | — |
VariantShapedGetRunRangeVector2I
public Vector2I ShapedGetRunRange(Rid shaped, long index);Returns the source text range of the index text run (in visual order).
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
index | long | — |
Vector2IShapedGetRunTextstring
public string ShapedGetRunText(Rid shaped, long index);Returns the source text of the index text run (in visual order).
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
index | long | — |
stringShapedGetSpanCountlong
public long ShapedGetSpanCount(Rid shaped);Returns number of text spans added using TextServer.ShapedTextAddString or TextServer.ShapedTextAddObject.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
longShapedGetSpanEmbeddedObjectVariant
public Variant ShapedGetSpanEmbeddedObject(Rid shaped, long index);Returns text embedded object key.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
index | long | — |
VariantShapedGetSpanMetaVariant
public Variant ShapedGetSpanMeta(Rid shaped, long index);Returns text span metadata.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
index | long | — |
VariantShapedGetSpanObjectVariant
public Variant ShapedGetSpanObject(Rid shaped, long index);Returns the text span embedded object key.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
index | long | — |
VariantShapedGetSpanTextstring
public string ShapedGetSpanText(Rid shaped, long index);Returns the text span source text.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
index | long | — |
stringShapedGetTextstring
public string ShapedGetText(Rid shaped);Returns the text buffer source text, including object replacement characters.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
stringShapedSetSpanUpdateFontvoid
public void ShapedSetSpanUpdateFont(Rid shaped, long index, Reckfell.Collections.Array<Rid> fonts, long size, Reckfell.Collections.Dictionary opentypeFeatures = null);Changes text span font, font size, and OpenType features, without changing the text.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
index | long | — |
fonts | Reckfell.Collections.Array<Rid> | — |
size | long | — |
opentypeFeatures | Reckfell.Collections.Dictionary | null |
ShapedTextAddObjectbool
public bool ShapedTextAddObject(Rid shaped, Variant key, Vector2 size, InlineAlignment inlineAlign = InlineAlignment.Center, long length = 1, double baseline = 0d);Adds inline object to the text buffer, key must be unique. In the text, object is represented as length object replacement characters.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
key | Variant | — |
size | Vector2 | — |
inlineAlign | InlineAlignment | InlineAlignment.Center |
length | long | 1 |
baseline | double | 0d |
boolShapedTextAddStringbool
public bool ShapedTextAddString(Rid shaped, string text, Reckfell.Collections.Array<Rid> fonts, long size, Reckfell.Collections.Dictionary opentypeFeatures = null, string language = "", Variant meta = default);Adds text span and font to draw it to the text buffer.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
text | string | — |
fonts | Reckfell.Collections.Array<Rid> | — |
size | long | — |
opentypeFeatures | Reckfell.Collections.Dictionary | null |
language | string | "" |
meta | Variant | default |
boolShapedTextClearvoid
public void ShapedTextClear(Rid rid);Clears text buffer (removes text and inline objects).
| Name | Type | Default |
|---|---|---|
rid | Rid | — |
ShapedTextClosestCharacterPoslong
public long ShapedTextClosestCharacterPos(Rid shaped, long pos);Returns composite character position closest to the pos.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
pos | long | — |
longShapedTextDraw2 overloads
public void ShapedTextDraw(Rid shaped, Rid canvas, Vector2 pos, double clipL, double clipR, Color? color);Draw shaped text into a canvas item at a given position, with color. pos specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout). If oversampling is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
clip_l and clip_r are offsets relative to pos, going to the right in horizontal layout and downward in vertical layout. If clip_l is not negative, glyphs starting before the offset are clipped. If clip_r is not negative, glyphs ending after the offset are clipped.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
canvas | Rid | — |
pos | Vector2 | — |
clipL | double | — |
clipR | double | — |
color | Color? | — |
colorIf the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).
public void ShapedTextDraw(Rid shaped, Rid canvas, Vector2 pos, double clipL = -1d, double clipR = -1d, Color? color = default, float oversampling = 0f);Draw shaped text into a canvas item at a given position, with color. pos specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout). If oversampling is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
clip_l and clip_r are offsets relative to pos, going to the right in horizontal layout and downward in vertical layout. If clip_l is not negative, glyphs starting before the offset are clipped. If clip_r is not negative, glyphs ending after the offset are clipped.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
canvas | Rid | — |
pos | Vector2 | — |
clipL | double | -1d |
clipR | double | -1d |
color | Color? | default |
oversampling | float | 0f |
colorIf the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).
ShapedTextDrawOutline2 overloads
public void ShapedTextDrawOutline(Rid shaped, Rid canvas, Vector2 pos, double clipL, double clipR, long outlineSize, Color? color);Draw the outline of the shaped text into a canvas item at a given position, with color. pos specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout). If oversampling is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
clip_l and clip_r are offsets relative to pos, going to the right in horizontal layout and downward in vertical layout. If clip_l is not negative, glyphs starting before the offset are clipped. If clip_r is not negative, glyphs ending after the offset are clipped.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
canvas | Rid | — |
pos | Vector2 | — |
clipL | double | — |
clipR | double | — |
outlineSize | long | — |
color | Color? | — |
colorIf the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).
public void ShapedTextDrawOutline(Rid shaped, Rid canvas, Vector2 pos, double clipL = -1d, double clipR = -1d, long outlineSize = 1, Color? color = default, float oversampling = 0f);Draw the outline of the shaped text into a canvas item at a given position, with color. pos specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout). If oversampling is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
clip_l and clip_r are offsets relative to pos, going to the right in horizontal layout and downward in vertical layout. If clip_l is not negative, glyphs starting before the offset are clipped. If clip_r is not negative, glyphs ending after the offset are clipped.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
canvas | Rid | — |
pos | Vector2 | — |
clipL | double | -1d |
clipR | double | -1d |
outlineSize | long | 1 |
color | Color? | default |
oversampling | float | 0f |
colorIf the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).
ShapedTextDuplicateRid
public Rid ShapedTextDuplicate(Rid rid);Duplicates shaped text buffer.
| Name | Type | Default |
|---|---|---|
rid | Rid | — |
RidShapedTextFitToWidthdouble
public double ShapedTextFitToWidth(Rid shaped, double width, TextServer.JustificationFlag justificationFlags = TextServer.JustificationFlag.Kashida | TextServer.JustificationFlag.WordBound);Adjusts text width to fit to specified width, returns new text width.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
width | double | — |
justificationFlags | TextServer.JustificationFlag | TextServer.JustificationFlag.Kashida | TextServer.JustificationFlag.WordBound |
doubleShapedTextGetAscentdouble
public double ShapedTextGetAscent(Rid shaped);Returns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical). Note: Overall ascent can be higher than font ascent, if some glyphs are displaced from the baseline.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
doubleShapedTextGetCaretsReckfell.Collections.Dictionary
public Reckfell.Collections.Dictionary ShapedTextGetCarets(Rid shaped, long position);Returns shapes of the carets corresponding to the character offset position in the text. Returned caret shape is 1 pixel wide rectangle.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
position | long | — |
Reckfell.Collections.DictionaryShapedTextGetCharacterBreaksint[]
public int[] ShapedTextGetCharacterBreaks(Rid shaped);Returns array of the composite character boundaries.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
int[]ShapedTextGetCustomEllipsislong
public long ShapedTextGetCustomEllipsis(Rid shaped);Returns ellipsis character used for text clipping.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
longShapedTextGetCustomPunctuationstring
public string ShapedTextGetCustomPunctuation(Rid shaped);Returns custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
stringShapedTextGetDescentdouble
public double ShapedTextGetDescent(Rid shaped);Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical). Note: Overall descent can be higher than font descent, if some glyphs are displaced from the baseline.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
doubleShapedTextGetDirectionTextServer.Direction
public TextServer.Direction ShapedTextGetDirection(Rid shaped);Returns direction of the text.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
TextServer.DirectionShapedTextGetDominantDirectionInRangeTextServer.Direction
public TextServer.Direction ShapedTextGetDominantDirectionInRange(Rid shaped, long start, long end);Returns dominant direction of in the range of text.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
start | long | — |
end | long | — |
TextServer.DirectionShapedTextGetEllipsisGlyphCountlong
public long ShapedTextGetEllipsisGlyphCount(Rid shaped);Returns number of glyphs in the ellipsis.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
longShapedTextGetEllipsisGlyphsReckfell.Collections.Array<Reckfell.Collections.Dictionary>
public Reckfell.Collections.Array<Reckfell.Collections.Dictionary> ShapedTextGetEllipsisGlyphs(Rid shaped);Returns array of the glyphs in the ellipsis.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
Reckfell.Collections.Array<Reckfell.Collections.Dictionary>ShapedTextGetEllipsisPoslong
public long ShapedTextGetEllipsisPos(Rid shaped);Returns position of the ellipsis.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
longShapedTextGetGlyphCountlong
public long ShapedTextGetGlyphCount(Rid shaped);Returns number of glyphs in the buffer.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
longShapedTextGetGlyphsReckfell.Collections.Array<Reckfell.Collections.Dictionary>
public Reckfell.Collections.Array<Reckfell.Collections.Dictionary> ShapedTextGetGlyphs(Rid shaped);Returns an array of glyphs in the visual order.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
Reckfell.Collections.Array<Reckfell.Collections.Dictionary>ShapedTextGetGraphemeBoundsVector2
public Vector2 ShapedTextGetGraphemeBounds(Rid shaped, long pos);Returns composite character's bounds as offsets from the start of the line.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
pos | long | — |
Vector2ShapedTextGetInferredDirectionTextServer.Direction
public TextServer.Direction ShapedTextGetInferredDirection(Rid shaped);Returns direction of the text, inferred by the BiDi algorithm.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
TextServer.DirectionShapedTextGetLineBreaksint[]
public int[] ShapedTextGetLineBreaks(Rid shaped, double width, long start = 0, TextServer.LineBreakFlag breakFlags = TextServer.LineBreakFlag.Mandatory | TextServer.LineBreakFlag.WordBound);Breaks text to the lines and returns character ranges for each line.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
width | double | — |
start | long | 0 |
breakFlags | TextServer.LineBreakFlag | TextServer.LineBreakFlag.Mandatory | TextServer.LineBreakFlag.WordBound |
int[]ShapedTextGetLineBreaksAdv2 overloads
public int[] ShapedTextGetLineBreaksAdv(Rid shaped, ReadOnlySpan<float> width, long start, bool once, TextServer.LineBreakFlag breakFlags);Breaks text to the lines and columns. Returns character ranges for each segment.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
width | ReadOnlySpan<float> | — |
start | long | — |
once | bool | — |
breakFlags | TextServer.LineBreakFlag | — |
int[]public int[] ShapedTextGetLineBreaksAdv(Rid shaped, float[] width, long start = 0, bool once = true, TextServer.LineBreakFlag breakFlags = TextServer.LineBreakFlag.Mandatory | TextServer.LineBreakFlag.WordBound);Breaks text to the lines and columns. Returns character ranges for each segment.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
width | float[] | — |
start | long | 0 |
once | bool | true |
breakFlags | TextServer.LineBreakFlag | TextServer.LineBreakFlag.Mandatory | TextServer.LineBreakFlag.WordBound |
int[]ShapedTextGetObjectGlyphlong
public long ShapedTextGetObjectGlyph(Rid shaped, Variant key);Returns the glyph index of the inline object.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
key | Variant | — |
longShapedTextGetObjectRangeVector2I
public Vector2I ShapedTextGetObjectRange(Rid shaped, Variant key);Returns the character range of the inline object.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
key | Variant | — |
Vector2IShapedTextGetObjectRectRect2
public Rect2 ShapedTextGetObjectRect(Rid shaped, Variant key);Returns bounding rectangle of the inline object.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
key | Variant | — |
Rect2ShapedTextGetObjectsReckfell.Collections.Array
public Reckfell.Collections.Array ShapedTextGetObjects(Rid shaped);Returns array of inline objects.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
Reckfell.Collections.ArrayShapedTextGetOrientationTextServer.Orientation
public TextServer.Orientation ShapedTextGetOrientation(Rid shaped);Returns text orientation.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
TextServer.OrientationShapedTextGetParentRid
public Rid ShapedTextGetParent(Rid shaped);Returns the parent buffer from which the substring originates.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
RidShapedTextGetPreserveControlbool
public bool ShapedTextGetPreserveControl(Rid shaped);Returns true if text buffer is configured to display control characters.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
boolShapedTextGetPreserveInvalidbool
public bool ShapedTextGetPreserveInvalid(Rid shaped);Returns true if text buffer is configured to display hexadecimal codes in place of invalid characters.
Note: If set to false, nothing is displayed in place of invalid characters.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
boolShapedTextGetRangeVector2I
public Vector2I ShapedTextGetRange(Rid shaped);Returns substring buffer character range in the parent buffer.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
Vector2IShapedTextGetSelectionVector2[]
public Vector2[] ShapedTextGetSelection(Rid shaped, long start, long end);Returns selection rectangles for the specified character range.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
start | long | — |
end | long | — |
Vector2[]ShapedTextGetSizeVector2
public Vector2 ShapedTextGetSize(Rid shaped);Returns size of the text.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
Vector2ShapedTextGetSpacinglong
public long ShapedTextGetSpacing(Rid shaped, TextServer.SpacingType spacing);Returns extra spacing added between glyphs or lines in pixels.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
spacing | TextServer.SpacingType | — |
longShapedTextGetTrimPoslong
public long ShapedTextGetTrimPos(Rid shaped);Returns the position of the overrun trim.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
longShapedTextGetUnderlinePositiondouble
public double ShapedTextGetUnderlinePosition(Rid shaped);Returns pixel offset of the underline below the baseline.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
doubleShapedTextGetUnderlineThicknessdouble
public double ShapedTextGetUnderlineThickness(Rid shaped);Returns thickness of the underline.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
doubleShapedTextGetWidthdouble
public double ShapedTextGetWidth(Rid shaped);Returns width (for horizontal layout) or height (for vertical) of the text.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
doubleShapedTextGetWordBreaks2 overloads
public int[] ShapedTextGetWordBreaks(Rid shaped, TextServer.GraphemeFlag graphemeFlags);Breaks text into words and returns array of character ranges. Use grapheme_flags to set what characters are used for breaking.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
graphemeFlags | TextServer.GraphemeFlag | — |
int[]public int[] ShapedTextGetWordBreaks(Rid shaped, TextServer.GraphemeFlag graphemeFlags = TextServer.GraphemeFlag.Space | TextServer.GraphemeFlag.Punctuation, TextServer.GraphemeFlag skipGraphemeFlags = TextServer.GraphemeFlag.Virtual);Breaks text into words and returns array of character ranges. Use grapheme_flags to set what characters are used for breaking.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
graphemeFlags | TextServer.GraphemeFlag | TextServer.GraphemeFlag.Space | TextServer.GraphemeFlag.Punctuation |
skipGraphemeFlags | TextServer.GraphemeFlag | TextServer.GraphemeFlag.Virtual |
int[]ShapedTextHasObjectbool
public bool ShapedTextHasObject(Rid shaped, Variant key);Returns true if an object with key is embedded in this shaped text buffer.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
key | Variant | — |
boolShapedTextHasVisibleCharsbool
public bool ShapedTextHasVisibleChars(Rid shaped);Returns true if text buffer contains any visible characters.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
boolShapedTextHitTestGraphemelong
public long ShapedTextHitTestGrapheme(Rid shaped, double coords);Returns grapheme index at the specified pixel offset at the baseline, or -1 if none is found.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
coords | double | — |
longShapedTextHitTestPositionlong
public long ShapedTextHitTestPosition(Rid shaped, double coords);Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
coords | double | — |
longShapedTextIsReadybool
public bool ShapedTextIsReady(Rid shaped);Returns true if buffer is successfully shaped.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
boolShapedTextNextCharacterPoslong
public long ShapedTextNextCharacterPos(Rid shaped, long pos);Returns composite character end position closest to the pos.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
pos | long | — |
longShapedTextNextGraphemePoslong
public long ShapedTextNextGraphemePos(Rid shaped, long pos);Returns grapheme end position closest to the pos.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
pos | long | — |
longShapedTextOverrunTrimToWidthvoid
public void ShapedTextOverrunTrimToWidth(Rid shaped, double width = 0d, TextServer.TextOverrunFlag overrunTrimFlags = TextServer.TextOverrunFlag.NoTrim);Trims text if it exceeds the given width.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
width | double | 0d |
overrunTrimFlags | TextServer.TextOverrunFlag | TextServer.TextOverrunFlag.NoTrim |
ShapedTextPrevCharacterPoslong
public long ShapedTextPrevCharacterPos(Rid shaped, long pos);Returns composite character start position closest to the pos.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
pos | long | — |
longShapedTextPrevGraphemePoslong
public long ShapedTextPrevGraphemePos(Rid shaped, long pos);Returns grapheme start position closest to the pos.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
pos | long | — |
longShapedTextResizeObjectbool
public bool ShapedTextResizeObject(Rid shaped, Variant key, Vector2 size, InlineAlignment inlineAlign = InlineAlignment.Center, double baseline = 0d);Sets new size and alignment of embedded object.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
key | Variant | — |
size | Vector2 | — |
inlineAlign | InlineAlignment | InlineAlignment.Center |
baseline | double | 0d |
boolShapedTextSetBidiOverridevoid
public void ShapedTextSetBidiOverride(Rid shaped, Reckfell.Collections.Array @override);Overrides BiDi for the structured text. Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
override | Reckfell.Collections.Array | — |
ShapedTextSetCustomEllipsisvoid
public void ShapedTextSetCustomEllipsis(Rid shaped, long @char);Sets ellipsis character used for text clipping.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
char | long | — |
ShapedTextSetCustomPunctuationvoid
public void ShapedTextSetCustomPunctuation(Rid shaped, string punct);Sets custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
punct | string | — |
ShapedTextSetDirectionvoid
public void ShapedTextSetDirection(Rid shaped, TextServer.Direction direction = TextServer.Direction.Auto);Sets desired text direction. If set to TextServer.Direction.Auto, direction will be detected based on the buffer contents and current locale.
Note: Direction is ignored if server does not support TextServer.Feature.BidiLayout feature (supported by TextServerAdvanced).
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
direction | TextServer.Direction | TextServer.Direction.Auto |
ShapedTextSetOrientationvoid
public void ShapedTextSetOrientation(Rid shaped, TextServer.Orientation orientation = TextServer.Orientation.Horizontal);Sets desired text orientation.
Note: Orientation is ignored if server does not support TextServer.Feature.VerticalLayout feature (supported by TextServerAdvanced).
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
orientation | TextServer.Orientation | TextServer.Orientation.Horizontal |
ShapedTextSetPreserveControlvoid
public void ShapedTextSetPreserveControl(Rid shaped, bool enabled);If set to true text buffer will display control characters.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
enabled | bool | — |
ShapedTextSetPreserveInvalidvoid
public void ShapedTextSetPreserveInvalid(Rid shaped, bool enabled);If set to true text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
enabled | bool | — |
ShapedTextSetSpacingvoid
public void ShapedTextSetSpacing(Rid shaped, TextServer.SpacingType spacing, long value);Sets extra spacing added between glyphs or lines in pixels.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
spacing | TextServer.SpacingType | — |
value | long | — |
ShapedTextShapebool
public bool ShapedTextShape(Rid shaped);Shapes buffer if it's not shaped. Returns true if the string is shaped successfully.
Note: It is not necessary to call this function manually, buffer will be shaped automatically as soon as any of its output data is requested.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
boolShapedTextSortLogicalReckfell.Collections.Array<Reckfell.Collections.Dictionary>
public Reckfell.Collections.Array<Reckfell.Collections.Dictionary> ShapedTextSortLogical(Rid shaped);Returns text glyphs in the logical order.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
Reckfell.Collections.Array<Reckfell.Collections.Dictionary>ShapedTextSubstrRid
public Rid ShapedTextSubstr(Rid shaped, long start, long length);Returns text buffer for the substring of the text in the shaped text buffer (including inline objects).
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
start | long | — |
length | long | — |
RidShapedTextTabAlign2 overloads
public double ShapedTextTabAlign(Rid shaped, ReadOnlySpan<float> tabStops);Aligns shaped text to the given tab-stops.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
tabStops | ReadOnlySpan<float> | — |
doublepublic double ShapedTextTabAlign(Rid shaped, float[] tabStops);Aligns shaped text to the given tab-stops.
| Name | Type | Default |
|---|---|---|
shaped | Rid | — |
tabStops | float[] | — |
doubleSpoofCheckbool
public bool SpoofCheck(string @string);Returns true if string is likely to be an attempt at confusing the reader.
Note: Always returns false if the server does not support the TextServer.Feature.UnicodeSecurity feature.
| Name | Type | Default |
|---|---|---|
string | string | — |
boolStringGetCharacterBreaksint[]
public int[] StringGetCharacterBreaks(string @string, string language = "");Returns array of the composite character boundaries.
| Name | Type | Default |
|---|---|---|
string | string | — |
language | string | "" |
int[]StringGetWordBreaksint[]
public int[] StringGetWordBreaks(string @string, string language = "", long charsPerLine = 0);Returns an array of the word break boundaries. Elements in the returned array are the offsets of the start and end of words. Therefore the length of the array is always even.
When chars_per_line is greater than zero, line break boundaries are returned instead.
| Name | Type | Default |
|---|---|---|
string | string | — |
language | string | "" |
charsPerLine | long | 0 |
int[]StringToLowerstring
public string StringToLower(string @string, string language = "");Returns the string converted to lowercase.
Note: Casing is locale dependent and context sensitive if server support TextServer.Feature.ContextSensitiveCaseConversion feature (supported by TextServerAdvanced).
Note: The result may be longer or shorter than the original.
| Name | Type | Default |
|---|---|---|
string | string | — |
language | string | "" |
stringStringToTitlestring
public string StringToTitle(string @string, string language = "");Returns the string converted to Title Case.
Note: Casing is locale dependent and context sensitive if server support TextServer.Feature.ContextSensitiveCaseConversion feature (supported by TextServerAdvanced).
Note: The result may be longer or shorter than the original.
| Name | Type | Default |
|---|---|---|
string | string | — |
language | string | "" |
stringStringToUpperstring
public string StringToUpper(string @string, string language = "");Returns the string converted to UPPERCASE.
Note: Casing is locale dependent and context sensitive if server support TextServer.Feature.ContextSensitiveCaseConversion feature (supported by TextServerAdvanced).
Note: The result may be longer or shorter than the original.
| Name | Type | Default |
|---|---|---|
string | string | — |
language | string | "" |
stringStripDiacriticsstring
public string StripDiacritics(string @string);Strips diacritics from the string. Note: The result may be longer or shorter than the original.
| Name | Type | Default |
|---|---|---|
string | string | — |
stringTagToNamestring
public string TagToName(long tag);Converts the given OpenType tag to the readable name of a feature, variation, script, or language.
| Name | Type | Default |
|---|---|---|
tag | long | — |
stringTextServer.AutowrapMode
| Value | Description |
|---|---|
Arbitrary = 1 | Wraps the text inside the node's bounding rectangle by allowing to break lines at arbitrary positions, which is useful when very limited space is available. |
Off = 0 | Autowrap is disabled. |
Word = 2 | Wraps the text inside the node's bounding rectangle by soft-breaking between words. |
WordSmart = 3 | Behaves similarly to |
TextServer.ContourPointTag
| Value | Description |
|---|---|
OffConic = 0 | Contour point isn't on the curve, but serves as a control point for a conic (quadratic) Bézier arc. |
OffCubic = 2 | Contour point isn't on the curve, but serves as a control point for a cubic Bézier arc. |
On = 1 | Contour point is on the curve. |
TextServer.Direction
| Value | Description |
|---|---|
Auto = 0 | Text direction is determined based on contents and current locale. |
Inherited = 3 | Text writing direction is the same as base string writing direction. Used for BiDi override only. |
Ltr = 1 | Text is written from left to right. |
Rtl = 2 | Text is written from right to left. |
TextServer.Feature
| Value | Description |
|---|---|
BidiLayout = 2 | TextServer supports bidirectional text layouts. |
BreakIterators = 32 | TextServer supports complex line/word breaking rules (e.g. dictionary based). |
ContextSensitiveCaseConversion = 2048 | TextServer supports locale dependent and context sensitive case conversion. |
FontBitmap = 64 | TextServer supports loading bitmap fonts. |
FontDynamic = 128 | TextServer supports loading dynamic (TrueType, OpeType, etc.) fonts. |
FontMsdf = 256 | TextServer supports multichannel signed distance field dynamic font rendering. |
FontSystem = 512 | TextServer supports loading system fonts. |
FontVariable = 1024 | TextServer supports variable fonts. |
KashidaJustification = 16 | TextServer supports justification using kashidas. |
Shaping = 8 | TextServer supports complex text shaping. |
SimpleLayout = 1 | TextServer supports simple text layouts. |
UnicodeIdentifiers = 8192 | TextServer supports UAX #31 identifier validation, see |
UnicodeSecurity = 16384 | TextServer supports Unicode Technical Report #36 and Unicode Technical Standard #39 based spoof detection features. |
UseSupportData = 4096 | TextServer require external data file for some features, see |
VerticalLayout = 4 | TextServer supports vertical layouts. |
TextServer.FixedSizeScaleMode
| Value | Description |
|---|---|
Disable = 0 | Bitmap font is not scaled. |
Enabled = 2 | Bitmap font is scaled to an arbitrary (fractional) size. This is the recommended option for non-pixel art fonts. |
IntegerOnly = 1 | Bitmap font is scaled to the closest integer multiple of the font's fixed size. This is the recommended option for pixel art fonts. |
TextServer.FontAntialiasing
| Value | Description |
|---|---|
Gray = 1 | Font glyphs are rasterized as 8-bit grayscale anti-aliased bitmaps. |
Lcd = 2 | Font glyphs are rasterized for LCD screens.
LCD subpixel layout is determined by the value of the |
None = 0 | Font glyphs are rasterized as 1-bit bitmaps. |
TextServer.FontLcdSubpixelLayout
| Value | Description |
|---|---|
Hbgr = 2 | Horizontal BGR subpixel layout. |
Hrgb = 1 | Horizontal RGB subpixel layout. |
Max = 5 | Represents the size of the |
None = 0 | Unknown or unsupported subpixel layout, LCD subpixel antialiasing is disabled. |
Vbgr = 4 | Vertical BGR subpixel layout. |
Vrgb = 3 | Vertical RGB subpixel layout. |
TextServer.FontStyle
| Value | Description |
|---|---|
Bold = 1 | Font is bold. |
FixedWidth = 4 | Font has fixed-width characters (also known as monospace). |
Italic = 2 | Font is italic or oblique. |
TextServer.GraphemeFlag
| Value | Description |
|---|---|
BreakHard = 16 | Grapheme is mandatory break point (e.g. |
BreakSoft = 32 | Grapheme is optional break point (e.g. space). |
Connected = 1024 | Grapheme is connected to the previous grapheme. Breaking line before this grapheme is not safe. |
Elongation = 128 | Grapheme is kashida. |
EmbeddedObject = 4096 | Grapheme is an object replacement character for the embedded object. |
Punctuation = 256 | Grapheme is punctuation character. |
Rtl = 2 | Grapheme is part of right-to-left or bottom-to-top run. |
SafeToInsertTatweel = 2048 | It is safe to insert a U+0640 before this grapheme for elongation. |
SoftHyphen = 8192 | Grapheme is a soft hyphen. |
Space = 8 | Grapheme is whitespace. |
Tab = 64 | Grapheme is the tabulation character. |
Underscore = 512 | Grapheme is underscore character. |
Valid = 1 | Grapheme is supported by the font, and can be drawn. |
Virtual = 4 | Grapheme is not part of source text, it was added by justification process. |
TextServer.Hinting
| Value | Description |
|---|---|
Light = 1 | Use the light font hinting mode. |
None = 0 | Disables font hinting (smoother but less crisp). |
Normal = 2 | Use the default font hinting mode (crisper but less smooth). Note: This hinting mode changes both horizontal and vertical glyph metrics. If applied to monospace font, some glyphs might have different width. |
TextServer.JustificationFlag
| Value | Description |
|---|---|
AfterLastTab = 8 | Only apply justification to the part of the text after the last tab. |
ConstrainEllipsis = 16 | Apply justification to the trimmed line with ellipsis. |
DoNotSkipSingleLine = 128 | Always apply justification to the paragraphs with a single line ( |
Kashida = 1 | Justify text by adding and removing kashidas. |
None = 0 | Do not justify text. |
SkipLastLine = 32 | Do not apply justification to the last line of the paragraph. |
SkipLastLineWithVisibleChars = 64 | Do not apply justification to the last line of the paragraph with visible characters (takes precedence over |
TrimEdgeSpaces = 4 | Remove trailing and leading spaces from the justified text. |
WordBound = 2 | Justify text by changing width of the spaces between the words. |
TextServer.LineBreakFlag
| Value | Description |
|---|---|
Adaptive = 8 | Should be used only in conjunction with |
GraphemeBound = 4 | Break the line between any unconnected graphemes. |
Mandatory = 1 | Break the line at the line mandatory break characters (e.g. |
None = 0 | Do not break the line. |
TrimEdgeSpaces = 16 | Remove edge spaces from the broken line segments. |
TrimEndEdgeSpaces = 128 | Remove spaces and line break characters from the end of broken line segments.
E.g, after line breaking, the first segment of the following text |
TrimIndent = 32 | Subtract first line indentation width from all lines after the first one. |
TrimStartEdgeSpaces = 64 | Remove spaces and line break characters from the start of broken line segments.
E.g, after line breaking, the second segment of the following text |
WordBound = 2 | Break the line between the words. |
TextServer.Orientation
| Value | Description |
|---|---|
Horizontal = 0 | Text is written horizontally. |
Vertical = 1 | Left to right text is written vertically from top to bottom. Right to left text is written vertically from bottom to top. |
TextServer.OverrunBehavior
| Value | Description |
|---|---|
NoTrimming = 0 | No text trimming is performed. |
TrimChar = 1 | Trims the text per character. |
TrimEllipsis = 3 | Trims the text per character and adds an ellipsis to indicate that parts are hidden if trimmed text is 6 characters or longer. |
TrimEllipsisForce = 5 | Trims the text per character and adds an ellipsis to indicate that parts are hidden regardless of trimmed text length. |
TrimWord = 2 | Trims the text per word. |
TrimWordEllipsis = 4 | Trims the text per word and adds an ellipsis to indicate that parts are hidden if trimmed text is 6 characters or longer. |
TrimWordEllipsisForce = 6 | Trims the text per word and adds an ellipsis to indicate that parts are hidden regardless of trimmed text length. |
TextServer.SpacingType
| Value | Description |
|---|---|
Bottom = 3 | Spacing at the bottom of the line. |
Glyph = 0 | Spacing for each glyph. |
Max = 4 | Represents the size of the |
Space = 1 | Spacing for the space character. |
Top = 2 | Spacing at the top of the line. |
TextServer.StructuredTextParser
| Value | Description |
|---|---|
Custom = 6 | User defined structured text BiDi override function. |
Default = 0 | Use default Unicode BiDi algorithm. |
Email = 3 | BiDi override for email. |
ExcludedScript = 5 | |
File = 2 | BiDi override for file path. |
List = 4 | BiDi override for lists. Structured text options: list separator |
Uri = 1 | BiDi override for URI. |
TextServer.SubpixelPositioning
| Value | Description |
|---|---|
Auto = 1 | Glyph horizontal position is rounded based on font size.
|
Disabled = 0 | Glyph horizontal position is rounded to the whole pixel size, each glyph is rasterized once. |
OneHalf = 2 | Glyph horizontal position is rounded to one half of the pixel size, each glyph is rasterized up to two times. |
OneHalfMaxSize = 20 | Maximum font size which will use "one half of the pixel" subpixel positioning in |
OneQuarter = 3 | Glyph horizontal position is rounded to one quarter of the pixel size, each glyph is rasterized up to four times. |
OneQuarterMaxSize = 16 | Maximum font size which will use "one quarter of the pixel" subpixel positioning in |
TextServer.TextOverrunFlag
| Value | Description |
|---|---|
AddEllipsis = 4 | Determines whether an ellipsis should be added at the end of the text. |
EnforceEllipsis = 8 | Determines whether the ellipsis at the end of the text is enforced and may not be hidden. |
JustificationAware = 16 | Accounts for the text being justified before attempting to trim it (see |
NoTrim = 0 | No trimming is performed. |
ShortStringEllipsis = 32 | Determines whether the ellipsis should be added regardless of the string length, otherwise it is added only if the string is 6 characters or longer. |
Trim = 1 | Trims the text when it exceeds the given width. |
TrimWordOnly = 2 | Trims the text per word instead of per grapheme. |
TextServer.VisibleCharactersBehavior
| Value | Description |
|---|---|
CharsAfterShaping = 1 | Displays glyphs that are mapped to the first |
CharsBeforeShaping = 0 | Trims text before the shaping. e.g, increasing |
GlyphsAuto = 2 | Displays |
GlyphsLtr = 3 | Displays |
GlyphsRtl = 4 | Displays |