reckfellENGINE

TextServer

A server interface for font management and text rendering.

On this page
class TextServerReckfellSharpInherits RefCounted

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:

C#
var ts = TextServerManager.GetPrimaryInterface();

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Methods256

CreateFontRid
# CreateFont
C#
public Rid CreateFont();

Creates a new, empty font cache entry resource. To free the resulting resource, use the TextServer.FreeRid method.

Returns Rid
CreateFontLinkedVariationRid
# CreateFontLinkedVariation
C#
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.

Parameters
NameTypeDefault
fontRidRid—
Returns Rid
CreateShapedTextRid
# CreateShapedText
C#
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).

Parameters
NameTypeDefault
directionTextServer.DirectionTextServer.Direction.Auto
orientationTextServer.OrientationTextServer.Orientation.Horizontal
Returns Rid
DrawHexCodeBoxvoid
# DrawHexCodeBox
C#
public void DrawHexCodeBox(Rid canvas, long size, Vector2 pos, long index, Color color);

Draws box displaying character hexadecimal code. Used for replacing missing characters.

Parameters
NameTypeDefault
canvasRid—
sizelong—
posVector2—
indexlong—
colorColor—
FontClearGlyphsvoid
# FontClearGlyphs
C#
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.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
FontClearKerningMapvoid
# FontClearKerningMap
C#
public void FontClearKerningMap(Rid fontRid, long size);

Removes all kerning overrides.

Parameters
NameTypeDefault
fontRidRid—
sizelong—
FontClearSizeCachevoid
# FontClearSizeCache
C#
public void FontClearSizeCache(Rid fontRid);

Removes all font sizes from the cache entry.

Parameters
NameTypeDefault
fontRidRid—
FontClearSystemFallbackCachevoid
# FontClearSystemFallbackCache
C#
public void FontClearSystemFallbackCache();

Frees all automatically loaded system fonts.

FontClearTexturesvoid
# FontClearTextures
C#
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.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
FontDrawGlyph2 overloads
# FontDrawGlyph · 1/2
C#
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.

Parameters
NameTypeDefault
fontRidRid—
canvasRid—
sizelong—
posVector2—
indexlong—
colorColor?—
color

If the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).

# FontDrawGlyph · 2/2
C#
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.

Parameters
NameTypeDefault
fontRidRid—
canvasRid—
sizelong—
posVector2—
indexlong—
colorColor?default
oversamplingfloat0f
color

If the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).

FontDrawGlyphOutline2 overloads
# FontDrawGlyphOutline · 1/2
C#
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.

Parameters
NameTypeDefault
fontRidRid—
canvasRid—
sizelong—
outlineSizelong—
posVector2—
indexlong—
colorColor?—
color

If the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).

# FontDrawGlyphOutline · 2/2
C#
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.

Parameters
NameTypeDefault
fontRidRid—
canvasRid—
sizelong—
outlineSizelong—
posVector2—
indexlong—
colorColor?default
oversamplingfloat0f
color

If the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).

FontGetAntialiasingTextServer.FontAntialiasing
# FontGetAntialiasing
C#
public TextServer.FontAntialiasing FontGetAntialiasing(Rid fontRid);

Returns font anti-aliasing mode.

Parameters
NameTypeDefault
fontRidRid—
Returns TextServer.FontAntialiasing
FontGetAscentdouble
# FontGetAscent
C#
public double FontGetAscent(Rid fontRid, long size);

Returns the font ascent (number of pixels above the baseline).

Parameters
NameTypeDefault
fontRidRid—
sizelong—
Returns double
FontGetBaselineOffsetdouble
# FontGetBaselineOffset
C#
public double FontGetBaselineOffset(Rid fontRid);

Returns extra baseline offset (as a fraction of font height).

Parameters
NameTypeDefault
fontRidRid—
Returns double
FontGetCharFromGlyphIndexlong
# FontGetCharFromGlyphIndex
C#
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.

Parameters
NameTypeDefault
fontRidRid—
sizelong—
glyphIndexlong—
Returns long
FontGetDescentdouble
# FontGetDescent
C#
public double FontGetDescent(Rid fontRid, long size);

Returns the font descent (number of pixels below the baseline).

Parameters
NameTypeDefault
fontRidRid—
sizelong—
Returns double
FontGetDisableEmbeddedBitmapsbool
# FontGetDisableEmbeddedBitmaps
C#
public bool FontGetDisableEmbeddedBitmaps(Rid fontRid);

Returns whether the font's embedded bitmap loading is disabled.

Parameters
NameTypeDefault
fontRidRid—
Returns bool
FontGetEmboldendouble
# FontGetEmbolden
C#
public double FontGetEmbolden(Rid fontRid);

Returns font embolden strength.

Parameters
NameTypeDefault
fontRidRid—
Returns double
FontGetFaceCountlong
# FontGetFaceCount
C#
public long FontGetFaceCount(Rid fontRid);

Returns number of faces in the TrueType / OpenType collection.

Parameters
NameTypeDefault
fontRidRid—
Returns long
FontGetFaceIndexlong
# FontGetFaceIndex
C#
public long FontGetFaceIndex(Rid fontRid);

Returns an active face index in the TrueType / OpenType collection.

Parameters
NameTypeDefault
fontRidRid—
Returns long
FontGetFixedSizelong
# FontGetFixedSize
C#
public long FontGetFixedSize(Rid fontRid);

Returns bitmap font fixed size.

Parameters
NameTypeDefault
fontRidRid—
Returns long
FontGetFixedSizeScaleModeTextServer.FixedSizeScaleMode
# FontGetFixedSizeScaleMode
C#
public TextServer.FixedSizeScaleMode FontGetFixedSizeScaleMode(Rid fontRid);

Returns bitmap font scaling mode.

Parameters
NameTypeDefault
fontRidRid—
Returns TextServer.FixedSizeScaleMode
FontGetGenerateMipmapsbool
# FontGetGenerateMipmaps
C#
public bool FontGetGenerateMipmaps(Rid fontRid);

Returns true if font texture mipmap generation is enabled.

Parameters
NameTypeDefault
fontRidRid—
Returns bool
FontGetGlobalOversamplingdouble · Deprecated
# FontGetGlobalOversampling
C#
public double FontGetGlobalOversampling();

This method does nothing and always returns 1.0.

Returns double
FontGetGlyphAdvanceVector2
# FontGetGlyphAdvance
C#
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.

Parameters
NameTypeDefault
fontRidRid—
sizelong—
glyphlong—
Returns Vector2
FontGetGlyphContoursReckfell.Collections.Dictionary
# FontGetGlyphContours
C#
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.

Parameters
NameTypeDefault
fontRid—
sizelong—
indexlong—
Returns Reckfell.Collections.Dictionary
FontGetGlyphIndexlong
# FontGetGlyphIndex
C#
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.

Parameters
NameTypeDefault
fontRidRid—
sizelong—
charlong—
variationSelectorlong—
Returns long
FontGetGlyphListint[]
# FontGetGlyphList
C#
public int[] FontGetGlyphList(Rid fontRid, Vector2I size);

Returns list of rendered glyphs in the cache entry.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
Returns int[]
FontGetGlyphOffsetVector2
# FontGetGlyphOffset
C#
public Vector2 FontGetGlyphOffset(Rid fontRid, Vector2I size, long glyph);

Returns glyph offset from the baseline.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
glyphlong—
Returns Vector2
FontGetGlyphSizeVector2
# FontGetGlyphSize
C#
public Vector2 FontGetGlyphSize(Rid fontRid, Vector2I size, long glyph);

Returns size of the glyph.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
glyphlong—
Returns Vector2
FontGetGlyphTextureIdxlong
# FontGetGlyphTextureIdx
C#
public long FontGetGlyphTextureIdx(Rid fontRid, Vector2I size, long glyph);

Returns index of the cache texture containing the glyph.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
glyphlong—
Returns long
FontGetGlyphTextureRidRid
# FontGetGlyphTextureRid
C#
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.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
glyphlong—
Returns Rid
FontGetGlyphTextureSizeVector2
# FontGetGlyphTextureSize
C#
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.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
glyphlong—
Returns Vector2
FontGetGlyphUVRectRect2
# FontGetGlyphUVRect
C#
public Rect2 FontGetGlyphUVRect(Rid fontRid, Vector2I size, long glyph);

Returns rectangle in the cache texture containing the glyph.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
glyphlong—
Returns Rect2
FontGetHintingTextServer.Hinting
# FontGetHinting
C#
public TextServer.Hinting FontGetHinting(Rid fontRid);

Returns the font hinting mode. Used by dynamic fonts only.

Parameters
NameTypeDefault
fontRidRid—
Returns TextServer.Hinting
FontGetKeepRoundingRemaindersbool
# FontGetKeepRoundingRemainders
C#
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.

Parameters
NameTypeDefault
fontRidRid—
Returns bool
FontGetKerningVector2
# FontGetKerning
C#
public Vector2 FontGetKerning(Rid fontRid, long size, Vector2I glyphPair);

Returns kerning for the pair of glyphs.

Parameters
NameTypeDefault
fontRidRid—
sizelong—
glyphPairVector2I—
Returns Vector2
FontGetKerningListReckfell.Collections.Array<Vector2I>
# FontGetKerningList
C#
public Reckfell.Collections.Array<Vector2I> FontGetKerningList(Rid fontRid, long size);

Returns list of the kerning overrides.

Parameters
NameTypeDefault
fontRidRid—
sizelong—
Returns Reckfell.Collections.Array<Vector2I>
FontGetLanguageSupportOverridebool
# FontGetLanguageSupportOverride
C#
public bool FontGetLanguageSupportOverride(Rid fontRid, string language);

Returns true if support override is enabled for the language.

Parameters
NameTypeDefault
fontRidRid—
languagestring—
Returns bool
FontGetLanguageSupportOverridesstring[]
# FontGetLanguageSupportOverrides
C#
public string[] FontGetLanguageSupportOverrides(Rid fontRid);

Returns list of language support overrides.

Parameters
NameTypeDefault
fontRidRid—
Returns string[]
FontGetMsdfPixelRangelong
# FontGetMsdfPixelRange
C#
public long FontGetMsdfPixelRange(Rid fontRid);

Returns the width of the range around the shape between the minimum and maximum representable signed distance.

Parameters
NameTypeDefault
fontRidRid—
Returns long
FontGetMsdfSizelong
# FontGetMsdfSize
C#
public long FontGetMsdfSize(Rid fontRid);

Returns source font size used to generate MSDF textures.

Parameters
NameTypeDefault
fontRidRid—
Returns long
FontGetNamestring
# FontGetName
C#
public string FontGetName(Rid fontRid);

Returns font family name.

Parameters
NameTypeDefault
fontRidRid—
Returns string
FontGetOpentypeFeatureOverridesReckfell.Collections.Dictionary
# FontGetOpentypeFeatureOverrides
C#
public Reckfell.Collections.Dictionary FontGetOpentypeFeatureOverrides(Rid fontRid);

Returns font OpenType feature set override.

Parameters
NameTypeDefault
fontRidRid—
Returns Reckfell.Collections.Dictionary
FontGetOtNameStringsReckfell.Collections.Dictionary
# FontGetOtNameStrings
C#
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.).

Parameters
NameTypeDefault
fontRidRid—
Returns Reckfell.Collections.Dictionary
FontGetOversamplingdouble
# FontGetOversampling
C#
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.

Parameters
NameTypeDefault
fontRidRid—
Returns double
FontGetPaletteColorsColor[]
# FontGetPaletteColors
C#
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.

Parameters
NameTypeDefault
fontRidRid—
indexlong—
Returns Color[]
FontGetPaletteCountlong
# FontGetPaletteCount
C#
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.

Parameters
NameTypeDefault
fontRidRid—
Returns long
FontGetPaletteCustomColorsColor[]
# FontGetPaletteCustomColors
C#
public Color[] FontGetPaletteCustomColors(Rid fontRid);

Returns array of custom colors to override predefined palette.

Parameters
NameTypeDefault
fontRidRid—
Returns Color[]
FontGetPaletteNamestring
# FontGetPaletteName
C#
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.

Parameters
NameTypeDefault
fontRidRid—
indexlong—
Returns string
FontGetScaledouble
# FontGetScale
C#
public double FontGetScale(Rid fontRid, long size);

Returns scaling factor of the color bitmap font.

Parameters
NameTypeDefault
fontRidRid—
sizelong—
Returns double
FontGetScriptSupportOverridebool
# FontGetScriptSupportOverride
C#
public bool FontGetScriptSupportOverride(Rid fontRid, string script);

Returns true if support override is enabled for the script.

Parameters
NameTypeDefault
fontRidRid—
scriptstring—
Returns bool
FontGetScriptSupportOverridesstring[]
# FontGetScriptSupportOverrides
C#
public string[] FontGetScriptSupportOverrides(Rid fontRid);

Returns list of script support overrides.

Parameters
NameTypeDefault
fontRidRid—
Returns string[]
FontGetSizeCacheInfoReckfell.Collections.Array<Reckfell.Collections.Dictionary>
# FontGetSizeCacheInfo
C#
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.

Parameters
NameTypeDefault
fontRidRid—
Returns Reckfell.Collections.Array<Reckfell.Collections.Dictionary>
FontGetSizeCacheListReckfell.Collections.Array<Vector2I>
# FontGetSizeCacheList
C#
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.

Parameters
NameTypeDefault
fontRidRid—
Returns Reckfell.Collections.Array<Vector2I>
FontGetSpacinglong
# FontGetSpacing
C#
public long FontGetSpacing(Rid fontRid, TextServer.SpacingType spacing);

Returns the spacing for spacing in pixels (not relative to the font size).

Parameters
NameTypeDefault
fontRidRid—
spacingTextServer.SpacingType—
Returns long
FontGetStretchlong
# FontGetStretch
C#
public long FontGetStretch(Rid fontRid);

Returns font stretch amount, compared to a normal width. A percentage value between 50% and 200%.

Parameters
NameTypeDefault
fontRidRid—
Returns long
FontGetStyleTextServer.FontStyle
# FontGetStyle
C#
public TextServer.FontStyle FontGetStyle(Rid fontRid);

Returns font style flags.

Parameters
NameTypeDefault
fontRidRid—
Returns TextServer.FontStyle
FontGetStyleNamestring
# FontGetStyleName
C#
public string FontGetStyleName(Rid fontRid);

Returns font style name.

Parameters
NameTypeDefault
fontRidRid—
Returns string
FontGetSubpixelPositioningTextServer.SubpixelPositioning
# FontGetSubpixelPositioning
C#
public TextServer.SubpixelPositioning FontGetSubpixelPositioning(Rid fontRid);

Returns font subpixel glyph positioning mode.

Parameters
NameTypeDefault
fontRidRid—
Returns TextServer.SubpixelPositioning
FontGetSupportedCharsstring
# FontGetSupportedChars
C#
public string FontGetSupportedChars(Rid fontRid);

Returns a string containing all the characters available in the font.

Parameters
NameTypeDefault
fontRidRid—
Returns string
FontGetSupportedGlyphsint[]
# FontGetSupportedGlyphs
C#
public int[] FontGetSupportedGlyphs(Rid fontRid);

Returns an array containing all glyph indices in the font.

Parameters
NameTypeDefault
fontRidRid—
Returns int[]
FontGetTextureCountlong
# FontGetTextureCount
C#
public long FontGetTextureCount(Rid fontRid, Vector2I size);

Returns number of textures used by font cache entry.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
Returns long
FontGetTextureImageImage
# FontGetTextureImage
C#
public Image FontGetTextureImage(Rid fontRid, Vector2I size, long textureIndex);

Returns font cache texture image data.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
textureIndexlong—
Returns Image
FontGetTextureOffsetsint[]
# FontGetTextureOffsets
C#
public int[] FontGetTextureOffsets(Rid fontRid, Vector2I size, long textureIndex);

Returns array containing glyph packing data.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
textureIndexlong—
Returns int[]
FontGetTransformTransform2D
# FontGetTransform
C#
public Transform2D FontGetTransform(Rid fontRid);

Returns 2D transform applied to the font outlines.

Parameters
NameTypeDefault
fontRidRid—
Returns Transform2D
FontGetUnderlinePositiondouble
# FontGetUnderlinePosition
C#
public double FontGetUnderlinePosition(Rid fontRid, long size);

Returns pixel offset of the underline below the baseline.

Parameters
NameTypeDefault
fontRidRid—
sizelong—
Returns double
FontGetUnderlineThicknessdouble
# FontGetUnderlineThickness
C#
public double FontGetUnderlineThickness(Rid fontRid, long size);

Returns thickness of the underline in pixels.

Parameters
NameTypeDefault
fontRidRid—
sizelong—
Returns double
FontGetUsedPalettelong
# FontGetUsedPalette
C#
public long FontGetUsedPalette(Rid fontRid);

Returns used palette index.

Parameters
NameTypeDefault
fontRidRid—
Returns long
FontGetVariationCoordinatesReckfell.Collections.Dictionary
# FontGetVariationCoordinates
C#
public Reckfell.Collections.Dictionary FontGetVariationCoordinates(Rid fontRid);

Returns variation coordinates for the specified font cache entry. See TextServer.FontSupportedVariationList for more info.

Parameters
NameTypeDefault
fontRidRid—
Returns Reckfell.Collections.Dictionary
FontGetWeightlong
# FontGetWeight
C#
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.

Parameters
NameTypeDefault
fontRidRid—
Returns long
FontHasCharbool
# FontHasChar
C#
public bool FontHasChar(Rid fontRid, long @char);

Returns true if a Unicode char is available in the font.

Parameters
NameTypeDefault
fontRidRid—
charlong—
Returns bool
FontIsAllowSystemFallbackbool
# FontIsAllowSystemFallback
C#
public bool FontIsAllowSystemFallback(Rid fontRid);

Returns true if system fonts can be automatically used as fallbacks.

Parameters
NameTypeDefault
fontRidRid—
Returns bool
FontIsForceAutohinterbool
# FontIsForceAutohinter
C#
public bool FontIsForceAutohinter(Rid fontRid);

Returns true if auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only.

Parameters
NameTypeDefault
fontRidRid—
Returns bool
FontIsLanguageSupportedbool
# FontIsLanguageSupported
C#
public bool FontIsLanguageSupported(Rid fontRid, string language);

Returns true if the font supports the given language (as a ISO 639 code).

Parameters
NameTypeDefault
fontRidRid—
languagestring—
Returns bool
FontIsModulateColorGlyphsbool
# FontIsModulateColorGlyphs
C#
public bool FontIsModulateColorGlyphs(Rid fontRid);

Returns true if color modulation is applied when drawing the font's colored glyphs.

Parameters
NameTypeDefault
fontRidRid—
Returns bool
FontIsMultichannelSignedDistanceFieldbool
# FontIsMultichannelSignedDistanceField
C#
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.

Parameters
NameTypeDefault
fontRidRid—
Returns bool
FontIsScriptSupportedbool
# FontIsScriptSupported
C#
public bool FontIsScriptSupported(Rid fontRid, string script);

Returns true if the font supports the given script (as a ISO 15924 code).

Parameters
NameTypeDefault
fontRidRid—
scriptstring—
Returns bool
FontRemoveGlyphvoid
# FontRemoveGlyph
C#
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.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
glyphlong—
FontRemoveKerningvoid
# FontRemoveKerning
C#
public void FontRemoveKerning(Rid fontRid, long size, Vector2I glyphPair);

Removes kerning override for the pair of glyphs.

Parameters
NameTypeDefault
fontRidRid—
sizelong—
glyphPairVector2I—
FontRemoveLanguageSupportOverridevoid
# FontRemoveLanguageSupportOverride
C#
public void FontRemoveLanguageSupportOverride(Rid fontRid, string language);

Remove language support override.

Parameters
NameTypeDefault
fontRidRid—
languagestring—
FontRemoveScriptSupportOverridevoid
# FontRemoveScriptSupportOverride
C#
public void FontRemoveScriptSupportOverride(Rid fontRid, string script);

Removes script support override.

Parameters
NameTypeDefault
fontRidRid—
scriptstring—
FontRemoveSizeCachevoid
# FontRemoveSizeCache
C#
public void FontRemoveSizeCache(Rid fontRid, Vector2I size);

Removes specified font size from the cache entry.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
FontRemoveTexturevoid
# FontRemoveTexture
C#
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.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
textureIndexlong—
FontRenderGlyphvoid
# FontRenderGlyph
C#
public void FontRenderGlyph(Rid fontRid, Vector2I size, long index);

Renders specified glyph to the font cache texture.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
indexlong—
FontRenderRangevoid
# FontRenderRange
C#
public void FontRenderRange(Rid fontRid, Vector2I size, long start, long end);

Renders the range of characters to the font cache texture.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
startlong—
endlong—
FontSetAllowSystemFallbackvoid
# FontSetAllowSystemFallback
C#
public void FontSetAllowSystemFallback(Rid fontRid, bool allowSystemFallback);

If set to true, system fonts can be automatically used as fallbacks.

Parameters
NameTypeDefault
fontRidRid—
allowSystemFallbackbool—
FontSetAntialiasingvoid
# FontSetAntialiasing
C#
public void FontSetAntialiasing(Rid fontRid, TextServer.FontAntialiasing antialiasing);

Sets font anti-aliasing mode.

Parameters
NameTypeDefault
fontRidRid—
antialiasingTextServer.FontAntialiasing—
FontSetAscentvoid
# FontSetAscent
C#
public void FontSetAscent(Rid fontRid, long size, double ascent);

Sets the font ascent (number of pixels above the baseline).

Parameters
NameTypeDefault
fontRidRid—
sizelong—
ascentdouble—
FontSetBaselineOffsetvoid
# FontSetBaselineOffset
C#
public void FontSetBaselineOffset(Rid fontRid, double baselineOffset);

Sets extra baseline offset (as a fraction of font height).

Parameters
NameTypeDefault
fontRidRid—
baselineOffsetdouble—
FontSetData2 overloads
# FontSetData · 1/2
C#
public void FontSetData(Rid fontRid, byte[] data);

Sets font source data, e.g contents of the dynamic font source file.

Parameters
NameTypeDefault
fontRidRid—
databyte[]—
# FontSetData · 2/2
C#
public void FontSetData(Rid fontRid, ReadOnlySpan<byte> data);

Sets font source data, e.g contents of the dynamic font source file.

Parameters
NameTypeDefault
fontRidRid—
dataReadOnlySpan<byte>—
FontSetDescentvoid
# FontSetDescent
C#
public void FontSetDescent(Rid fontRid, long size, double descent);

Sets the font descent (number of pixels below the baseline).

Parameters
NameTypeDefault
fontRidRid—
sizelong—
descentdouble—
FontSetDisableEmbeddedBitmapsvoid
# FontSetDisableEmbeddedBitmaps
C#
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).

Parameters
NameTypeDefault
fontRidRid—
disableEmbeddedBitmapsbool—
FontSetEmboldenvoid
# FontSetEmbolden
C#
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.

Parameters
NameTypeDefault
fontRidRid—
strengthdouble—
FontSetFaceIndexvoid
# FontSetFaceIndex
C#
public void FontSetFaceIndex(Rid fontRid, long faceIndex);

Sets an active face index in the TrueType / OpenType collection.

Parameters
NameTypeDefault
fontRidRid—
faceIndexlong—
FontSetFixedSizevoid
# FontSetFixedSize
C#
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.

Parameters
NameTypeDefault
fontRidRid—
fixedSizelong—
FontSetFixedSizeScaleModevoid
# FontSetFixedSizeScaleMode
C#
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.

Parameters
NameTypeDefault
fontRidRid—
fixedSizeScaleModeTextServer.FixedSizeScaleMode—
FontSetForceAutohintervoid
# FontSetForceAutohinter
C#
public void FontSetForceAutohinter(Rid fontRid, bool forceAutohinter);

If set to true auto-hinting is preferred over font built-in hinting.

Parameters
NameTypeDefault
fontRidRid—
forceAutohinterbool—
FontSetGenerateMipmapsvoid
# FontSetGenerateMipmaps
C#
public void FontSetGenerateMipmaps(Rid fontRid, bool generateMipmaps);

If set to true font texture mipmap generation is enabled.

Parameters
NameTypeDefault
fontRidRid—
generateMipmapsbool—
FontSetGlobalOversamplingvoid · Deprecated
# FontSetGlobalOversampling
C#
public void FontSetGlobalOversampling(double oversampling);

This method does nothing.

Parameters
NameTypeDefault
oversamplingdouble—
FontSetGlyphAdvancevoid
# FontSetGlyphAdvance
C#
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.

Parameters
NameTypeDefault
fontRidRid—
sizelong—
glyphlong—
advanceVector2—
FontSetGlyphOffsetvoid
# FontSetGlyphOffset
C#
public void FontSetGlyphOffset(Rid fontRid, Vector2I size, long glyph, Vector2 offset);

Sets glyph offset from the baseline.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
glyphlong—
offsetVector2—
FontSetGlyphSizevoid
# FontSetGlyphSize
C#
public void FontSetGlyphSize(Rid fontRid, Vector2I size, long glyph, Vector2 glSize);

Sets size of the glyph.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
glyphlong—
glSizeVector2—
FontSetGlyphTextureIdxvoid
# FontSetGlyphTextureIdx
C#
public void FontSetGlyphTextureIdx(Rid fontRid, Vector2I size, long glyph, long textureIdx);

Sets index of the cache texture containing the glyph.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
glyphlong—
textureIdxlong—
FontSetGlyphUVRectvoid
# FontSetGlyphUVRect
C#
public void FontSetGlyphUVRect(Rid fontRid, Vector2I size, long glyph, Rect2 uVRect);

Sets rectangle in the cache texture containing the glyph.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
glyphlong—
uVRectRect2—
FontSetHintingvoid
# FontSetHinting
C#
public void FontSetHinting(Rid fontRid, TextServer.Hinting hinting);

Sets font hinting mode. Used by dynamic fonts only.

Parameters
NameTypeDefault
fontRidRid—
hintingTextServer.Hinting—
FontSetKeepRoundingRemaindersvoid
# FontSetKeepRoundingRemainders
C#
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.

Parameters
NameTypeDefault
fontRidRid—
keepRoundingRemaindersbool—
FontSetKerningvoid
# FontSetKerning
C#
public void FontSetKerning(Rid fontRid, long size, Vector2I glyphPair, Vector2 kerning);

Sets kerning for the pair of glyphs.

Parameters
NameTypeDefault
fontRidRid—
sizelong—
glyphPairVector2I—
kerningVector2—
FontSetLanguageSupportOverridevoid
# FontSetLanguageSupportOverride
C#
public void FontSetLanguageSupportOverride(Rid fontRid, string language, bool supported);

Adds override for TextServer.FontIsLanguageSupported.

Parameters
NameTypeDefault
fontRidRid—
languagestring—
supportedbool—
FontSetModulateColorGlyphsvoid
# FontSetModulateColorGlyphs
C#
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.

Parameters
NameTypeDefault
fontRidRid—
modulatebool—
FontSetMsdfPixelRangevoid
# FontSetMsdfPixelRange
C#
public void FontSetMsdfPixelRange(Rid fontRid, long msdfPixelRange);

Sets the width of the range around the shape between the minimum and maximum representable signed distance.

Parameters
NameTypeDefault
fontRidRid—
msdfPixelRangelong—
FontSetMsdfSizevoid
# FontSetMsdfSize
C#
public void FontSetMsdfSize(Rid fontRid, long msdfSize);

Sets source font size used to generate MSDF textures.

Parameters
NameTypeDefault
fontRidRid—
msdfSizelong—
FontSetMultichannelSignedDistanceFieldvoid
# FontSetMultichannelSignedDistanceField
C#
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.

Parameters
NameTypeDefault
fontRidRid—
msdfbool—
FontSetNamevoid
# FontSetName
C#
public void FontSetName(Rid fontRid, string name);

Sets the font family name.

Parameters
NameTypeDefault
fontRidRid—
namestring—
FontSetOpentypeFeatureOverridesvoid
# FontSetOpentypeFeatureOverrides
C#
public void FontSetOpentypeFeatureOverrides(Rid fontRid, Reckfell.Collections.Dictionary overrides);

Sets font OpenType feature set override.

Parameters
NameTypeDefault
fontRidRid—
overridesReckfell.Collections.Dictionary—
FontSetOversamplingvoid
# FontSetOversampling
C#
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.

Parameters
NameTypeDefault
fontRidRid—
oversamplingdouble—
FontSetPaletteCustomColors2 overloads
# FontSetPaletteCustomColors · 1/2
C#
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.

Parameters
NameTypeDefault
fontRidRid—
colorsColor[]—
# FontSetPaletteCustomColors · 2/2
C#
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.

Parameters
NameTypeDefault
fontRidRid—
colorsReadOnlySpan<Color>—
FontSetScalevoid
# FontSetScale
C#
public void FontSetScale(Rid fontRid, long size, double scale);

Sets scaling factor of the color bitmap font.

Parameters
NameTypeDefault
fontRidRid—
sizelong—
scaledouble—
FontSetScriptSupportOverridevoid
# FontSetScriptSupportOverride
C#
public void FontSetScriptSupportOverride(Rid fontRid, string script, bool supported);

Adds override for TextServer.FontIsScriptSupported.

Parameters
NameTypeDefault
fontRidRid—
scriptstring—
supportedbool—
FontSetSpacingvoid
# FontSetSpacing
C#
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).

Parameters
NameTypeDefault
fontRidRid—
spacingTextServer.SpacingType—
valuelong—
FontSetStretchvoid
# FontSetStretch
C#
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.

Parameters
NameTypeDefault
fontRidRid—
weightlong—
FontSetStylevoid
# FontSetStyle
C#
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.

Parameters
NameTypeDefault
fontRidRid—
styleTextServer.FontStyle—
FontSetStyleNamevoid
# FontSetStyleName
C#
public void FontSetStyleName(Rid fontRid, string name);

Sets the font style name.

Parameters
NameTypeDefault
fontRidRid—
namestring—
FontSetSubpixelPositioningvoid
# FontSetSubpixelPositioning
C#
public void FontSetSubpixelPositioning(Rid fontRid, TextServer.SubpixelPositioning subpixelPositioning);

Sets font subpixel glyph positioning mode.

Parameters
NameTypeDefault
fontRidRid—
subpixelPositioningTextServer.SubpixelPositioning—
FontSetTextureImagevoid
# FontSetTextureImage
C#
public void FontSetTextureImage(Rid fontRid, Vector2I size, long textureIndex, Image image);

Sets font cache texture image data.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
textureIndexlong—
imageImage—
FontSetTextureOffsets2 overloads
# FontSetTextureOffsets · 1/2
C#
public void FontSetTextureOffsets(Rid fontRid, Vector2I size, long textureIndex, int[] offset);

Sets array containing glyph packing data.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
textureIndexlong—
offsetint[]—
# FontSetTextureOffsets · 2/2
C#
public void FontSetTextureOffsets(Rid fontRid, Vector2I size, long textureIndex, ReadOnlySpan<int> offset);

Sets array containing glyph packing data.

Parameters
NameTypeDefault
fontRidRid—
sizeVector2I—
textureIndexlong—
offsetReadOnlySpan<int>—
FontSetTransformvoid
# FontSetTransform
C#
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).

Parameters
NameTypeDefault
fontRidRid—
transformTransform2D—
FontSetUnderlinePositionvoid
# FontSetUnderlinePosition
C#
public void FontSetUnderlinePosition(Rid fontRid, long size, double underlinePosition);

Sets pixel offset of the underline below the baseline.

Parameters
NameTypeDefault
fontRidRid—
sizelong—
underlinePositiondouble—
FontSetUnderlineThicknessvoid
# FontSetUnderlineThickness
C#
public void FontSetUnderlineThickness(Rid fontRid, long size, double underlineThickness);

Sets thickness of the underline in pixels.

Parameters
NameTypeDefault
fontRidRid—
sizelong—
underlineThicknessdouble—
FontSetUsedPalettevoid
# FontSetUsedPalette
C#
public void FontSetUsedPalette(Rid fontRid, long index);

Sets used palette index.

Parameters
NameTypeDefault
fontRidRid—
indexlong—
FontSetVariationCoordinatesvoid
# FontSetVariationCoordinates
C#
public void FontSetVariationCoordinates(Rid fontRid, Reckfell.Collections.Dictionary variationCoordinates);

Sets variation coordinates for the specified font cache entry. See TextServer.FontSupportedVariationList for more info.

Parameters
NameTypeDefault
fontRidRid—
variationCoordinatesReckfell.Collections.Dictionary—
FontSetWeightvoid
# FontSetWeight
C#
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.

Parameters
NameTypeDefault
fontRidRid—
weightlong—
FontSupportedFeatureListReckfell.Collections.Dictionary
# FontSupportedFeatureList
C#
public Reckfell.Collections.Dictionary FontSupportedFeatureList(Rid fontRid);

Returns the dictionary of the supported OpenType features.

Parameters
NameTypeDefault
fontRidRid—
Returns Reckfell.Collections.Dictionary
FontSupportedVariationListReckfell.Collections.Dictionary
# FontSupportedVariationList
C#
public Reckfell.Collections.Dictionary FontSupportedVariationList(Rid fontRid);

Returns the dictionary of the supported OpenType variation coordinates.

Parameters
NameTypeDefault
fontRidRid—
Returns Reckfell.Collections.Dictionary
FormatNumberstring · Deprecated
# FormatNumber
C#
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.

Parameters
NameTypeDefault
numberstring—
languagestring""
Returns string
FreeRidvoid
# FreeRid
C#
public void FreeRid(Rid rid);

Frees an object created by this TextServer.

Parameters
NameTypeDefault
ridRid—
GetFeatureslong
# GetFeatures
C#
public long GetFeatures();

Returns text server features, see TextServer.Feature.

Returns long
GetHexCodeBoxSizeVector2
# GetHexCodeBoxSize
C#
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).

Parameters
NameTypeDefault
sizelong—
indexlong—
Returns Vector2
GetNamestring
# GetName
C#
public string GetName();

Returns the name of the server interface.

Returns string
GetShortNamestring
# GetShortName
C#
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).

Returns string
GetSupportDatabyte[]
# GetSupportData
C#
public byte[] GetSupportData();

Returns default TextServer database (e.g. ICU break iterators and dictionaries).

Returns byte[]
GetSupportDataFileNamestring
# GetSupportDataFileName
C#
public string GetSupportDataFileName();

Returns default TextServer database (e.g. ICU break iterators and dictionaries) filename.

Returns string
GetSupportDataInfostring
# GetSupportDataInfo
C#
public string GetSupportDataInfo();

Returns TextServer database (e.g. ICU break iterators and dictionaries) description.

Returns string
Hasbool
# Has
C#
public bool Has(Rid rid);

Returns true if rid is valid resource owned by this text server.

Parameters
NameTypeDefault
ridRid—
Returns bool
HasFeaturebool
# HasFeature
C#
public bool HasFeature(TextServer.Feature feature);

Returns true if the server supports a feature.

Parameters
NameTypeDefault
featureTextServer.Feature—
Returns bool
IsConfusable2 overloads
# IsConfusable · 1/2
C#
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.

Parameters
NameTypeDefault
stringstring—
dictReadOnlySpan<string>—
Returns long
# IsConfusable · 2/2
C#
public 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.

Parameters
NameTypeDefault
stringstring—
dictstring[]—
Returns long
IsLocaleRightToLeftbool
# IsLocaleRightToLeft
C#
public bool IsLocaleRightToLeft(string locale);

Returns true if locale is right-to-left.

Parameters
NameTypeDefault
localestring—
Returns bool
IsLocaleUsingSupportDatabool
# IsLocaleUsingSupportData
C#
public bool IsLocaleUsingSupportData(string locale);

Returns true if the locale requires text server support data for line/word breaking.

Parameters
NameTypeDefault
localestring—
Returns bool
IsValidIdentifierbool
# IsValidIdentifier
C#
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.UnicodeIdentifiers feature 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.
Parameters
NameTypeDefault
stringstring—
Returns bool
IsValidLetterbool
# IsValidLetter
C#
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".

Parameters
NameTypeDefault
unicodeulong—
Returns bool
LoadSupportDatabool
# LoadSupportData
C#
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.

Parameters
NameTypeDefault
fileNamestring—
Returns bool
NameToTaglong
# NameToTag
C#
public long NameToTag(string name);

Converts the given readable name of a feature, variation, script, or language to an OpenType tag.

Parameters
NameTypeDefault
namestring—
Returns long
ParseNumberstring · Deprecated
# ParseNumber
C#
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.

Parameters
NameTypeDefault
numberstring—
languagestring""
Returns string
ParseStructuredTextReckfell.Collections.Array<Vector3I>
# ParseStructuredText
C#
public Reckfell.Collections.Array<Vector3I> ParseStructuredText(TextServer.StructuredTextParser parserType, Reckfell.Collections.Array args, string text);

Default implementation of the BiDi algorithm override function.

Parameters
NameTypeDefault
parserTypeTextServer.StructuredTextParser—
argsReckfell.Collections.Array—
textstring—
Returns Reckfell.Collections.Array<Vector3I>
PercentSignstring · Deprecated
# PercentSign
C#
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.

Parameters
NameTypeDefault
languagestring""
Returns string
SaveSupportDatabool
# SaveSupportData
C#
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.

Parameters
NameTypeDefault
fileNamestring—
Returns bool
ShapedGetRunCountlong
# ShapedGetRunCount
C#
public long ShapedGetRunCount(Rid shaped);

Returns the number of uniform text runs in the buffer.

Parameters
NameTypeDefault
shapedRid—
Returns long
ShapedGetRunDirectionTextServer.Direction
# ShapedGetRunDirection
C#
public TextServer.Direction ShapedGetRunDirection(Rid shaped, long index);

Returns the direction of the index text run (in visual order).

Parameters
NameTypeDefault
shapedRid—
indexlong—
Returns TextServer.Direction
ShapedGetRunFontRidRid
# ShapedGetRunFontRid
C#
public Rid ShapedGetRunFontRid(Rid shaped, long index);

Returns the font RID of the index text run (in visual order).

Parameters
NameTypeDefault
shapedRid—
indexlong—
Returns Rid
ShapedGetRunFontSizeint
# ShapedGetRunFontSize
C#
public int ShapedGetRunFontSize(Rid shaped, long index);

Returns the font size of the index text run (in visual order).

Parameters
NameTypeDefault
shapedRid—
indexlong—
Returns int
ShapedGetRunGlyphRangeVector2I
# ShapedGetRunGlyphRange
C#
public Vector2I ShapedGetRunGlyphRange(Rid shaped, long index);

Returns the glyph range of the index text run (in visual order).

Parameters
NameTypeDefault
shapedRid—
indexlong—
Returns Vector2I
ShapedGetRunLanguagestring
# ShapedGetRunLanguage
C#
public string ShapedGetRunLanguage(Rid shaped, long index);

Returns the language of the index text run (in visual order).

Parameters
NameTypeDefault
shapedRid—
indexlong—
Returns string
ShapedGetRunObjectVariant
# ShapedGetRunObject
C#
public Variant ShapedGetRunObject(Rid shaped, long index);

Returns the embedded object of the index text run (in visual order).

Parameters
NameTypeDefault
shapedRid—
indexlong—
Returns Variant
ShapedGetRunRangeVector2I
# ShapedGetRunRange
C#
public Vector2I ShapedGetRunRange(Rid shaped, long index);

Returns the source text range of the index text run (in visual order).

Parameters
NameTypeDefault
shapedRid—
indexlong—
Returns Vector2I
ShapedGetRunTextstring
# ShapedGetRunText
C#
public string ShapedGetRunText(Rid shaped, long index);

Returns the source text of the index text run (in visual order).

Parameters
NameTypeDefault
shapedRid—
indexlong—
Returns string
ShapedGetSpanCountlong
# ShapedGetSpanCount
C#
public long ShapedGetSpanCount(Rid shaped);

Returns number of text spans added using TextServer.ShapedTextAddString or TextServer.ShapedTextAddObject.

Parameters
NameTypeDefault
shapedRid—
Returns long
ShapedGetSpanEmbeddedObjectVariant
# ShapedGetSpanEmbeddedObject
C#
public Variant ShapedGetSpanEmbeddedObject(Rid shaped, long index);

Returns text embedded object key.

Parameters
NameTypeDefault
shapedRid—
indexlong—
Returns Variant
ShapedGetSpanMetaVariant
# ShapedGetSpanMeta
C#
public Variant ShapedGetSpanMeta(Rid shaped, long index);

Returns text span metadata.

Parameters
NameTypeDefault
shapedRid—
indexlong—
Returns Variant
ShapedGetSpanObjectVariant
# ShapedGetSpanObject
C#
public Variant ShapedGetSpanObject(Rid shaped, long index);

Returns the text span embedded object key.

Parameters
NameTypeDefault
shapedRid—
indexlong—
Returns Variant
ShapedGetSpanTextstring
# ShapedGetSpanText
C#
public string ShapedGetSpanText(Rid shaped, long index);

Returns the text span source text.

Parameters
NameTypeDefault
shapedRid—
indexlong—
Returns string
ShapedGetTextstring
# ShapedGetText
C#
public string ShapedGetText(Rid shaped);

Returns the text buffer source text, including object replacement characters.

Parameters
NameTypeDefault
shapedRid—
Returns string
ShapedSetSpanUpdateFontvoid
# ShapedSetSpanUpdateFont
C#
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.

Parameters
NameTypeDefault
shapedRid—
indexlong—
fontsReckfell.Collections.Array<Rid>—
sizelong—
opentypeFeaturesReckfell.Collections.Dictionarynull
ShapedTextAddObjectbool
# ShapedTextAddObject
C#
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.

Parameters
NameTypeDefault
shapedRid—
keyVariant—
sizeVector2—
inlineAlignInlineAlignmentInlineAlignment.Center
lengthlong1
baselinedouble0d
Returns bool
ShapedTextAddStringbool
# ShapedTextAddString
C#
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.

Parameters
NameTypeDefault
shapedRid—
textstring—
fontsReckfell.Collections.Array<Rid>—
sizelong—
opentypeFeaturesReckfell.Collections.Dictionarynull
languagestring""
metaVariantdefault
Returns bool
ShapedTextClearvoid
# ShapedTextClear
C#
public void ShapedTextClear(Rid rid);

Clears text buffer (removes text and inline objects).

Parameters
NameTypeDefault
ridRid—
ShapedTextClosestCharacterPoslong
# ShapedTextClosestCharacterPos
C#
public long ShapedTextClosestCharacterPos(Rid shaped, long pos);

Returns composite character position closest to the pos.

Parameters
NameTypeDefault
shapedRid—
poslong—
Returns long
ShapedTextDraw2 overloads
# ShapedTextDraw · 1/2
C#
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.

Parameters
NameTypeDefault
shapedRid—
canvasRid—
posVector2—
clipLdouble—
clipRdouble—
colorColor?—
color

If the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).

# ShapedTextDraw · 2/2
C#
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.

Parameters
NameTypeDefault
shapedRid—
canvasRid—
posVector2—
clipLdouble-1d
clipRdouble-1d
colorColor?default
oversamplingfloat0f
color

If the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).

ShapedTextDrawOutline2 overloads
# ShapedTextDrawOutline · 1/2
C#
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.

Parameters
NameTypeDefault
shapedRid—
canvasRid—
posVector2—
clipLdouble—
clipRdouble—
outlineSizelong—
colorColor?—
color

If the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).

# ShapedTextDrawOutline · 2/2
C#
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.

Parameters
NameTypeDefault
shapedRid—
canvasRid—
posVector2—
clipLdouble-1d
clipRdouble-1d
outlineSizelong1
colorColor?default
oversamplingfloat0f
color

If the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).

ShapedTextDuplicateRid
# ShapedTextDuplicate
C#
public Rid ShapedTextDuplicate(Rid rid);

Duplicates shaped text buffer.

Parameters
NameTypeDefault
ridRid—
Returns Rid
ShapedTextFitToWidthdouble
# ShapedTextFitToWidth
C#
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.

Parameters
NameTypeDefault
shapedRid—
widthdouble—
justificationFlagsTextServer.JustificationFlagTextServer.JustificationFlag.Kashida | TextServer.JustificationFlag.WordBound
Returns double
ShapedTextGetAscentdouble
# ShapedTextGetAscent
C#
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.

Parameters
NameTypeDefault
shapedRid—
Returns double
ShapedTextGetCaretsReckfell.Collections.Dictionary
# ShapedTextGetCarets
C#
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.

Parameters
NameTypeDefault
shapedRid—
positionlong—
Returns Reckfell.Collections.Dictionary
ShapedTextGetCharacterBreaksint[]
# ShapedTextGetCharacterBreaks
C#
public int[] ShapedTextGetCharacterBreaks(Rid shaped);

Returns array of the composite character boundaries.

Parameters
NameTypeDefault
shapedRid—
Returns int[]
ShapedTextGetCustomEllipsislong
# ShapedTextGetCustomEllipsis
C#
public long ShapedTextGetCustomEllipsis(Rid shaped);

Returns ellipsis character used for text clipping.

Parameters
NameTypeDefault
shapedRid—
Returns long
ShapedTextGetCustomPunctuationstring
# ShapedTextGetCustomPunctuation
C#
public string ShapedTextGetCustomPunctuation(Rid shaped);

Returns custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.

Parameters
NameTypeDefault
shapedRid—
Returns string
ShapedTextGetDescentdouble
# ShapedTextGetDescent
C#
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.

Parameters
NameTypeDefault
shapedRid—
Returns double
ShapedTextGetDirectionTextServer.Direction
# ShapedTextGetDirection
C#
public TextServer.Direction ShapedTextGetDirection(Rid shaped);

Returns direction of the text.

Parameters
NameTypeDefault
shapedRid—
Returns TextServer.Direction
ShapedTextGetDominantDirectionInRangeTextServer.Direction
# ShapedTextGetDominantDirectionInRange
C#
public TextServer.Direction ShapedTextGetDominantDirectionInRange(Rid shaped, long start, long end);

Returns dominant direction of in the range of text.

Parameters
NameTypeDefault
shapedRid—
startlong—
endlong—
Returns TextServer.Direction
ShapedTextGetEllipsisGlyphCountlong
# ShapedTextGetEllipsisGlyphCount
C#
public long ShapedTextGetEllipsisGlyphCount(Rid shaped);

Returns number of glyphs in the ellipsis.

Parameters
NameTypeDefault
shapedRid—
Returns long
ShapedTextGetEllipsisGlyphsReckfell.Collections.Array<Reckfell.Collections.Dictionary>
# ShapedTextGetEllipsisGlyphs
C#
public Reckfell.Collections.Array<Reckfell.Collections.Dictionary> ShapedTextGetEllipsisGlyphs(Rid shaped);

Returns array of the glyphs in the ellipsis.

Parameters
NameTypeDefault
shapedRid—
Returns Reckfell.Collections.Array<Reckfell.Collections.Dictionary>
ShapedTextGetEllipsisPoslong
# ShapedTextGetEllipsisPos
C#
public long ShapedTextGetEllipsisPos(Rid shaped);

Returns position of the ellipsis.

Parameters
NameTypeDefault
shapedRid—
Returns long
ShapedTextGetGlyphCountlong
# ShapedTextGetGlyphCount
C#
public long ShapedTextGetGlyphCount(Rid shaped);

Returns number of glyphs in the buffer.

Parameters
NameTypeDefault
shapedRid—
Returns long
ShapedTextGetGlyphsReckfell.Collections.Array<Reckfell.Collections.Dictionary>
# ShapedTextGetGlyphs
C#
public Reckfell.Collections.Array<Reckfell.Collections.Dictionary> ShapedTextGetGlyphs(Rid shaped);

Returns an array of glyphs in the visual order.

Parameters
NameTypeDefault
shapedRid—
Returns Reckfell.Collections.Array<Reckfell.Collections.Dictionary>
ShapedTextGetGraphemeBoundsVector2
# ShapedTextGetGraphemeBounds
C#
public Vector2 ShapedTextGetGraphemeBounds(Rid shaped, long pos);

Returns composite character's bounds as offsets from the start of the line.

Parameters
NameTypeDefault
shapedRid—
poslong—
Returns Vector2
ShapedTextGetInferredDirectionTextServer.Direction
# ShapedTextGetInferredDirection
C#
public TextServer.Direction ShapedTextGetInferredDirection(Rid shaped);

Returns direction of the text, inferred by the BiDi algorithm.

Parameters
NameTypeDefault
shapedRid—
Returns TextServer.Direction
ShapedTextGetLineBreaksint[]
# ShapedTextGetLineBreaks
C#
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.

Parameters
NameTypeDefault
shapedRid—
widthdouble—
startlong0
breakFlagsTextServer.LineBreakFlagTextServer.LineBreakFlag.Mandatory | TextServer.LineBreakFlag.WordBound
Returns int[]
ShapedTextGetLineBreaksAdv2 overloads
# ShapedTextGetLineBreaksAdv · 1/2
C#
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.

Parameters
NameTypeDefault
shapedRid—
widthReadOnlySpan<float>—
startlong—
oncebool—
breakFlagsTextServer.LineBreakFlag—
Returns int[]
# ShapedTextGetLineBreaksAdv · 2/2
C#
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.

Parameters
NameTypeDefault
shapedRid—
widthfloat[]—
startlong0
oncebooltrue
breakFlagsTextServer.LineBreakFlagTextServer.LineBreakFlag.Mandatory | TextServer.LineBreakFlag.WordBound
Returns int[]
ShapedTextGetObjectGlyphlong
# ShapedTextGetObjectGlyph
C#
public long ShapedTextGetObjectGlyph(Rid shaped, Variant key);

Returns the glyph index of the inline object.

Parameters
NameTypeDefault
shapedRid—
keyVariant—
Returns long
ShapedTextGetObjectRangeVector2I
# ShapedTextGetObjectRange
C#
public Vector2I ShapedTextGetObjectRange(Rid shaped, Variant key);

Returns the character range of the inline object.

Parameters
NameTypeDefault
shapedRid—
keyVariant—
Returns Vector2I
ShapedTextGetObjectRectRect2
# ShapedTextGetObjectRect
C#
public Rect2 ShapedTextGetObjectRect(Rid shaped, Variant key);

Returns bounding rectangle of the inline object.

Parameters
NameTypeDefault
shapedRid—
keyVariant—
Returns Rect2
ShapedTextGetObjectsReckfell.Collections.Array
# ShapedTextGetObjects
C#
public Reckfell.Collections.Array ShapedTextGetObjects(Rid shaped);

Returns array of inline objects.

Parameters
NameTypeDefault
shapedRid—
Returns Reckfell.Collections.Array
ShapedTextGetOrientationTextServer.Orientation
# ShapedTextGetOrientation
C#
public TextServer.Orientation ShapedTextGetOrientation(Rid shaped);

Returns text orientation.

Parameters
NameTypeDefault
shapedRid—
Returns TextServer.Orientation
ShapedTextGetParentRid
# ShapedTextGetParent
C#
public Rid ShapedTextGetParent(Rid shaped);

Returns the parent buffer from which the substring originates.

Parameters
NameTypeDefault
shapedRid—
Returns Rid
ShapedTextGetPreserveControlbool
# ShapedTextGetPreserveControl
C#
public bool ShapedTextGetPreserveControl(Rid shaped);

Returns true if text buffer is configured to display control characters.

Parameters
NameTypeDefault
shapedRid—
Returns bool
ShapedTextGetPreserveInvalidbool
# ShapedTextGetPreserveInvalid
C#
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.

Parameters
NameTypeDefault
shapedRid—
Returns bool
ShapedTextGetRangeVector2I
# ShapedTextGetRange
C#
public Vector2I ShapedTextGetRange(Rid shaped);

Returns substring buffer character range in the parent buffer.

Parameters
NameTypeDefault
shapedRid—
Returns Vector2I
ShapedTextGetSelectionVector2[]
# ShapedTextGetSelection
C#
public Vector2[] ShapedTextGetSelection(Rid shaped, long start, long end);

Returns selection rectangles for the specified character range.

Parameters
NameTypeDefault
shapedRid—
startlong—
endlong—
Returns Vector2[]
ShapedTextGetSizeVector2
# ShapedTextGetSize
C#
public Vector2 ShapedTextGetSize(Rid shaped);

Returns size of the text.

Parameters
NameTypeDefault
shapedRid—
Returns Vector2
ShapedTextGetSpacinglong
# ShapedTextGetSpacing
C#
public long ShapedTextGetSpacing(Rid shaped, TextServer.SpacingType spacing);

Returns extra spacing added between glyphs or lines in pixels.

Parameters
NameTypeDefault
shapedRid—
spacingTextServer.SpacingType—
Returns long
ShapedTextGetTrimPoslong
# ShapedTextGetTrimPos
C#
public long ShapedTextGetTrimPos(Rid shaped);

Returns the position of the overrun trim.

Parameters
NameTypeDefault
shapedRid—
Returns long
ShapedTextGetUnderlinePositiondouble
# ShapedTextGetUnderlinePosition
C#
public double ShapedTextGetUnderlinePosition(Rid shaped);

Returns pixel offset of the underline below the baseline.

Parameters
NameTypeDefault
shapedRid—
Returns double
ShapedTextGetUnderlineThicknessdouble
# ShapedTextGetUnderlineThickness
C#
public double ShapedTextGetUnderlineThickness(Rid shaped);

Returns thickness of the underline.

Parameters
NameTypeDefault
shapedRid—
Returns double
ShapedTextGetWidthdouble
# ShapedTextGetWidth
C#
public double ShapedTextGetWidth(Rid shaped);

Returns width (for horizontal layout) or height (for vertical) of the text.

Parameters
NameTypeDefault
shapedRid—
Returns double
ShapedTextGetWordBreaks2 overloads
# ShapedTextGetWordBreaks · 1/2
C#
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.

Parameters
NameTypeDefault
shapedRid—
graphemeFlagsTextServer.GraphemeFlag—
Returns int[]
# ShapedTextGetWordBreaks · 2/2
C#
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.

Parameters
NameTypeDefault
shapedRid—
graphemeFlagsTextServer.GraphemeFlagTextServer.GraphemeFlag.Space | TextServer.GraphemeFlag.Punctuation
skipGraphemeFlagsTextServer.GraphemeFlagTextServer.GraphemeFlag.Virtual
Returns int[]
ShapedTextHasObjectbool
# ShapedTextHasObject
C#
public bool ShapedTextHasObject(Rid shaped, Variant key);

Returns true if an object with key is embedded in this shaped text buffer.

Parameters
NameTypeDefault
shapedRid—
keyVariant—
Returns bool
ShapedTextHasVisibleCharsbool
# ShapedTextHasVisibleChars
C#
public bool ShapedTextHasVisibleChars(Rid shaped);

Returns true if text buffer contains any visible characters.

Parameters
NameTypeDefault
shapedRid—
Returns bool
ShapedTextHitTestGraphemelong
# ShapedTextHitTestGrapheme
C#
public long ShapedTextHitTestGrapheme(Rid shaped, double coords);

Returns grapheme index at the specified pixel offset at the baseline, or -1 if none is found.

Parameters
NameTypeDefault
shapedRid—
coordsdouble—
Returns long
ShapedTextHitTestPositionlong
# ShapedTextHitTestPosition
C#
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.

Parameters
NameTypeDefault
shapedRid—
coordsdouble—
Returns long
ShapedTextIsReadybool
# ShapedTextIsReady
C#
public bool ShapedTextIsReady(Rid shaped);

Returns true if buffer is successfully shaped.

Parameters
NameTypeDefault
shapedRid—
Returns bool
ShapedTextNextCharacterPoslong
# ShapedTextNextCharacterPos
C#
public long ShapedTextNextCharacterPos(Rid shaped, long pos);

Returns composite character end position closest to the pos.

Parameters
NameTypeDefault
shapedRid—
poslong—
Returns long
ShapedTextNextGraphemePoslong
# ShapedTextNextGraphemePos
C#
public long ShapedTextNextGraphemePos(Rid shaped, long pos);

Returns grapheme end position closest to the pos.

Parameters
NameTypeDefault
shapedRid—
poslong—
Returns long
ShapedTextOverrunTrimToWidthvoid
# ShapedTextOverrunTrimToWidth
C#
public void ShapedTextOverrunTrimToWidth(Rid shaped, double width = 0d, TextServer.TextOverrunFlag overrunTrimFlags = TextServer.TextOverrunFlag.NoTrim);

Trims text if it exceeds the given width.

Parameters
NameTypeDefault
shapedRid—
widthdouble0d
overrunTrimFlagsTextServer.TextOverrunFlagTextServer.TextOverrunFlag.NoTrim
ShapedTextPrevCharacterPoslong
# ShapedTextPrevCharacterPos
C#
public long ShapedTextPrevCharacterPos(Rid shaped, long pos);

Returns composite character start position closest to the pos.

Parameters
NameTypeDefault
shapedRid—
poslong—
Returns long
ShapedTextPrevGraphemePoslong
# ShapedTextPrevGraphemePos
C#
public long ShapedTextPrevGraphemePos(Rid shaped, long pos);

Returns grapheme start position closest to the pos.

Parameters
NameTypeDefault
shapedRid—
poslong—
Returns long
ShapedTextResizeObjectbool
# ShapedTextResizeObject
C#
public bool ShapedTextResizeObject(Rid shaped, Variant key, Vector2 size, InlineAlignment inlineAlign = InlineAlignment.Center, double baseline = 0d);

Sets new size and alignment of embedded object.

Parameters
NameTypeDefault
shapedRid—
keyVariant—
sizeVector2—
inlineAlignInlineAlignmentInlineAlignment.Center
baselinedouble0d
Returns bool
ShapedTextSetBidiOverridevoid
# ShapedTextSetBidiOverride
C#
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.

Parameters
NameTypeDefault
shapedRid—
overrideReckfell.Collections.Array—
ShapedTextSetCustomEllipsisvoid
# ShapedTextSetCustomEllipsis
C#
public void ShapedTextSetCustomEllipsis(Rid shaped, long @char);

Sets ellipsis character used for text clipping.

Parameters
NameTypeDefault
shapedRid—
charlong—
ShapedTextSetCustomPunctuationvoid
# ShapedTextSetCustomPunctuation
C#
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.

Parameters
NameTypeDefault
shapedRid—
punctstring—
ShapedTextSetDirectionvoid
# ShapedTextSetDirection
C#
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).

Parameters
NameTypeDefault
shapedRid—
directionTextServer.DirectionTextServer.Direction.Auto
ShapedTextSetOrientationvoid
# ShapedTextSetOrientation
C#
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).

Parameters
NameTypeDefault
shapedRid—
orientationTextServer.OrientationTextServer.Orientation.Horizontal
ShapedTextSetPreserveControlvoid
# ShapedTextSetPreserveControl
C#
public void ShapedTextSetPreserveControl(Rid shaped, bool enabled);

If set to true text buffer will display control characters.

Parameters
NameTypeDefault
shapedRid—
enabledbool—
ShapedTextSetPreserveInvalidvoid
# ShapedTextSetPreserveInvalid
C#
public void ShapedTextSetPreserveInvalid(Rid shaped, bool enabled);

If set to true text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed.

Parameters
NameTypeDefault
shapedRid—
enabledbool—
ShapedTextSetSpacingvoid
# ShapedTextSetSpacing
C#
public void ShapedTextSetSpacing(Rid shaped, TextServer.SpacingType spacing, long value);

Sets extra spacing added between glyphs or lines in pixels.

Parameters
NameTypeDefault
shapedRid—
spacingTextServer.SpacingType—
valuelong—
ShapedTextShapebool
# ShapedTextShape
C#
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.

Parameters
NameTypeDefault
shapedRid—
Returns bool
ShapedTextSortLogicalReckfell.Collections.Array<Reckfell.Collections.Dictionary>
# ShapedTextSortLogical
C#
public Reckfell.Collections.Array<Reckfell.Collections.Dictionary> ShapedTextSortLogical(Rid shaped);

Returns text glyphs in the logical order.

Parameters
NameTypeDefault
shapedRid—
Returns Reckfell.Collections.Array<Reckfell.Collections.Dictionary>
ShapedTextSubstrRid
# ShapedTextSubstr
C#
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).

Parameters
NameTypeDefault
shapedRid—
startlong—
lengthlong—
Returns Rid
ShapedTextTabAlign2 overloads
# ShapedTextTabAlign · 1/2
C#
public double ShapedTextTabAlign(Rid shaped, ReadOnlySpan<float> tabStops);

Aligns shaped text to the given tab-stops.

Parameters
NameTypeDefault
shapedRid—
tabStopsReadOnlySpan<float>—
Returns double
# ShapedTextTabAlign · 2/2
C#
public double ShapedTextTabAlign(Rid shaped, float[] tabStops);

Aligns shaped text to the given tab-stops.

Parameters
NameTypeDefault
shapedRid—
tabStopsfloat[]—
Returns double
SpoofCheckbool
# SpoofCheck
C#
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.

Parameters
NameTypeDefault
stringstring—
Returns bool
StringGetCharacterBreaksint[]
# StringGetCharacterBreaks
C#
public int[] StringGetCharacterBreaks(string @string, string language = "");

Returns array of the composite character boundaries.

Parameters
NameTypeDefault
stringstring—
languagestring""
Returns int[]
StringGetWordBreaksint[]
# StringGetWordBreaks
C#
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.

Parameters
NameTypeDefault
stringstring—
languagestring""
charsPerLinelong0
Returns int[]
StringToLowerstring
# StringToLower
C#
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.

Parameters
NameTypeDefault
stringstring—
languagestring""
Returns string
StringToTitlestring
# StringToTitle
C#
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.

Parameters
NameTypeDefault
stringstring—
languagestring""
Returns string
StringToUpperstring
# StringToUpper
C#
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.

Parameters
NameTypeDefault
stringstring—
languagestring""
Returns string
StripDiacriticsstring
# StripDiacritics
C#
public string StripDiacritics(string @string);

Strips diacritics from the string. Note: The result may be longer or shorter than the original.

Parameters
NameTypeDefault
stringstring—
Returns string
TagToNamestring
# TagToName
C#
public string TagToName(long tag);

Converts the given OpenType tag to the readable name of a feature, variation, script, or language.

Parameters
NameTypeDefault
taglong—
Returns string

TextServer.AutowrapMode

ValueDescription
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.AutowrapMode.Word, but force-breaks a word if that single word does not fit in one line.

TextServer.ContourPointTag

ValueDescription
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

ValueDescription
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

ValueDescription
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 TextServer.IsValidIdentifier.

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 TextServer.LoadSupportData.

VerticalLayout = 4

TextServer supports vertical layouts.

TextServer.FixedSizeScaleMode

ValueDescription
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

ValueDescription
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 ProjectSettings.gui/theme/lcd_subpixel_layout setting. LCD subpixel anti-aliasing mode is suitable only for rendering horizontal, unscaled text in 2D.

None = 0

Font glyphs are rasterized as 1-bit bitmaps.

TextServer.FontLcdSubpixelLayout

ValueDescription
Hbgr = 2

Horizontal BGR subpixel layout.

Hrgb = 1

Horizontal RGB subpixel layout.

Max = 5

Represents the size of the TextServer.FontLcdSubpixelLayout enum.

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

ValueDescription
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

ValueDescription
BreakHard = 16

Grapheme is mandatory break point (e.g. "\n").

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

ValueDescription
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

ValueDescription
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 (TextServer.JustificationFlag.SkipLastLine and TextServer.JustificationFlag.SkipLastLineWithVisibleChars are ignored).

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 TextServer.JustificationFlag.SkipLastLine).

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

ValueDescription
Adaptive = 8

Should be used only in conjunction with TextServer.LineBreakFlag.WordBound, break the line between any unconnected graphemes, if it's impossible to break it between the words.

GraphemeBound = 4

Break the line between any unconnected graphemes.

Mandatory = 1

Break the line at the line mandatory break characters (e.g. "\n").

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 test \n next, is test if the flag is set, and test \n if it is not.

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 test \n next, is next if the flag is set, and next if it is not.

WordBound = 2

Break the line between the words.

TextServer.Orientation

ValueDescription
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

ValueDescription
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

ValueDescription
Bottom = 3

Spacing at the bottom of the line.

Glyph = 0

Spacing for each glyph.

Max = 4

Represents the size of the TextServer.SpacingType enum.

Space = 1

Spacing for the space character.

Top = 2

Spacing at the top of the line.

TextServer.StructuredTextParser

ValueDescription
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 string.

Uri = 1

BiDi override for URI.

TextServer.SubpixelPositioning

ValueDescription
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 TextServer.SubpixelPositioning.Auto mode.

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.SubpixelPositioning.Auto mode.

TextServer.TextOverrunFlag

ValueDescription
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 TextServer.JustificationFlag).

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

ValueDescription
CharsAfterShaping = 1

Displays glyphs that are mapped to the first Label.VisibleCharacters or RichTextLabel.VisibleCharacters characters from the beginning of the text.

CharsBeforeShaping = 0

Trims text before the shaping. e.g, increasing Label.VisibleCharacters or RichTextLabel.VisibleCharacters value is visually identical to typing the text. Note: In this mode, trimmed text is not processed at all. It is not accounted for in line breaking and size calculations.

GlyphsAuto = 2

Displays Label.VisibleRatio or RichTextLabel.VisibleRatio glyphs, starting from the left or from the right, depending on Control.LayoutDirection value.

GlyphsLtr = 3

Displays Label.VisibleRatio or RichTextLabel.VisibleRatio glyphs, starting from the left.

GlyphsRtl = 4

Displays Label.VisibleRatio or RichTextLabel.VisibleRatio glyphs, starting from the right.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.