TextServerExtension
Base class for custom TextServer
implementations (plugins).
class TextServerExtension
External TextServer
implementations should inherit from this class.
Superclasses
class TextServer
A server interface for font management and text rendering.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
Show implementation details (214)
Hide implementation details
func _cleanup(
) Optional.
func _createFont(
) -> RID Required.
func _createFontLinkedVariation(fontRid: RID
) -> RID Optional, implement if font supports extra spacing or baseline offset.
func _createShapedText(direction: TextServer.Direction, orientation: TextServer.Orientation
) -> RID Required.
func _drawHexCodeBox(canvas: RID, size: Int, pos: Vector2, index: Int, color: Color
) Optional.
func _fontClearGlyphs(fontRid: RID, size: Vector2i
) Required.
func _fontClearKerningMap(fontRid: RID, size: Int
) Optional.
func _fontClearSizeCache(fontRid: RID
) Required.
func _fontClearTextures(fontRid: RID, size: Vector2i
) Required.
func _fontDrawGlyph(fontRid: RID, canvas: RID, size: Int, pos: Vector2, index: Int, color: Color
) Required.
func _fontDrawGlyphOutline(fontRid: RID, canvas: RID, size: Int, outlineSize: Int, pos: Vector2, index: Int, color: Color
) Required.
func _fontGetAntialiasing(fontRid: RID
) -> TextServer.FontAntialiasing Optional.
func _fontGetAscent(fontRid: RID, size: Int
) -> Double Required.
func _fontGetBaselineOffset(fontRid: RID
) -> Double Optional.
func _fontGetCharFromGlyphIndex(fontRid: RID, size: Int, glyphIndex: Int
) -> Int Required.
func _fontGetDescent(fontRid: RID, size: Int
) -> Double Required.
func _fontGetDisableEmbeddedBitmaps(fontRid: RID
) -> Bool Optional.
func _fontGetEmbolden(fontRid: RID
) -> Double Optional.
func _fontGetFaceCount(fontRid: RID
) -> Int Optional.
func _fontGetFaceIndex(fontRid: RID
) -> Int Optional.
func _fontGetFixedSize(fontRid: RID
) -> Int Required.
func _fontGetFixedSizeScaleMode(fontRid: RID
) -> TextServer.FixedSizeScaleMode Required.
func _fontGetGenerateMipmaps(fontRid: RID
) -> Bool Optional.
func _fontGetGlobalOversampling(
) -> Double Optional.
func _fontGetGlyphAdvance(fontRid: RID, size: Int, glyph: Int
) -> Vector2 Required.
func _fontGetGlyphContours(fontRid: RID, size: Int, index: Int
) -> GDictionary Optional.
func _fontGetGlyphIndex(fontRid: RID, size: Int, char: Int, variationSelector: Int
) -> Int Required.
func _fontGetGlyphList(fontRid: RID, size: Vector2i
) -> PackedInt32Array Required.
func _fontGetGlyphOffset(fontRid: RID, size: Vector2i, glyph: Int
) -> Vector2 Required.
func _fontGetGlyphSize(fontRid: RID, size: Vector2i, glyph: Int
) -> Vector2 Required.
func _fontGetGlyphTextureIdx(fontRid: RID, size: Vector2i, glyph: Int
) -> Int Required.
func _fontGetGlyphTextureRid(fontRid: RID, size: Vector2i, glyph: Int
) -> RID Required.
func _fontGetGlyphTextureSize(fontRid: RID, size: Vector2i, glyph: Int
) -> Vector2 Required.
func _fontGetGlyphUvRect(fontRid: RID, size: Vector2i, glyph: Int
) -> Rect2 Required.
func _fontGetHinting(fontRid: RID
) -> TextServer.Hinting Optional.
func _fontGetKerning(fontRid: RID, size: Int, glyphPair: Vector2i
) -> Vector2 Optional.
func _fontGetKerningList(fontRid: RID, size: Int
) -> VariantCollection<Vector2i> Optional.
func _fontGetLanguageSupportOverride(fontRid: RID, language: String
) -> Bool Optional.
func _fontGetLanguageSupportOverrides(fontRid: RID
) -> PackedStringArray Optional.
func _fontGetMsdfPixelRange(fontRid: RID
) -> Int Optional.
func _fontGetMsdfSize(fontRid: RID
) -> Int Optional.
func _fontGetName(fontRid: RID
) -> String Optional.
func _fontGetOpentypeFeatureOverrides(fontRid: RID
) -> GDictionary Optional.
func _fontGetOtNameStrings(fontRid: RID
) -> GDictionary Optional.
func _fontGetOversampling(fontRid: RID
) -> Double Optional.
func _fontGetScale(fontRid: RID, size: Int
) -> Double Required.
func _fontGetScriptSupportOverride(fontRid: RID, script: String
) -> Bool Optional.
func _fontGetScriptSupportOverrides(fontRid: RID
) -> PackedStringArray Optional.
func _fontGetSizeCacheList(fontRid: RID
) -> VariantCollection<Vector2i> Required.
func _fontGetSpacing(fontRid: RID, spacing: TextServer.SpacingType
) -> Int Optional.
func _fontGetStretch(fontRid: RID
) -> Int Optional.
func _fontGetStyle(fontRid: RID
) -> TextServer.FontStyle Optional.
func _fontGetStyleName(fontRid: RID
) -> String Optional.
func _fontGetSubpixelPositioning(fontRid: RID
) -> TextServer.SubpixelPositioning Optional.
func _fontGetSupportedChars(fontRid: RID
) -> String Required.
func _fontGetTextureCount(fontRid: RID, size: Vector2i
) -> Int Required.
func _fontGetTextureImage(fontRid: RID, size: Vector2i, textureIndex: Int
) -> Image? Required.
func _fontGetTextureOffsets(fontRid: RID, size: Vector2i, textureIndex: Int
) -> PackedInt32Array Optional.
func _fontGetTransform(fontRid: RID
) -> Transform2D Optional.
func _fontGetUnderlinePosition(fontRid: RID, size: Int
) -> Double Required.
func _fontGetUnderlineThickness(fontRid: RID, size: Int
) -> Double Required.
func _fontGetVariationCoordinates(fontRid: RID
) -> GDictionary Optional.
func _fontGetWeight(fontRid: RID
) -> Int Optional.
func _fontHasChar(fontRid: RID, char: Int
) -> Bool Required.
func _fontIsAllowSystemFallback(fontRid: RID
) -> Bool Optional.
func _fontIsForceAutohinter(fontRid: RID
) -> Bool Optional.
func _fontIsLanguageSupported(fontRid: RID, language: String
) -> Bool Optional.
func _fontIsMultichannelSignedDistanceField(fontRid: RID
) -> Bool Optional.
func _fontIsScriptSupported(fontRid: RID, script: String
) -> Bool Optional.
func _fontRemoveGlyph(fontRid: RID, size: Vector2i, glyph: Int
) Required.
func _fontRemoveKerning(fontRid: RID, size: Int, glyphPair: Vector2i
) Optional.
func _fontRemoveLanguageSupportOverride(fontRid: RID, language: String
) Optional.
func _fontRemoveScriptSupportOverride(fontRid: RID, script: String
) Optional.
func _fontRemoveSizeCache(fontRid: RID, size: Vector2i
) Required.
func _fontRemoveTexture(fontRid: RID, size: Vector2i, textureIndex: Int
) Required.
func _fontRenderGlyph(fontRid: RID, size: Vector2i, index: Int
) Optional.
func _fontRenderRange(fontRid: RID, size: Vector2i, start: Int, end: Int
) Optional.
func _fontSetAllowSystemFallback(fontRid: RID, allowSystemFallback: Bool
) Optional.
func _fontSetAntialiasing(fontRid: RID, antialiasing: TextServer.FontAntialiasing
) Optional.
func _fontSetAscent(fontRid: RID, size: Int, ascent: Double
) Required.
func _fontSetBaselineOffset(fontRid: RID, baselineOffset: Double
) Optional.
func _fontSetData(fontRid: RID, data: PackedByteArray
) Optional.
func _fontSetDescent(fontRid: RID, size: Int, descent: Double
) Required.
func _fontSetDisableEmbeddedBitmaps(fontRid: RID, disableEmbeddedBitmaps: Bool
) Optional.
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.func _fontSetFaceIndex(fontRid: RID, faceIndex: Int
) Optional.
func _fontSetFixedSize(fontRid: RID, fixedSize: Int
) Required.
func _fontSetFixedSizeScaleMode(fontRid: RID, fixedSizeScaleMode: TextServer.FixedSizeScaleMode
) Required.
func _fontSetForceAutohinter(fontRid: RID, forceAutohinter: Bool
) Optional.
func _fontSetGenerateMipmaps(fontRid: RID, generateMipmaps: Bool
) Optional.
func _fontSetGlobalOversampling(Double
) Optional.
func _fontSetGlyphAdvance(fontRid: RID, size: Int, glyph: Int, advance: Vector2
) Required.
func _fontSetGlyphOffset(fontRid: RID, size: Vector2i, glyph: Int, offset: Vector2
) Required.
func _fontSetGlyphSize(fontRid: RID, size: Vector2i, glyph: Int, glSize: Vector2
) Required.
func _fontSetGlyphTextureIdx(fontRid: RID, size: Vector2i, glyph: Int, textureIdx: Int
) Required.
func _fontSetGlyphUvRect(fontRid: RID, size: Vector2i, glyph: Int, uvRect: Rect2
) Required.
func _fontSetHinting(fontRid: RID, hinting: TextServer.Hinting
) Optional.
func _fontSetKerning(fontRid: RID, size: Int, glyphPair: Vector2i, kerning: Vector2
) Optional.
func _fontSetLanguageSupportOverride(fontRid: RID, language: String, supported: Bool
) Optional.
func _fontSetMsdfPixelRange(fontRid: RID, msdfPixelRange: Int
) Optional.
func _fontSetMsdfSize(fontRid: RID, msdfSize: Int
) Optional.
func _fontSetMultichannelSignedDistanceField(fontRid: RID, msdf: Bool
) Optional.
func _fontSetName(fontRid: RID, name: String
) Optional.
func _fontSetOpentypeFeatureOverrides(fontRid: RID, overrides: GDictionary
) Optional.
func _fontSetOversampling(fontRid: RID, oversampling: Double
) Optional.
func _fontSetScale(fontRid: RID, size: Int, scale: Double
) Required.
func _fontSetScriptSupportOverride(fontRid: RID, script: String, supported: Bool
) Optional.
func _fontSetSpacing(fontRid: RID, spacing: TextServer.SpacingType, value: Int
) Optional.
func _fontSetStretch(fontRid: RID, stretch: Int
) Optional.
func _fontSetStyle(fontRid: RID, style: TextServer.FontStyle
) Optional.
func _fontSetStyleName(fontRid: RID, nameStyle: String
) Optional.
func _fontSetSubpixelPositioning(fontRid: RID, subpixelPositioning: TextServer.SubpixelPositioning
) Optional.
func _fontSetTextureImage(fontRid: RID, size: Vector2i, textureIndex: Int, image: Image?
) Required.
func _fontSetTextureOffsets(fontRid: RID, size: Vector2i, textureIndex: Int, offset: PackedInt32Array
) Optional.
func _fontSetTransform(fontRid: RID, transform: Transform2D
) Optional.
func _fontSetUnderlinePosition(fontRid: RID, size: Int, underlinePosition: Double
) Required.
func _fontSetUnderlineThickness(fontRid: RID, size: Int, underlineThickness: Double
) Required.
func _fontSetVariationCoordinates(fontRid: RID, variationCoordinates: GDictionary
) Optional.
func _fontSetWeight(fontRid: RID, weight: Int
) Optional.
func _fontSupportedFeatureList(fontRid: RID
) -> GDictionary Optional.
func _fontSupportedVariationList(fontRid: RID
) -> GDictionary Optional.
func _formatNumber(String, language: String
) -> String Optional.
func _freeRid(RID
) Required.
func _getFeatures(
) -> Int Required.
func _getHexCodeBoxSize(Int, index: Int
) -> Vector2 Optional.
func _getName(
) -> String Required.
func _getSupportDataFilename(
) -> String Optional.
func _getSupportDataInfo(
) -> String Optional.
func _has(rid: RID
) -> Bool Required.
func _hasFeature(TextServer.Feature
) -> Bool Required.
func _isConfusable(string: String, dict: PackedStringArray
) -> Int Optional.
func _isLocaleRightToLeft(locale: String
) -> Bool Required.
func _isValidIdentifier(string: String
) -> Bool Optional.
func _isValidLetter(unicode: UInt
) -> Bool func _loadSupportData(filename: String
) -> Bool Optional.
func _nameToTag(name: String
) -> Int Optional.
func _parseNumber(String, language: String
) -> String Optional.
func _parseStructuredText(parserType: TextServer.StructuredTextParser, args: GArray, text: String
) -> VariantCollection<Vector3i> Optional.
func _percentSign(language: String
) -> String Optional.
func _saveSupportData(filename: String
) -> Bool Optional.
func _shapedGetSpanCount(shaped: RID
) -> Int Required.
func _shapedGetSpanMeta(shaped: RID, index: Int
) -> Variant Required.
func _shapedSetSpanUpdateFont(shaped: RID, index: Int, fonts: VariantCollection<RID>, size: Int, opentypeFeatures: GDictionary
) Required.
func _shapedTextAddObject(shaped: RID, key: Variant, size: Vector2, inlineAlign: InlineAlignment, length: Int, baseline: Double
) -> Bool Required.
func _shapedTextAddString(shaped: RID, text: String, fonts: VariantCollection<RID>, size: Int, opentypeFeatures: GDictionary, language: String, meta: Variant
) -> Bool Required.
func _shapedTextClear(shaped: RID
) Required.
func _shapedTextClosestCharacterPos(shaped: RID, pos: Int
) -> Int Optional.
func _shapedTextDraw(shaped: RID, canvas: RID, pos: Vector2, clipL: Double, clipR: Double, color: Color
) Optional.
func _shapedTextDrawOutline(shaped: RID, canvas: RID, pos: Vector2, clipL: Double, clipR: Double, outlineSize: Int, color: Color
) Optional.
func _shapedTextFitToWidth(shaped: RID, width: Double, justificationFlags: TextServer.JustificationFlag
) -> Double Optional.
func _shapedTextGetAscent(shaped: RID
) -> Double Required.
func _shapedTextGetCharacterBreaks(shaped: RID
) -> PackedInt32Array Optional.
func _shapedTextGetCustomEllipsis(shaped: RID
) -> Int Optional.
func _shapedTextGetCustomPunctuation(shaped: RID
) -> String Optional.
func _shapedTextGetDescent(shaped: RID
) -> Double Required.
func _shapedTextGetDirection(shaped: RID
) -> TextServer.Direction Optional.
func _shapedTextGetDominantDirectionInRange(shaped: RID, start: Int, end: Int
) -> Int Optional.
func _shapedTextGetEllipsisGlyphCount(shaped: RID
) -> Int Required.
func _shapedTextGetEllipsisGlyphs(shaped: RID
) -> OpaquePointer? Required.
func _shapedTextGetEllipsisPos(shaped: RID
) -> Int Required.
func _shapedTextGetGlyphCount(shaped: RID
) -> Int Required.
func _shapedTextGetGlyphs(shaped: RID
) -> OpaquePointer? Required.
func _shapedTextGetGraphemeBounds(shaped: RID, pos: Int
) -> Vector2 Optional.
func _shapedTextGetInferredDirection(shaped: RID
) -> TextServer.Direction Optional.
func _shapedTextGetLineBreaks(shaped: RID, width: Double, start: Int, breakFlags: TextServer.LineBreakFlag
) -> PackedInt32Array Optional.
func _shapedTextGetLineBreaksAdv(shaped: RID, width: PackedFloat32Array, start: Int, once: Bool, breakFlags: TextServer.LineBreakFlag
) -> PackedInt32Array Optional.
func _shapedTextGetObjectGlyph(shaped: RID, key: Variant
) -> Int Required.
func _shapedTextGetObjectRange(shaped: RID, key: Variant
) -> Vector2i Required.
func _shapedTextGetObjectRect(shaped: RID, key: Variant
) -> Rect2 Required.
func _shapedTextGetObjects(shaped: RID
) -> GArray Required.
func _shapedTextGetOrientation(shaped: RID
) -> TextServer.Orientation Optional.
func _shapedTextGetParent(shaped: RID
) -> RID Required.
func _shapedTextGetPreserveControl(shaped: RID
) -> Bool Optional.
func _shapedTextGetPreserveInvalid(shaped: RID
) -> Bool Optional.
func _shapedTextGetRange(shaped: RID
) -> Vector2i Required.
func _shapedTextGetSelection(shaped: RID, start: Int, end: Int
) -> PackedVector2Array Optional.
func _shapedTextGetSize(shaped: RID
) -> Vector2 Required.
func _shapedTextGetSpacing(shaped: RID, spacing: TextServer.SpacingType
) -> Int Optional.
func _shapedTextGetTrimPos(shaped: RID
) -> Int Required.
func _shapedTextGetUnderlinePosition(shaped: RID
) -> Double Required.
func _shapedTextGetUnderlineThickness(shaped: RID
) -> Double Required.
func _shapedTextGetWidth(shaped: RID
) -> Double Required.
func _shapedTextGetWordBreaks(shaped: RID, graphemeFlags: TextServer.GraphemeFlag, skipGraphemeFlags: TextServer.GraphemeFlag
) -> PackedInt32Array Optional.
func _shapedTextHitTestGrapheme(shaped: RID, coord: Double
) -> Int Optional.
func _shapedTextHitTestPosition(shaped: RID, coord: Double
) -> Int Optional.
func _shapedTextIsReady(shaped: RID
) -> Bool Required.
func _shapedTextNextCharacterPos(shaped: RID, pos: Int
) -> Int Optional.
func _shapedTextNextGraphemePos(shaped: RID, pos: Int
) -> Int Optional.
func _shapedTextOverrunTrimToWidth(shaped: RID, width: Double, trimFlags: TextServer.TextOverrunFlag
) Optional.
func _shapedTextPrevCharacterPos(shaped: RID, pos: Int
) -> Int Optional.
func _shapedTextPrevGraphemePos(shaped: RID, pos: Int
) -> Int Optional.
func _shapedTextResizeObject(shaped: RID, key: Variant, size: Vector2, inlineAlign: InlineAlignment, baseline: Double
) -> Bool Required.
func _shapedTextSetBidiOverride(shaped: RID, override: GArray
) Optional.
func _shapedTextSetCustomEllipsis(shaped: RID, char: Int
) Optional.
func _shapedTextSetCustomPunctuation(shaped: RID, punct: String
) Optional.
func _shapedTextSetDirection(shaped: RID, direction: TextServer.Direction
) Optional.
func _shapedTextSetOrientation(shaped: RID, orientation: TextServer.Orientation
) Optional.
func _shapedTextSetPreserveControl(shaped: RID, enabled: Bool
) Optional.
func _shapedTextSetPreserveInvalid(shaped: RID, enabled: Bool
) Optional.
func _shapedTextSetSpacing(shaped: RID, spacing: TextServer.SpacingType, value: Int
) Optional.
func _shapedTextShape(shaped: RID
) -> Bool Required.
func _shapedTextSortLogical(shaped: RID
) -> OpaquePointer? Required.
func _shapedTextSubstr(shaped: RID, start: Int, length: Int
) -> RID Required.
func _shapedTextTabAlign(shaped: RID, tabStops: PackedFloat32Array
) -> Double Optional.
func _shapedTextUpdateBreaks(shaped: RID
) -> Bool Optional.
func _shapedTextUpdateJustificationOps(shaped: RID
) -> Bool Optional.
func _spoofCheck(string: String
) -> Bool Optional.
func _stringGetCharacterBreaks(string: String, language: String
) -> PackedInt32Array Optional.
func _stringGetWordBreaks(string: String, language: String, charsPerLine: Int
) -> PackedInt32Array Optional.
func _stringToLower(string: String, language: String
) -> String Optional.
func _stringToTitle(string: String, language: String
) -> String Optional.
func _stringToUpper(string: String, language: String
) -> String Optional.
func _stripDiacritics(string: String
) -> String Optional.
func _tagToName(tag: Int
) -> String Optional.
Subclasses
class TextServerAdvanced
An advanced text server with support for BiDi, complex text layout, and contextual OpenType features. Used in Godot by default.
class TextServerDummy
A dummy text server that can’t render text or manage fonts.