Direction
TextServer.swift:76enum Directionenum Directionimport SwiftGodotFramework to write Godot Game Extensions using the Swift Programming Language.
class TextServerA server interface for font management and text rendering.
case autoText direction is determined based on contents and current locale.
case ltrText is written from left to right.
case rtlText is written from right to left.
case inheritedText writing direction is the same as base string writing direction. Used for BiDi override only.
override class var godotClassName: StringName { get }final func createFont() -> RID Creates a new, empty font cache entry resource. To free the resulting resource, use the freeRid(_:) method.
final func createFontLinkedVariation(fontRid: RID) -> RID Creates a new variation existing font which is reusing the same glyph cache and font data. To free the resulting resource, use the freeRid(_:) method.
final func createShapedText(direction: TextServer.Direction = .auto, orientation: TextServer.Orientation = .horizontal) -> RID Creates a new buffer for complex text layout, with the given direction and orientation. To free the resulting buffer, use freeRid(_:) method.
func demo() Warning: This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their visible property. SwiftGodot
final func drawHexCodeBox(canvas: RID, size: Int, pos: Vector2, index: Int, color: Color) Draws box displaying character hexadecimal code. Used for replacing missing characters.
final func fontClearGlyphs(fontRid: RID, size: Vector2i) Removes all rendered glyph information from the cache entry.
final func fontClearKerningMap(fontRid: RID, size: Int) Removes all kerning overrides.
final func fontClearSizeCache(fontRid: RID) Removes all font sizes from the cache entry.
final func fontClearTextures(fontRid: RID, size: Vector2i) Removes all textures from font cache entry.
final func fontDrawGlyph(fontRid: RID, canvas: RID, size: Int, pos: Vector2, index: Int, color: Color = Color (r: 1, g: 1, b: 1, a: 1)) Draws single glyph into a canvas item at the position, using fontRid at the size size.
final func fontDrawGlyphOutline(fontRid: RID, canvas: RID, size: Int, outlineSize: Int, pos: Vector2, index: Int, color: Color = Color (r: 1, g: 1, b: 1, a: 1)) Draws single glyph outline of size outlineSize into a canvas item at the position, using fontRid at the size size.
final func fontGetAntialiasing(fontRid: RID) -> TextServer.FontAntialiasing Returns font anti-aliasing mode.
final func fontGetAscent(fontRid: RID, size: Int) -> Double Returns the font ascent (number of pixels above the baseline).
final func fontGetBaselineOffset(fontRid: RID) -> Double Returns extra baseline offset (as a fraction of font height).
final func fontGetCharFromGlyphIndex(fontRid: RID, size: Int, glyphIndex: Int) -> Int Returns character code associated with glyphIndex, or 0 if glyphIndex is invalid. See fontGetGlyphIndex(fontRid:size:char:variationSelector:).
final func fontGetDescent(fontRid: RID, size: Int) -> Double Returns the font descent (number of pixels below the baseline).
final func fontGetDisableEmbeddedBitmaps(fontRid: RID) -> Bool Returns whether the font’s embedded bitmap loading is disabled.
final func fontGetEmbolden(fontRid: RID) -> Double Returns font embolden strength.
final func fontGetFaceCount(fontRid: RID) -> Int Returns number of faces in the TrueType / OpenType collection.
final func fontGetFaceIndex(fontRid: RID) -> Int Returns an active face index in the TrueType / OpenType collection.
final func fontGetFixedSize(fontRid: RID) -> Int Returns bitmap font fixed size.
final func fontGetFixedSizeScaleMode(fontRid: RID) -> TextServer.FixedSizeScaleMode Returns bitmap font scaling mode.
final func fontGetGenerateMipmaps(fontRid: RID) -> Bool Returns true if font texture mipmap generation is enabled.
final func fontGetGlobalOversampling() -> Double Returns the font oversampling factor, shared by all fonts in the TextServer.
final func fontGetGlyphAdvance(fontRid: RID, size: Int, glyph: Int) -> Vector2 Returns glyph advance (offset of the next glyph).
final func fontGetGlyphContours(font: RID, size: Int, index: Int) -> GDictionary Returns outline contours of the glyph as a GDictionary with the following contents:
final func fontGetGlyphIndex(fontRid: RID, size: Int, char: Int, variationSelector: Int) -> Int Returns the glyph index of a char, optionally modified by the variationSelector. See fontGetCharFromGlyphIndex(fontRid:size:glyphIndex:).
final func fontGetGlyphList(fontRid: RID, size: Vector2i) -> PackedInt32Array Returns list of rendered glyphs in the cache entry.
final func fontGetGlyphOffset(fontRid: RID, size: Vector2i, glyph: Int) -> Vector2 Returns glyph offset from the baseline.
final func fontGetGlyphSize(fontRid: RID, size: Vector2i, glyph: Int) -> Vector2 Returns size of the glyph.
final func fontGetGlyphTextureIdx(fontRid: RID, size: Vector2i, glyph: Int) -> Int Returns index of the cache texture containing the glyph.
final func fontGetGlyphTextureRid(fontRid: RID, size: Vector2i, glyph: Int) -> RID Returns resource ID of the cache texture containing the glyph.
final func fontGetGlyphTextureSize(fontRid: RID, size: Vector2i, glyph: Int) -> Vector2 Returns size of the cache texture containing the glyph.
final func fontGetGlyphUvRect(fontRid: RID, size: Vector2i, glyph: Int) -> Rect2 Returns rectangle in the cache texture containing the glyph.
final func fontGetHinting(fontRid: RID) -> TextServer.Hinting Returns the font hinting mode. Used by dynamic fonts only.
final func fontGetKerning(fontRid: RID, size: Int, glyphPair: Vector2i) -> Vector2 Returns kerning for the pair of glyphs.
final func fontGetKerningList(fontRid: RID, size: Int) -> VariantCollection<Vector2i> Returns list of the kerning overrides.
final func fontGetLanguageSupportOverride(fontRid: RID, language: String) -> Bool Returns true if support override is enabled for the language.
final func fontGetLanguageSupportOverrides(fontRid: RID) -> PackedStringArray Returns list of language support overrides.
final func fontGetMsdfPixelRange(fontRid: RID) -> Int Returns the width of the range around the shape between the minimum and maximum representable signed distance.
final func fontGetMsdfSize(fontRid: RID) -> Int Returns source font size used to generate MSDF textures.
final func fontGetName(fontRid: RID) -> String Returns font family name.
final func fontGetOpentypeFeatureOverrides(fontRid: RID) -> GDictionary Returns font OpenType feature set override.
final func fontGetOtNameStrings(fontRid: RID) -> GDictionary Returns GDictionary with OpenType font name strings (localized font names, version, description, license information, sample text, etc.).
final func fontGetOversampling(fontRid: RID) -> Double Returns font oversampling factor, if set to 0.0 global oversampling factor is used instead. Used by dynamic fonts only.
final func fontGetScale(fontRid: RID, size: Int) -> Double Returns scaling factor of the color bitmap font.
final func fontGetScriptSupportOverride(fontRid: RID, script: String) -> Bool Returns true if support override is enabled for the script.
final func fontGetScriptSupportOverrides(fontRid: RID) -> PackedStringArray Returns list of script support overrides.
final func fontGetSizeCacheList(fontRid: RID) -> VariantCollection<Vector2i> Returns list of the font sizes in the cache. Each size is Vector2i with font size and outline size.
final func fontGetSpacing(fontRid: RID, spacing: TextServer.SpacingType) -> Int Returns the spacing for spacing (see TextServer.SpacingType) in pixels (not relative to the font size).
final func fontGetStretch(fontRid: RID) -> Int Returns font stretch amount, compared to a normal width. A percentage value between 50% and 200%.
final func fontGetStyle(fontRid: RID) -> TextServer.FontStyle Returns font style flags, see FontStyle.
final func fontGetStyleName(fontRid: RID) -> String Returns font style name.
final func fontGetSubpixelPositioning(fontRid: RID) -> TextServer.SubpixelPositioning Returns font subpixel glyph positioning mode.
final func fontGetSupportedChars(fontRid: RID) -> String Returns a string containing all the characters available in the font.
final func fontGetTextureCount(fontRid: RID, size: Vector2i) -> Int Returns number of textures used by font cache entry.
final func fontGetTextureImage(fontRid: RID, size: Vector2i, textureIndex: Int) -> Image? Returns font cache texture image data.
final func fontGetTextureOffsets(fontRid: RID, size: Vector2i, textureIndex: Int) -> PackedInt32Array Returns array containing glyph packing data.
final func fontGetTransform(fontRid: RID) -> Transform2D Returns 2D transform applied to the font outlines.
final func fontGetUnderlinePosition(fontRid: RID, size: Int) -> Double Returns pixel offset of the underline below the baseline.
final func fontGetUnderlineThickness(fontRid: RID, size: Int) -> Double Returns thickness of the underline in pixels.
final func fontGetVariationCoordinates(fontRid: RID) -> GDictionary Returns variation coordinates for the specified font cache entry. See fontSupportedVariationList(fontRid:) for more info.
final func fontGetWeight(fontRid: RID) -> Int Returns weight (boldness) of the font. A value in the 100...999 range, normal font weight is 400, bold font weight is 700.
final func fontHasChar(fontRid: RID, char: Int) -> Bool Returns true if a Unicode char is available in the font.
final func fontIsAllowSystemFallback(fontRid: RID) -> Bool Returns true if system fonts can be automatically used as fallbacks.
final func fontIsForceAutohinter(fontRid: RID) -> Bool Returns true if auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only.
final func fontIsLanguageSupported(fontRid: RID, language: String) -> Bool Returns true, if font supports given language (ISO 639 code).
final func fontIsMultichannelSignedDistanceField(fontRid: RID) -> Bool Returns true if glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
final func fontIsScriptSupported(fontRid: RID, script: String) -> Bool Returns true, if font supports given script (ISO 15924 code).
final func fontRemoveGlyph(fontRid: RID, size: Vector2i, glyph: Int) Removes specified rendered glyph information from the cache entry.
final func fontRemoveKerning(fontRid: RID, size: Int, glyphPair: Vector2i) Removes kerning override for the pair of glyphs.
final func fontRemoveLanguageSupportOverride(fontRid: RID, language: String) Remove language support override.
final func fontRemoveScriptSupportOverride(fontRid: RID, script: String) Removes script support override.
final func fontRemoveSizeCache(fontRid: RID, size: Vector2i) Removes specified font size from the cache entry.
final func fontRemoveTexture(fontRid: RID, size: Vector2i, textureIndex: Int) Removes specified texture from the cache entry.
final func fontRenderGlyph(fontRid: RID, size: Vector2i, index: Int) Renders specified glyph to the font cache texture.
final func fontRenderRange(fontRid: RID, size: Vector2i, start: Int, end: Int) Renders the range of characters to the font cache texture.
final func fontSetAllowSystemFallback(fontRid: RID, allowSystemFallback: Bool) If set to true, system fonts can be automatically used as fallbacks.
final func fontSetAntialiasing(fontRid: RID, antialiasing: TextServer.FontAntialiasing) Sets font anti-aliasing mode.
final func fontSetAscent(fontRid: RID, size: Int, ascent: Double) Sets the font ascent (number of pixels above the baseline).
final func fontSetBaselineOffset(fontRid: RID, baselineOffset: Double) Sets extra baseline offset (as a fraction of font height).
final func fontSetData(fontRid: RID, data: PackedByteArray) Sets font source data, e.g contents of the dynamic font source file.
final func fontSetDescent(fontRid: RID, size: Int, descent: Double) Sets the font descent (number of pixels below the baseline).
final func fontSetDisableEmbeddedBitmaps(fontRid: RID, disableEmbeddedBitmaps: Bool) If set to true, embedded font bitmap loading is disabled (bitmap-only and color fonts ignore this property).
final func fontSetEmbolden(fontRid: RID, strength: Double) Sets font embolden strength. If strength is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness.
final func fontSetFaceIndex(fontRid: RID, faceIndex: Int) Sets an active face index in the TrueType / OpenType collection.
final func fontSetFixedSize(fontRid: RID, fixedSize: Int) Sets bitmap font fixed size. If set to value greater than zero, same cache entry will be used for all font sizes.
final func fontSetFixedSizeScaleMode(fontRid: RID, fixedSizeScaleMode: TextServer.FixedSizeScaleMode) Sets bitmap font scaling mode. This property is used only if fixed_size is greater than zero.
final func fontSetForceAutohinter(fontRid: RID, forceAutohinter: Bool) If set to true auto-hinting is preferred over font built-in hinting.
final func fontSetGenerateMipmaps(fontRid: RID, generateMipmaps: Bool) If set to true font texture mipmap generation is enabled.
final func fontSetGlobalOversampling(_ oversampling: Double) Sets oversampling factor, shared by all font in the TextServer.
final func fontSetGlyphAdvance(fontRid: RID, size: Int, glyph: Int, advance: Vector2) Sets glyph advance (offset of the next glyph).
final func fontSetGlyphOffset(fontRid: RID, size: Vector2i, glyph: Int, offset: Vector2) Sets glyph offset from the baseline.
final func fontSetGlyphSize(fontRid: RID, size: Vector2i, glyph: Int, glSize: Vector2) Sets size of the glyph.
final func fontSetGlyphTextureIdx(fontRid: RID, size: Vector2i, glyph: Int, textureIdx: Int) Sets index of the cache texture containing the glyph.
final func fontSetGlyphUvRect(fontRid: RID, size: Vector2i, glyph: Int, uvRect: Rect2) Sets rectangle in the cache texture containing the glyph.
final func fontSetHinting(fontRid: RID, hinting: TextServer.Hinting) Sets font hinting mode. Used by dynamic fonts only.
final func fontSetKerning(fontRid: RID, size: Int, glyphPair: Vector2i, kerning: Vector2) Sets kerning for the pair of glyphs.
final func fontSetLanguageSupportOverride(fontRid: RID, language: String, supported: Bool) Adds override for fontIsLanguageSupported(fontRid:language:).
final func fontSetMsdfPixelRange(fontRid: RID, msdfPixelRange: Int) Sets the width of the range around the shape between the minimum and maximum representable signed distance.
final func fontSetMsdfSize(fontRid: RID, msdfSize: Int) Sets source font size used to generate MSDF textures.
final func fontSetMultichannelSignedDistanceField(fontRid: RID, msdf: Bool) 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.
final func fontSetName(fontRid: RID, name: String) Sets the font family name.
final func fontSetOpentypeFeatureOverrides(fontRid: RID, overrides: GDictionary) Sets font OpenType feature set override.
final func fontSetOversampling(fontRid: RID, oversampling: Double) Sets font oversampling factor, if set to 0.0 global oversampling factor is used instead. Used by dynamic fonts only.
final func fontSetScale(fontRid: RID, size: Int, scale: Double) Sets scaling factor of the color bitmap font.
final func fontSetScriptSupportOverride(fontRid: RID, script: String, supported: Bool) Adds override for fontIsScriptSupported(fontRid:script:).
final func fontSetSpacing(fontRid: RID, spacing: TextServer.SpacingType, value: Int) Sets the spacing for spacing (see TextServer.SpacingType) to value in pixels (not relative to the font size).
final func fontSetStretch(fontRid: RID, weight: Int) Sets font stretch amount, compared to a normal width. A percentage value between 50% and 200%.
final func fontSetStyle(fontRid: RID, style: TextServer.FontStyle) Sets the font style flags, see FontStyle.
final func fontSetStyleName(fontRid: RID, name: String) Sets the font style name.
final func fontSetSubpixelPositioning(fontRid: RID, subpixelPositioning: TextServer.SubpixelPositioning) Sets font subpixel glyph positioning mode.
final func fontSetTextureImage(fontRid: RID, size: Vector2i, textureIndex: Int, image: Image?) Sets font cache texture image data.
final func fontSetTextureOffsets(fontRid: RID, size: Vector2i, textureIndex: Int, offset: PackedInt32Array) Sets array containing glyph packing data.
final func fontSetTransform(fontRid: RID, transform: Transform2D) Sets 2D transform, applied to the font outlines, can be used for slanting, flipping, and rotating glyphs.
final func fontSetUnderlinePosition(fontRid: RID, size: Int, underlinePosition: Double) Sets pixel offset of the underline below the baseline.
final func fontSetUnderlineThickness(fontRid: RID, size: Int, underlineThickness: Double) Sets thickness of the underline in pixels.
final func fontSetVariationCoordinates(fontRid: RID, variationCoordinates: GDictionary) Sets variation coordinates for the specified font cache entry. See fontSupportedVariationList(fontRid:) for more info.
final func fontSetWeight(fontRid: RID, weight: Int) Sets weight (boldness) of the font. A value in the 100...999 range, normal font weight is 400, bold font weight is 700.
final func fontSupportedFeatureList(fontRid: RID) -> GDictionary Returns the dictionary of the supported OpenType features.
final func fontSupportedVariationList(fontRid: RID) -> GDictionary Returns the dictionary of the supported OpenType variation coordinates.
final func formatNumber(_ number: String, language: String = "") -> String Converts a number from the Western Arabic (0..9) to the numeral systems used in language.
final func freeRid(_ rid: RID) Frees an object created by this TextServer.
final func getFeatures() -> Int Returns text server features, see Feature.
final func getHexCodeBoxSize(_ size: Int, index: Int) -> Vector2 Returns size of the replacement character (box with character hexadecimal code that is drawn in place of invalid characters).
final func getName() -> String Returns the name of the server interface.
final func getSupportDataFilename() -> String Returns default TextServer database (e.g. ICU break iterators and dictionaries) filename.
final func getSupportDataInfo() -> String Returns TextServer database (e.g. ICU break iterators and dictionaries) description.
final func has(rid: RID) -> Bool Returns true if rid is valid resource owned by this text server.
final func hasFeature(_ feature: TextServer.Feature) -> Bool Returns true if the server supports a feature.
final func isConfusable(string: String, dict: PackedStringArray) -> Int Returns index of the first string in dict which is visually confusable with the string, or -1 if none is found.
final func isLocaleRightToLeft(locale: String) -> Bool Returns true if locale is right-to-left.
final func isValidIdentifier(string: String) -> Bool Returns true if string is a valid identifier.
final func isValidLetter(unicode: UInt) -> Bool Returns true if the given code point is a valid letter, i.e. it belongs to the Unicode category “L”.
final func loadSupportData(filename: String) -> Bool Loads optional TextServer database (e.g. ICU break iterators and dictionaries).
final func nameToTag(name: String) -> Int Converts readable feature, variation, script, or language name to OpenType tag.
final func parseNumber(_ number: String, language: String = "") -> String Converts number from the numeral systems used in language to Western Arabic (0..9).
final func parseStructuredText(parserType: TextServer.StructuredTextParser, args: GArray, text: String) -> VariantCollection<Vector3i> Default implementation of the BiDi algorithm override function. See StructuredTextParser for more info.
final func percentSign(language: String = "") -> String Returns percent sign used in the language.
final func saveSupportData(filename: String) -> Bool Saves optional TextServer database (e.g. ICU break iterators and dictionaries) to the file.
final func shapedGetSpanCount(shaped: RID) -> Int Returns number of text spans added using shapedTextAddString(shaped:text:fonts:size:opentypeFeatures:language:meta:) or shapedTextAddObject(shaped:key:size:inlineAlign:length:baseline:).
final func shapedGetSpanMeta(shaped: RID, index: Int) -> Variant Returns text span metadata.
final func shapedSetSpanUpdateFont(shaped: RID, index: Int, fonts: VariantCollection<RID>, size: Int, opentypeFeatures: GDictionary = GDictionary ()) Changes text span font, font size, and OpenType features, without changing the text.
final func shapedTextAddObject(shaped: RID, key: Variant, size: Vector2, inlineAlign: InlineAlignment = .center, length: Int = 1, baseline: Double = 0.0) -> Bool Adds inline object to the text buffer, key must be unique. In the text, object is represented as length object replacement characters.
final func shapedTextAddString(shaped: RID, text: String, fonts: VariantCollection<RID>, size: Int, opentypeFeatures: GDictionary = GDictionary (), language: String = "", meta: Variant) -> Bool Adds text span and font to draw it to the text buffer.
final func shapedTextClear(rid: RID) Clears text buffer (removes text and inline objects).
final func shapedTextClosestCharacterPos(shaped: RID, pos: Int) -> Int Returns composite character position closest to the pos.
final func shapedTextDraw(shaped: RID, canvas: RID, pos: Vector2, clipL: Double = -1, clipR: Double = -1, color: Color = Color (r: 1, g: 1, b: 1, a: 1)) 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).
final func shapedTextDrawOutline(shaped: RID, canvas: RID, pos: Vector2, clipL: Double = -1, clipR: Double = -1, outlineSize: Int = 1, color: Color = Color (r: 1, g: 1, b: 1, a: 1)) 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).
final func shapedTextFitToWidth(shaped: RID, width: Double, justificationFlags: TextServer.JustificationFlag = [.kashida, .wordBound]) -> Double Adjusts text width to fit to specified width, returns new text width.
final func shapedTextGetAscent(shaped: RID) -> Double Returns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
final func shapedTextGetCarets(shaped: RID, position: Int) -> GDictionary Returns shapes of the carets corresponding to the character offset position in the text. Returned caret shape is 1 pixel wide rectangle.
final func shapedTextGetCharacterBreaks(shaped: RID) -> PackedInt32Array Returns array of the composite character boundaries.
final func shapedTextGetCustomEllipsis(shaped: RID) -> Int Returns ellipsis character used for text clipping.
final func shapedTextGetCustomPunctuation(shaped: RID) -> String Returns custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.
final func shapedTextGetDescent(shaped: RID) -> Double Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
final func shapedTextGetDirection(shaped: RID) -> TextServer.Direction Returns direction of the text.
final func shapedTextGetDominantDirectionInRange(shaped: RID, start: Int, end: Int) -> TextServer.Direction Returns dominant direction of in the range of text.
final func shapedTextGetEllipsisGlyphCount(shaped: RID) -> Int Returns number of glyphs in the ellipsis.
final func shapedTextGetEllipsisGlyphs(shaped: RID) -> VariantCollection<GDictionary> Returns array of the glyphs in the ellipsis.
final func shapedTextGetEllipsisPos(shaped: RID) -> Int Returns position of the ellipsis.
final func shapedTextGetGlyphCount(shaped: RID) -> Int Returns number of glyphs in the buffer.
final func shapedTextGetGlyphs(shaped: RID) -> VariantCollection<GDictionary> Returns an array of glyphs in the visual order.
final func shapedTextGetGraphemeBounds(shaped: RID, pos: Int) -> Vector2 Returns composite character’s bounds as offsets from the start of the line.
final func shapedTextGetInferredDirection(shaped: RID) -> TextServer.Direction Returns direction of the text, inferred by the BiDi algorithm.
final func shapedTextGetLineBreaks(shaped: RID, width: Double, start: Int = 0, breakFlags: TextServer.LineBreakFlag = [.mandatory, .wordBound]) -> PackedInt32Array Breaks text to the lines and returns character ranges for each line.
final func shapedTextGetLineBreaksAdv(shaped: RID, width: PackedFloat32Array, start: Int = 0, once: Bool = true, breakFlags: TextServer.LineBreakFlag = [.mandatory, .wordBound]) -> PackedInt32Array Breaks text to the lines and columns. Returns character ranges for each segment.
final func shapedTextGetObjectGlyph(shaped: RID, key: Variant) -> Int Returns the glyph index of the inline object.
final func shapedTextGetObjectRange(shaped: RID, key: Variant) -> Vector2i Returns the character range of the inline object.
final func shapedTextGetObjectRect(shaped: RID, key: Variant) -> Rect2 Returns bounding rectangle of the inline object.
final func shapedTextGetObjects(shaped: RID) -> GArray Returns array of inline objects.
final func shapedTextGetOrientation(shaped: RID) -> TextServer.Orientation Returns text orientation.
final func shapedTextGetParent(shaped: RID) -> RID Returns the parent buffer from which the substring originates.
final func shapedTextGetPreserveControl(shaped: RID) -> Bool Returns true if text buffer is configured to display control characters.
final func shapedTextGetPreserveInvalid(shaped: RID) -> Bool Returns true if text buffer is configured to display hexadecimal codes in place of invalid characters.
final func shapedTextGetRange(shaped: RID) -> Vector2i Returns substring buffer character range in the parent buffer.
final func shapedTextGetSelection(shaped: RID, start: Int, end: Int) -> PackedVector2Array Returns selection rectangles for the specified character range.
final func shapedTextGetSize(shaped: RID) -> Vector2 Returns size of the text.
final func shapedTextGetSpacing(shaped: RID, spacing: TextServer.SpacingType) -> Int Returns extra spacing added between glyphs or lines in pixels.
final func shapedTextGetTrimPos(shaped: RID) -> Int Returns the position of the overrun trim.
final func shapedTextGetUnderlinePosition(shaped: RID) -> Double Returns pixel offset of the underline below the baseline.
final func shapedTextGetUnderlineThickness(shaped: RID) -> Double Returns thickness of the underline.
final func shapedTextGetWidth(shaped: RID) -> Double Returns width (for horizontal layout) or height (for vertical) of the text.
final func shapedTextGetWordBreaks(shaped: RID, graphemeFlags: TextServer.GraphemeFlag = [.space, .punctuation], skipGraphemeFlags: TextServer.GraphemeFlag = [.virtual]) -> PackedInt32Array Breaks text into words and returns array of character ranges. Use graphemeFlags to set what characters are used for breaking (see GraphemeFlag).
final func shapedTextHasVisibleChars(shaped: RID) -> Bool Returns true if text buffer contains any visible characters.
final func shapedTextHitTestGrapheme(shaped: RID, coords: Double) -> Int Returns grapheme index at the specified pixel offset at the baseline, or -1 if none is found.
final func shapedTextHitTestPosition(shaped: RID, coords: Double) -> Int Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position.
final func shapedTextIsReady(shaped: RID) -> Bool Returns true if buffer is successfully shaped.
final func shapedTextNextCharacterPos(shaped: RID, pos: Int) -> Int Returns composite character end position closest to the pos.
final func shapedTextNextGraphemePos(shaped: RID, pos: Int) -> Int Returns grapheme end position closest to the pos.
final func shapedTextOverrunTrimToWidth(shaped: RID, width: Double = 0, overrunTrimFlags: TextServer.TextOverrunFlag = []) Trims text if it exceeds the given width.
final func shapedTextPrevCharacterPos(shaped: RID, pos: Int) -> Int Returns composite character start position closest to the pos.
final func shapedTextPrevGraphemePos(shaped: RID, pos: Int) -> Int Returns grapheme start position closest to the pos.
final func shapedTextResizeObject(shaped: RID, key: Variant, size: Vector2, inlineAlign: InlineAlignment = .center, baseline: Double = 0.0) -> Bool Sets new size and alignment of embedded object.
final func shapedTextSetBidiOverride(shaped: RID, override: GArray) Overrides BiDi for the structured text.
final func shapedTextSetCustomEllipsis(shaped: RID, char: Int) Sets ellipsis character used for text clipping.
final func shapedTextSetCustomPunctuation(shaped: RID, punct: String) Sets custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.
final func shapedTextSetDirection(shaped: RID, direction: TextServer.Direction = .auto) Sets desired text direction. If set to .auto, direction will be detected based on the buffer contents and current locale.
final func shapedTextSetOrientation(shaped: RID, orientation: TextServer.Orientation = .horizontal) Sets desired text orientation.
final func shapedTextSetPreserveControl(shaped: RID, enabled: Bool) If set to true text buffer will display control characters.
final func shapedTextSetPreserveInvalid(shaped: RID, enabled: Bool) If set to true text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed.
final func shapedTextSetSpacing(shaped: RID, spacing: TextServer.SpacingType, value: Int) Sets extra spacing added between glyphs or lines in pixels.
final func shapedTextShape(shaped: RID) -> Bool Shapes buffer if it’s not shaped. Returns true if the string is shaped successfully.
final func shapedTextSortLogical(shaped: RID) -> VariantCollection<GDictionary> Returns text glyphs in the logical order.
final func shapedTextSubstr(shaped: RID, start: Int, length: Int) -> RID Returns text buffer for the substring of the text in the shaped text buffer (including inline objects).
final func shapedTextTabAlign(shaped: RID, tabStops: PackedFloat32Array) -> Double Aligns shaped text to the given tab-stops.
final func spoofCheck(string: String) -> Bool Returns true if string is likely to be an attempt at confusing the reader.
final func stringGetCharacterBreaks(string: String, language: String = "") -> PackedInt32Array Returns array of the composite character boundaries.
final func stringGetWordBreaks(string: String, language: String = "", charsPerLine: Int = 0) -> PackedInt32Array 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.
final func stringToLower(string: String, language: String = "") -> String Returns the string converted to lowercase.
final func stringToTitle(string: String, language: String = "") -> String Returns the string converted to title case.
final func stringToUpper(string: String, language: String = "") -> String Returns the string converted to uppercase.
final func stripDiacritics(string: String) -> String Strips diacritics from the string.
final func tagToName(tag: Int) -> String Converts OpenType tag to readable feature, variation, script, or language name.
enum AutowrapModeenum ContourPointTagenum Featureenum FixedSizeScaleModeenum FontAntialiasingenum FontLCDSubpixelLayoutstruct FontStylestruct GraphemeFlagenum Hintingstruct JustificationFlagstruct LineBreakFlagenum Orientationenum OverrunBehaviorenum SpacingTypeenum StructuredTextParserenum SubpixelPositioningstruct TextOverrunFlagenum VisibleCharactersBehaviorprotocol CaseIterableA type that provides a collection of all of its values.
protocol CustomDebugStringConvertibleA type with a customized textual representation suitable for debugging purposes.
protocol EquatableA type that can be compared for value equality.
protocol Hashable : EquatableA type that can be hashed into a Hasher to produce an integer hash value.
protocol RawRepresentable<RawValue>A type that can be converted to and from an associated raw value.
init?(rawValue: Int64) var debugDescription: String { get }A textual representation of this instance, suitable for debugging
var hashValue: Int { get }static func != (lhs: Self, rhs: Self) -> Bool Returns a Boolean value indicating whether two values are not equal.
func hash(into hasher: inout Hasher)