Enumerationmigueldeicaza.swiftgodot 0.46.0SwiftGodot
Hinting
TextServer.swift:348enum Hinting
Cases
case none
Disables font hinting (smoother but less crisp).
case light
Use the light font hinting mode.
case normal
Use the default font hinting mode (crisper but less smooth).
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (233) members.
Types
enum AutowrapMode
enum ContourPointTag
enum Direction
enum Feature
enum FixedSizeScaleMode
enum FontAntialiasing
enum FontLCDSubpixelLayout
struct FontStyle
struct GraphemeFlag
struct JustificationFlag
struct LineBreakFlag
enum Orientation
enum OverrunBehavior
enum SpacingType
enum StructuredTextParser
enum SubpixelPositioning
struct TextOverrunFlag
enum VisibleCharactersBehavior
Type members
Instance members
func createFont(
) -> RID Creates a new, empty font cache entry resource. To free the resulting resource, use the
freeRid(_:)
method.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.func createShapedText(direction: TextServer.Direction, orientation: TextServer.Orientation
) -> RID Creates a new buffer for complex text layout, with the given
direction
andorientation
. To free the resulting buffer, usefreeRid(_:)
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
func drawHexCodeBox(canvas: RID, size: Int, pos: Vector2, index: Int, color: Color
) Draws box displaying character hexadecimal code. Used for replacing missing characters.
func fontClearGlyphs(fontRid: RID, size: Vector2i
) Removes all rendered glyph information from the cache entry.
func fontClearKerningMap(fontRid: RID, size: Int
) Removes all kerning overrides.
func fontClearSizeCache(fontRid: RID
) Removes all font sizes from the cache entry.
func fontClearTextures(fontRid: RID, size: Vector2i
) Removes all textures from font cache entry.
func fontDrawGlyph(fontRid: RID, canvas: RID, size: Int, pos: Vector2, index: Int, color: Color
) Draws single glyph into a canvas item at the position, using
fontRid
at the sizesize
.func fontDrawGlyphOutline(fontRid: RID, canvas: RID, size: Int, outlineSize: Int, pos: Vector2, index: Int, color: Color
) Draws single glyph outline of size
outlineSize
into a canvas item at the position, usingfontRid
at the sizesize
.func fontGetAntialiasing(fontRid: RID
) -> TextServer.FontAntialiasing Returns font anti-aliasing mode.
func fontGetAscent(fontRid: RID, size: Int
) -> Double Returns the font ascent (number of pixels above the baseline).
func fontGetBaselineOffset(fontRid: RID
) -> Double Returns extra baseline offset (as a fraction of font height).
func fontGetCharFromGlyphIndex(fontRid: RID, size: Int, glyphIndex: Int
) -> Int Returns character code associated with
glyphIndex
, or0
ifglyphIndex
is invalid. SeefontGetGlyphIndex(fontRid:size:char:variationSelector:)
.func fontGetDescent(fontRid: RID, size: Int
) -> Double Returns the font descent (number of pixels below the baseline).
func fontGetDisableEmbeddedBitmaps(fontRid: RID
) -> Bool Returns whether the font’s embedded bitmap loading is disabled.
func fontGetEmbolden(fontRid: RID
) -> Double Returns font embolden strength.
func fontGetFaceCount(fontRid: RID
) -> Int Returns number of faces in the TrueType / OpenType collection.
func fontGetFaceIndex(fontRid: RID
) -> Int Returns an active face index in the TrueType / OpenType collection.
func fontGetFixedSize(fontRid: RID
) -> Int Returns bitmap font fixed size.
func fontGetFixedSizeScaleMode(fontRid: RID
) -> TextServer.FixedSizeScaleMode Returns bitmap font scaling mode.
func fontGetGenerateMipmaps(fontRid: RID
) -> Bool Returns
true
if font texture mipmap generation is enabled.func fontGetGlobalOversampling(
) -> Double Returns the font oversampling factor, shared by all fonts in the TextServer.
func fontGetGlyphAdvance(fontRid: RID, size: Int, glyph: Int
) -> Vector2 Returns glyph advance (offset of the next glyph).
func fontGetGlyphContours(font: RID, size: Int, index: Int
) -> GDictionary Returns outline contours of the glyph as a
GDictionary
with the following contents:func fontGetGlyphIndex(fontRid: RID, size: Int, char: Int, variationSelector: Int
) -> Int Returns the glyph index of a
char
, optionally modified by thevariationSelector
. SeefontGetCharFromGlyphIndex(fontRid:size:glyphIndex:)
.func fontGetGlyphList(fontRid: RID, size: Vector2i
) -> PackedInt32Array Returns list of rendered glyphs in the cache entry.
func fontGetGlyphOffset(fontRid: RID, size: Vector2i, glyph: Int
) -> Vector2 Returns glyph offset from the baseline.
func fontGetGlyphSize(fontRid: RID, size: Vector2i, glyph: Int
) -> Vector2 Returns size of the glyph.
func fontGetGlyphTextureIdx(fontRid: RID, size: Vector2i, glyph: Int
) -> Int Returns index of the cache texture containing the glyph.
func fontGetGlyphTextureRid(fontRid: RID, size: Vector2i, glyph: Int
) -> RID Returns resource ID of the cache texture containing the glyph.
func fontGetGlyphTextureSize(fontRid: RID, size: Vector2i, glyph: Int
) -> Vector2 Returns size of the cache texture containing the glyph.
func fontGetGlyphUvRect(fontRid: RID, size: Vector2i, glyph: Int
) -> Rect2 Returns rectangle in the cache texture containing the glyph.
func fontGetHinting(fontRid: RID
) -> TextServer.Hinting Returns the font hinting mode. Used by dynamic fonts only.
func fontGetKerning(fontRid: RID, size: Int, glyphPair: Vector2i
) -> Vector2 Returns kerning for the pair of glyphs.
func fontGetKerningList(fontRid: RID, size: Int
) -> VariantCollection<Vector2i> Returns list of the kerning overrides.
func fontGetLanguageSupportOverride(fontRid: RID, language: String
) -> Bool Returns
true
if support override is enabled for thelanguage
.func fontGetLanguageSupportOverrides(fontRid: RID
) -> PackedStringArray Returns list of language support overrides.
func fontGetMsdfPixelRange(fontRid: RID
) -> Int Returns the width of the range around the shape between the minimum and maximum representable signed distance.
func fontGetMsdfSize(fontRid: RID
) -> Int Returns source font size used to generate MSDF textures.
func fontGetName(fontRid: RID
) -> String Returns font family name.
func fontGetOpentypeFeatureOverrides(fontRid: RID
) -> GDictionary Returns font OpenType feature set override.
func fontGetOtNameStrings(fontRid: RID
) -> GDictionary Returns
GDictionary
with OpenType font name strings (localized font names, version, description, license information, sample text, etc.).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.func fontGetScale(fontRid: RID, size: Int
) -> Double Returns scaling factor of the color bitmap font.
func fontGetScriptSupportOverride(fontRid: RID, script: String
) -> Bool Returns
true
if support override is enabled for thescript
.func fontGetScriptSupportOverrides(fontRid: RID
) -> PackedStringArray Returns list of script support overrides.
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.func fontGetSpacing(fontRid: RID, spacing: TextServer.SpacingType
) -> Int Returns the spacing for
spacing
(seeTextServer.SpacingType
) in pixels (not relative to the font size).func fontGetStretch(fontRid: RID
) -> Int Returns font stretch amount, compared to a normal width. A percentage value between
50%
and200%
.func fontGetStyle(fontRid: RID
) -> TextServer.FontStyle Returns font style flags, see
FontStyle
.func fontGetStyleName(fontRid: RID
) -> String Returns font style name.
func fontGetSubpixelPositioning(fontRid: RID
) -> TextServer.SubpixelPositioning Returns font subpixel glyph positioning mode.
func fontGetSupportedChars(fontRid: RID
) -> String Returns a string containing all the characters available in the font.
func fontGetTextureCount(fontRid: RID, size: Vector2i
) -> Int Returns number of textures used by font cache entry.
func fontGetTextureImage(fontRid: RID, size: Vector2i, textureIndex: Int
) -> Image? Returns font cache texture image data.
func fontGetTextureOffsets(fontRid: RID, size: Vector2i, textureIndex: Int
) -> PackedInt32Array Returns array containing glyph packing data.
func fontGetTransform(fontRid: RID
) -> Transform2D Returns 2D transform applied to the font outlines.
func fontGetUnderlinePosition(fontRid: RID, size: Int
) -> Double Returns pixel offset of the underline below the baseline.
func fontGetUnderlineThickness(fontRid: RID, size: Int
) -> Double Returns thickness of the underline in pixels.
func fontGetVariationCoordinates(fontRid: RID
) -> GDictionary Returns variation coordinates for the specified font cache entry. See
fontSupportedVariationList(fontRid:)
for more info.func fontGetWeight(fontRid: RID
) -> Int Returns weight (boldness) of the font. A value in the
100...999
range, normal font weight is400
, bold font weight is700
.func fontHasChar(fontRid: RID, char: Int
) -> Bool Returns
true
if a Unicodechar
is available in the font.func fontIsAllowSystemFallback(fontRid: RID
) -> Bool Returns
true
if system fonts can be automatically used as fallbacks.func fontIsForceAutohinter(fontRid: RID
) -> Bool Returns
true
if auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only.func fontIsLanguageSupported(fontRid: RID, language: String
) -> Bool Returns
true
, if font supports given language (ISO 639 code).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.func fontIsScriptSupported(fontRid: RID, script: String
) -> Bool Returns
true
, if font supports given script (ISO 15924 code).func fontRemoveGlyph(fontRid: RID, size: Vector2i, glyph: Int
) Removes specified rendered glyph information from the cache entry.
func fontRemoveKerning(fontRid: RID, size: Int, glyphPair: Vector2i
) Removes kerning override for the pair of glyphs.
func fontRemoveLanguageSupportOverride(fontRid: RID, language: String
) Remove language support override.
func fontRemoveScriptSupportOverride(fontRid: RID, script: String
) Removes script support override.
func fontRemoveSizeCache(fontRid: RID, size: Vector2i
) Removes specified font size from the cache entry.
func fontRemoveTexture(fontRid: RID, size: Vector2i, textureIndex: Int
) Removes specified texture from the cache entry.
func fontRenderGlyph(fontRid: RID, size: Vector2i, index: Int
) Renders specified glyph to the font cache texture.
func fontRenderRange(fontRid: RID, size: Vector2i, start: Int, end: Int
) Renders the range of characters to the font cache texture.
func fontSetAllowSystemFallback(fontRid: RID, allowSystemFallback: Bool
) If set to
true
, system fonts can be automatically used as fallbacks.func fontSetAntialiasing(fontRid: RID, antialiasing: TextServer.FontAntialiasing
) Sets font anti-aliasing mode.
func fontSetAscent(fontRid: RID, size: Int, ascent: Double
) Sets the font ascent (number of pixels above the baseline).
func fontSetBaselineOffset(fontRid: RID, baselineOffset: Double
) Sets extra baseline offset (as a fraction of font height).
func fontSetData(fontRid: RID, data: PackedByteArray
) Sets font source data, e.g contents of the dynamic font source file.
func fontSetDescent(fontRid: RID, size: Int, descent: Double
) Sets the font descent (number of pixels below the baseline).
func fontSetDisableEmbeddedBitmaps(fontRid: RID, disableEmbeddedBitmaps: Bool
) If set to
true
, embedded font bitmap loading is disabled (bitmap-only and color fonts ignore this property).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
) Sets an active face index in the TrueType / OpenType collection.
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.
func fontSetFixedSizeScaleMode(fontRid: RID, fixedSizeScaleMode: TextServer.FixedSizeScaleMode
) Sets bitmap font scaling mode. This property is used only if
fixed_size
is greater than zero.func fontSetForceAutohinter(fontRid: RID, forceAutohinter: Bool
) If set to
true
auto-hinting is preferred over font built-in hinting.func fontSetGenerateMipmaps(fontRid: RID, generateMipmaps: Bool
) If set to
true
font texture mipmap generation is enabled.func fontSetGlobalOversampling(Double
) Sets oversampling factor, shared by all font in the TextServer.
func fontSetGlyphAdvance(fontRid: RID, size: Int, glyph: Int, advance: Vector2
) Sets glyph advance (offset of the next glyph).
func fontSetGlyphOffset(fontRid: RID, size: Vector2i, glyph: Int, offset: Vector2
) Sets glyph offset from the baseline.
func fontSetGlyphSize(fontRid: RID, size: Vector2i, glyph: Int, glSize: Vector2
) Sets size of the glyph.
func fontSetGlyphTextureIdx(fontRid: RID, size: Vector2i, glyph: Int, textureIdx: Int
) Sets index of the cache texture containing the glyph.
func fontSetGlyphUvRect(fontRid: RID, size: Vector2i, glyph: Int, uvRect: Rect2
) Sets rectangle in the cache texture containing the glyph.
func fontSetHinting(fontRid: RID, hinting: TextServer.Hinting
) Sets font hinting mode. Used by dynamic fonts only.
func fontSetKerning(fontRid: RID, size: Int, glyphPair: Vector2i, kerning: Vector2
) Sets kerning for the pair of glyphs.
func fontSetLanguageSupportOverride(fontRid: RID, language: String, supported: Bool
) Adds override for
fontIsLanguageSupported(fontRid:language:)
.func fontSetMsdfPixelRange(fontRid: RID, msdfPixelRange: Int
) Sets the width of the range around the shape between the minimum and maximum representable signed distance.
func fontSetMsdfSize(fontRid: RID, msdfSize: Int
) Sets source font size used to generate MSDF textures.
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.func fontSetName(fontRid: RID, name: String
) Sets the font family name.
func fontSetOpentypeFeatureOverrides(fontRid: RID, overrides: GDictionary
) Sets font OpenType feature set override.
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.func fontSetScale(fontRid: RID, size: Int, scale: Double
) Sets scaling factor of the color bitmap font.
func fontSetScriptSupportOverride(fontRid: RID, script: String, supported: Bool
) Adds override for
fontIsScriptSupported(fontRid:script:)
.func fontSetSpacing(fontRid: RID, spacing: TextServer.SpacingType, value: Int
) Sets the spacing for
spacing
(seeTextServer.SpacingType
) tovalue
in pixels (not relative to the font size).func fontSetStretch(fontRid: RID, weight: Int
) Sets font stretch amount, compared to a normal width. A percentage value between
50%
and200%
.func fontSetStyle(fontRid: RID, style: TextServer.FontStyle
) Sets the font style flags, see
FontStyle
.func fontSetStyleName(fontRid: RID, name: String
) Sets the font style name.
func fontSetSubpixelPositioning(fontRid: RID, subpixelPositioning: TextServer.SubpixelPositioning
) Sets font subpixel glyph positioning mode.
func fontSetTextureImage(fontRid: RID, size: Vector2i, textureIndex: Int, image: Image?
) Sets font cache texture image data.
func fontSetTextureOffsets(fontRid: RID, size: Vector2i, textureIndex: Int, offset: PackedInt32Array
) Sets array containing glyph packing data.
func fontSetTransform(fontRid: RID, transform: Transform2D
) Sets 2D transform, applied to the font outlines, can be used for slanting, flipping, and rotating glyphs.
func fontSetUnderlinePosition(fontRid: RID, size: Int, underlinePosition: Double
) Sets pixel offset of the underline below the baseline.
func fontSetUnderlineThickness(fontRid: RID, size: Int, underlineThickness: Double
) Sets thickness of the underline in pixels.
func fontSetVariationCoordinates(fontRid: RID, variationCoordinates: GDictionary
) Sets variation coordinates for the specified font cache entry. See
fontSupportedVariationList(fontRid:)
for more info.func fontSetWeight(fontRid: RID, weight: Int
) Sets weight (boldness) of the font. A value in the
100...999
range, normal font weight is400
, bold font weight is700
.func fontSupportedFeatureList(fontRid: RID
) -> GDictionary Returns the dictionary of the supported OpenType features.
func fontSupportedVariationList(fontRid: RID
) -> GDictionary Returns the dictionary of the supported OpenType variation coordinates.
func formatNumber(String, language: String
) -> String Converts a number from the Western Arabic (0..9) to the numeral systems used in
language
.func freeRid(RID
) Frees an object created by this
TextServer
.func getFeatures(
) -> Int Returns text server features, see
Feature
.func getHexCodeBoxSize(Int, index: Int
) -> Vector2 Returns size of the replacement character (box with character hexadecimal code that is drawn in place of invalid characters).
func getName(
) -> String Returns the name of the server interface.
func getSupportDataFilename(
) -> String Returns default TextServer database (e.g. ICU break iterators and dictionaries) filename.
func getSupportDataInfo(
) -> String Returns TextServer database (e.g. ICU break iterators and dictionaries) description.
func has(rid: RID
) -> Bool Returns
true
ifrid
is valid resource owned by this text server.func hasFeature(TextServer.Feature
) -> Bool Returns
true
if the server supports a feature.func isConfusable(string: String, dict: PackedStringArray
) -> Int Returns index of the first string in
dict
which is visually confusable with thestring
, or-1
if none is found.func isLocaleRightToLeft(locale: String
) -> Bool Returns
true
if locale is right-to-left.func isValidIdentifier(string: String
) -> Bool Returns
true
ifstring
is a valid identifier.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”.func loadSupportData(filename: String
) -> Bool Loads optional TextServer database (e.g. ICU break iterators and dictionaries).
func nameToTag(name: String
) -> Int Converts readable feature, variation, script, or language name to OpenType tag.
func parseNumber(String, language: String
) -> String Converts
number
from the numeral systems used inlanguage
to Western Arabic (0..9).func parseStructuredText(parserType: TextServer.StructuredTextParser, args: GArray, text: String
) -> VariantCollection<Vector3i> Default implementation of the BiDi algorithm override function. See
StructuredTextParser
for more info.func percentSign(language: String
) -> String Returns percent sign used in the
language
.func saveSupportData(filename: String
) -> Bool Saves optional TextServer database (e.g. ICU break iterators and dictionaries) to the file.
func shapedGetSpanCount(shaped: RID
) -> Int Returns number of text spans added using
shapedTextAddString(shaped:text:fonts:size:opentypeFeatures:language:meta:)
orshapedTextAddObject(shaped:key:size:inlineAlign:length:baseline:)
.func shapedGetSpanMeta(shaped: RID, index: Int
) -> Variant Returns text span metadata.
func shapedSetSpanUpdateFont(shaped: RID, index: Int, fonts: VariantCollection<RID>, size: Int, opentypeFeatures: GDictionary
) Changes text span font, font size, and OpenType features, without changing the text.
func shapedTextAddObject(shaped: RID, key: Variant, size: Vector2, inlineAlign: InlineAlignment, length: Int, baseline: Double
) -> Bool Adds inline object to the text buffer,
key
must be unique. In the text, object is represented aslength
object replacement characters.func shapedTextAddString(shaped: RID, text: String, fonts: VariantCollection<RID>, size: Int, opentypeFeatures: GDictionary, language: String, meta: Variant
) -> Bool Adds text span and font to draw it to the text buffer.
func shapedTextClear(rid: RID
) Clears text buffer (removes text and inline objects).
func shapedTextClosestCharacterPos(shaped: RID, pos: Int
) -> Int Returns composite character position closest to the
pos
.func shapedTextDraw(shaped: RID, canvas: RID, pos: Vector2, clipL: Double, clipR: Double, 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).func shapedTextDrawOutline(shaped: RID, canvas: RID, pos: Vector2, clipL: Double, clipR: Double, outlineSize: Int, 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).func shapedTextFitToWidth(shaped: RID, width: Double, justificationFlags: TextServer.JustificationFlag
) -> Double Adjusts text width to fit to specified width, returns new text width.
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).
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.func shapedTextGetCharacterBreaks(shaped: RID
) -> PackedInt32Array Returns array of the composite character boundaries.
func shapedTextGetCustomEllipsis(shaped: RID
) -> Int Returns ellipsis character used for text clipping.
func shapedTextGetCustomPunctuation(shaped: RID
) -> String Returns custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.
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).
func shapedTextGetDirection(shaped: RID
) -> TextServer.Direction Returns direction of the text.
func shapedTextGetDominantDirectionInRange(shaped: RID, start: Int, end: Int
) -> TextServer.Direction Returns dominant direction of in the range of text.
func shapedTextGetEllipsisGlyphCount(shaped: RID
) -> Int Returns number of glyphs in the ellipsis.
func shapedTextGetEllipsisGlyphs(shaped: RID
) -> VariantCollection<GDictionary> Returns array of the glyphs in the ellipsis.
func shapedTextGetEllipsisPos(shaped: RID
) -> Int Returns position of the ellipsis.
func shapedTextGetGlyphCount(shaped: RID
) -> Int Returns number of glyphs in the buffer.
func shapedTextGetGlyphs(shaped: RID
) -> VariantCollection<GDictionary> Returns an array of glyphs in the visual order.
func shapedTextGetGraphemeBounds(shaped: RID, pos: Int
) -> Vector2 Returns composite character’s bounds as offsets from the start of the line.
func shapedTextGetInferredDirection(shaped: RID
) -> TextServer.Direction Returns direction of the text, inferred by the BiDi algorithm.
func shapedTextGetLineBreaks(shaped: RID, width: Double, start: Int, breakFlags: TextServer.LineBreakFlag
) -> PackedInt32Array Breaks text to the lines and returns character ranges for each line.
func shapedTextGetLineBreaksAdv(shaped: RID, width: PackedFloat32Array, start: Int, once: Bool, breakFlags: TextServer.LineBreakFlag
) -> PackedInt32Array Breaks text to the lines and columns. Returns character ranges for each segment.
func shapedTextGetObjectGlyph(shaped: RID, key: Variant
) -> Int Returns the glyph index of the inline object.
func shapedTextGetObjectRange(shaped: RID, key: Variant
) -> Vector2i Returns the character range of the inline object.
func shapedTextGetObjectRect(shaped: RID, key: Variant
) -> Rect2 Returns bounding rectangle of the inline object.
func shapedTextGetObjects(shaped: RID
) -> GArray Returns array of inline objects.
func shapedTextGetOrientation(shaped: RID
) -> TextServer.Orientation Returns text orientation.
func shapedTextGetParent(shaped: RID
) -> RID Returns the parent buffer from which the substring originates.
func shapedTextGetPreserveControl(shaped: RID
) -> Bool Returns
true
if text buffer is configured to display control characters.func shapedTextGetPreserveInvalid(shaped: RID
) -> Bool Returns
true
if text buffer is configured to display hexadecimal codes in place of invalid characters.func shapedTextGetRange(shaped: RID
) -> Vector2i Returns substring buffer character range in the parent buffer.
func shapedTextGetSelection(shaped: RID, start: Int, end: Int
) -> PackedVector2Array Returns selection rectangles for the specified character range.
func shapedTextGetSize(shaped: RID
) -> Vector2 Returns size of the text.
func shapedTextGetSpacing(shaped: RID, spacing: TextServer.SpacingType
) -> Int Returns extra spacing added between glyphs or lines in pixels.
func shapedTextGetTrimPos(shaped: RID
) -> Int Returns the position of the overrun trim.
func shapedTextGetUnderlinePosition(shaped: RID
) -> Double Returns pixel offset of the underline below the baseline.
func shapedTextGetUnderlineThickness(shaped: RID
) -> Double Returns thickness of the underline.
func shapedTextGetWidth(shaped: RID
) -> Double Returns width (for horizontal layout) or height (for vertical) of the text.
func shapedTextGetWordBreaks(shaped: RID, graphemeFlags: TextServer.GraphemeFlag, skipGraphemeFlags: TextServer.GraphemeFlag
) -> PackedInt32Array Breaks text into words and returns array of character ranges. Use
graphemeFlags
to set what characters are used for breaking (seeGraphemeFlag
).func shapedTextHasVisibleChars(shaped: RID
) -> Bool Returns
true
if text buffer contains any visible characters.func shapedTextHitTestGrapheme(shaped: RID, coords: Double
) -> Int Returns grapheme index at the specified pixel offset at the baseline, or
-1
if none is found.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.
func shapedTextIsReady(shaped: RID
) -> Bool Returns
true
if buffer is successfully shaped.func shapedTextNextCharacterPos(shaped: RID, pos: Int
) -> Int Returns composite character end position closest to the
pos
.func shapedTextNextGraphemePos(shaped: RID, pos: Int
) -> Int Returns grapheme end position closest to the
pos
.func shapedTextOverrunTrimToWidth(shaped: RID, width: Double, overrunTrimFlags: TextServer.TextOverrunFlag
) Trims text if it exceeds the given width.
func shapedTextPrevCharacterPos(shaped: RID, pos: Int
) -> Int Returns composite character start position closest to the
pos
.func shapedTextPrevGraphemePos(shaped: RID, pos: Int
) -> Int Returns grapheme start position closest to the
pos
.func shapedTextResizeObject(shaped: RID, key: Variant, size: Vector2, inlineAlign: InlineAlignment, baseline: Double
) -> Bool Sets new size and alignment of embedded object.
func shapedTextSetBidiOverride(shaped: RID, override: GArray
) Overrides BiDi for the structured text.
func shapedTextSetCustomEllipsis(shaped: RID, char: Int
) Sets ellipsis character used for text clipping.
func shapedTextSetCustomPunctuation(shaped: RID, punct: String
) Sets custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.
func shapedTextSetDirection(shaped: RID, direction: TextServer.Direction
) Sets desired text direction. If set to .auto, direction will be detected based on the buffer contents and current locale.
func shapedTextSetOrientation(shaped: RID, orientation: TextServer.Orientation
) Sets desired text orientation.
func shapedTextSetPreserveControl(shaped: RID, enabled: Bool
) If set to
true
text buffer will display control characters.func shapedTextSetPreserveInvalid(shaped: RID, enabled: Bool
) If set to
true
text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed.func shapedTextSetSpacing(shaped: RID, spacing: TextServer.SpacingType, value: Int
) Sets extra spacing added between glyphs or lines in pixels.
func shapedTextShape(shaped: RID
) -> Bool Shapes buffer if it’s not shaped. Returns
true
if the string is shaped successfully.func shapedTextSortLogical(shaped: RID
) -> VariantCollection<GDictionary> Returns text glyphs in the logical order.
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).func shapedTextTabAlign(shaped: RID, tabStops: PackedFloat32Array
) -> Double Aligns shaped text to the given tab-stops.
func spoofCheck(string: String
) -> Bool Returns
true
ifstring
is likely to be an attempt at confusing the reader.func stringGetCharacterBreaks(string: String, language: String
) -> PackedInt32Array Returns array of the composite character boundaries.
func stringGetWordBreaks(string: String, language: String, charsPerLine: Int
) -> 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.
func stringToLower(string: String, language: String
) -> String Returns the string converted to lowercase.
func stringToTitle(string: String, language: String
) -> String Returns the string converted to title case.
func stringToUpper(string: String, language: String
) -> String Returns the string converted to uppercase.
func stripDiacritics(string: String
) -> String Strips diacritics from the string.
func tagToName(tag: Int
) -> String Converts OpenType tag to readable feature, variation, script, or language name.
Citizens in SwiftGodot
Conformances
protocol CaseIterable
A type that provides a collection of all of its values.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
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 RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
Type members
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.