TextServerExtension

package
v0.0.0-...-ff35923 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

External graphics.gd/classdb/TextServer implementations should inherit from this class.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsTextServerExtension() Instance
}

type CaretInfo

type CaretInfo = gd.CaretInfo

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this [Extension]See Interface for methods that can be overridden by T.

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsTextServer

func (self *Extension[T]) AsTextServer() TextServer.Instance

func (*Extension[T]) AsTextServerExtension

func (self *Extension[T]) AsTextServerExtension() Instance

type FontSizeCacheInfo

type FontSizeCacheInfo struct {
	SizePixels struct {
		X int32
		Y int32
	} `gd:"size_px"`
	ViewportOversampling float32 `gd:"viewport_oversampling"`
	Glyphs               int     `gd:"glyphs"`
	Textures             int     `gd:"textures"`
	TexturesSize         int     `gd:"textures_size"`
}

type Glyph

type Glyph = gd.Glyph

type GlyphContours

type GlyphContours struct {
	Points []struct {
		X float32
		Y float32
		Z float32
	} `gd:"points"`
	Contours    []int32 `gd:"contours"`
	Orientation bool    `gd:"orientation"`
}

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Implementation

type Implementation = implementation

Implementation implements Interface with empty methods.

type Instance

type Instance [1]gdclass.TextServerExtension

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsTextServer

func (self Instance) AsTextServer() TextServer.Instance

func (Instance) AsTextServerExtension

func (self Instance) AsTextServerExtension() Instance

func (Instance) ID

func (self Instance) ID() ID

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type Interface

type Interface interface {
	// Returns true if the server supports a feature.
	HasFeature(feature TextServer.Feature) bool
	// Returns the name of the server interface.
	GetName() string
	// Returns text server features, see [TextServer.Feature].
	GetFeatures() int
	// Frees an object created by this [graphics.gd/classdb/TextServer].
	FreeRid(rid RID.Any)
	// Returns true if 'rid' is valid resource owned by this text server.
	Has(rid RID.Any) bool
	// Loads optional TextServer database (e.g. ICU break iterators and dictionaries).
	LoadSupportData(filename string) bool
	// Returns default TextServer database (e.g. ICU break iterators and dictionaries) filename.
	GetSupportDataFilename() string
	// Returns TextServer database (e.g. ICU break iterators and dictionaries) description.
	GetSupportDataInfo() string
	// Saves optional TextServer database (e.g. ICU break iterators and dictionaries) to the file.
	SaveSupportData(filename string) bool
	// Returns default TextServer database (e.g. ICU break iterators and dictionaries).
	GetSupportData() []byte
	// Returns true if locale is right-to-left.
	IsLocaleRightToLeft(locale string) bool
	// Converts readable feature, variation, script, or language name to OpenType tag.
	NameToTag(name string) int
	// Converts OpenType tag to readable feature, variation, script, or language name.
	TagToName(tag int) string
	// Creates a new, empty font cache entry resource.
	CreateFont() RID.Font
	// Optional, implement if font supports extra spacing or baseline offset.
	//
	// Creates a new variation existing font which is reusing the same glyph cache and font data.
	CreateFontLinkedVariation(font_rid RID.Font) RID.Font
	// Sets font source data, e.g contents of the dynamic font source file.
	FontSetData(font_rid RID.Font, data []byte)
	// Sets pointer to the font source data, e.g contents of the dynamic font source file.
	FontSetDataPtr(font_rid RID.Font, data_ptr gdextension.Pointer, data_size int)
	// Sets an active face index in the TrueType / OpenType collection.
	FontSetFaceIndex(font_rid RID.Font, face_index int)
	// Returns an active face index in the TrueType / OpenType collection.
	FontGetFaceIndex(font_rid RID.Font) int
	// Returns number of faces in the TrueType / OpenType collection.
	FontGetFaceCount(font_rid RID.Font) int
	// Sets the font style flags.
	FontSetStyle(font_rid RID.Font, style TextServer.FontStyle)
	// Returns font style flags.
	FontGetStyle(font_rid RID.Font) TextServer.FontStyle
	// Sets the font family name.
	FontSetName(font_rid RID.Font, name string)
	// Returns font family name.
	FontGetName(font_rid RID.Font) string
	// Returns data structure with OpenType font name strings (localized font names, version, description, license information, sample text, etc.).
	FontGetOtNameStrings(font_rid RID.Font) map[string]map[string]string
	// Sets the font style name.
	FontSetStyleName(font_rid RID.Font, name_style string)
	// Returns font style name.
	FontGetStyleName(font_rid RID.Font) string
	// Sets weight (boldness) of the font. A value in the 100...999 range, normal font weight is 400, bold font weight is 700.
	FontSetWeight(font_rid RID.Font, weight int)
	// Returns weight (boldness) of the font. A value in the 100...999 range, normal font weight is 400, bold font weight is 700.
	FontGetWeight(font_rid RID.Font) int
	// Sets font stretch amount, compared to a normal width. A percentage value between 50% and 200%.
	FontSetStretch(font_rid RID.Font, stretch int)
	// Returns font stretch amount, compared to a normal width. A percentage value between 50% and 200%.
	FontGetStretch(font_rid RID.Font) int
	// Sets font anti-aliasing mode.
	FontSetAntialiasing(font_rid RID.Font, antialiasing TextServer.FontAntialiasing)
	// Returns font anti-aliasing mode.
	FontGetAntialiasing(font_rid RID.Font) TextServer.FontAntialiasing
	// If set to true, embedded font bitmap loading is disabled.
	FontSetDisableEmbeddedBitmaps(font_rid RID.Font, disable_embedded_bitmaps bool)
	// Returns whether the font's embedded bitmap loading is disabled.
	FontGetDisableEmbeddedBitmaps(font_rid RID.Font) bool
	// If set to true font texture mipmap generation is enabled.
	FontSetGenerateMipmaps(font_rid RID.Font, generate_mipmaps bool)
	// Returns true if font texture mipmap generation is enabled.
	FontGetGenerateMipmaps(font_rid RID.Font) 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.
	FontSetMultichannelSignedDistanceField(font_rid RID.Font, msdf bool)
	// Returns true if glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
	FontIsMultichannelSignedDistanceField(font_rid RID.Font) bool
	// Sets the width of the range around the shape between the minimum and maximum representable signed distance.
	FontSetMsdfPixelRange(font_rid RID.Font, msdf_pixel_range int)
	// Returns the width of the range around the shape between the minimum and maximum representable signed distance.
	FontGetMsdfPixelRange(font_rid RID.Font) int
	// Sets source font size used to generate MSDF textures.
	FontSetMsdfSize(font_rid RID.Font, msdf_size int)
	// Returns source font size used to generate MSDF textures.
	FontGetMsdfSize(font_rid RID.Font) int
	// Sets bitmap font fixed size. If set to value greater than zero, same cache entry will be used for all font sizes.
	FontSetFixedSize(font_rid RID.Font, fixed_size int)
	// Returns bitmap font fixed size.
	FontGetFixedSize(font_rid RID.Font) int
	// Sets bitmap font scaling mode. This property is used only if fixed_size is greater than zero.
	FontSetFixedSizeScaleMode(font_rid RID.Font, fixed_size_scale_mode TextServer.FixedSizeScaleMode)
	// Returns bitmap font scaling mode.
	FontGetFixedSizeScaleMode(font_rid RID.Font) TextServer.FixedSizeScaleMode
	// If set to true, system fonts can be automatically used as fallbacks.
	FontSetAllowSystemFallback(font_rid RID.Font, allow_system_fallback bool)
	// Returns true if system fonts can be automatically used as fallbacks.
	FontIsAllowSystemFallback(font_rid RID.Font) bool
	// Frees all automatically loaded system fonts.
	FontClearSystemFallbackCache()
	// If set to true auto-hinting is preferred over font built-in hinting.
	FontSetForceAutohinter(font_rid RID.Font, force_autohinter bool)
	// Returns true if auto-hinting is supported and preferred over font built-in hinting.
	FontIsForceAutohinter(font_rid RID.Font) bool
	// If set to true, color modulation is applied when drawing colored glyphs, otherwise it's applied to the monochrome glyphs only.
	FontSetModulateColorGlyphs(font_rid RID.Font, modulate bool)
	// Returns true, if color modulation is applied when drawing colored glyphs.
	FontIsModulateColorGlyphs(font_rid RID.Font) bool
	// Sets font hinting mode. Used by dynamic fonts only.
	FontSetHinting(font_rid RID.Font, hinting TextServer.Hinting)
	// Returns the font hinting mode. Used by dynamic fonts only.
	FontGetHinting(font_rid RID.Font) TextServer.Hinting
	// Sets font subpixel glyph positioning mode.
	FontSetSubpixelPositioning(font_rid RID.Font, subpixel_positioning TextServer.SubpixelPositioning)
	// Returns font subpixel glyph positioning mode.
	FontGetSubpixelPositioning(font_rid RID.Font) TextServer.SubpixelPositioning
	// 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.
	FontSetKeepRoundingRemainders(font_rid RID.Font, keep_rounding_remainders bool)
	// 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.
	FontGetKeepRoundingRemainders(font_rid RID.Font) bool
	// Sets font embolden strength. If 'strength' is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness.
	FontSetEmbolden(font_rid RID.Font, strength Float.X)
	// Returns font embolden strength.
	FontGetEmbolden(font_rid RID.Font) Float.X
	// Sets the spacing for 'spacing' to 'value' in pixels (not relative to the font size).
	FontSetSpacing(font_rid RID.Font, spacing TextServer.SpacingType, value int)
	// Returns the spacing for 'spacing' in pixels (not relative to the font size).
	FontGetSpacing(font_rid RID.Font, spacing TextServer.SpacingType) int
	// Sets extra baseline offset (as a fraction of font height).
	FontSetBaselineOffset(font_rid RID.Font, baseline_offset Float.X)
	// Returns extra baseline offset (as a fraction of font height).
	FontGetBaselineOffset(font_rid RID.Font) Float.X
	// Sets 2D transform, applied to the font outlines, can be used for slanting, flipping, and rotating glyphs.
	FontSetTransform(font_rid RID.Font, transform Transform2D.OriginXY)
	// Returns 2D transform applied to the font outlines.
	FontGetTransform(font_rid RID.Font) Transform2D.OriginXY
	// Sets variation coordinates for the specified font cache entry.
	FontSetVariationCoordinates(font_rid RID.Font, variation_coordinates map[string]float32)
	// Returns variation coordinates for the specified font cache entry.
	FontGetVariationCoordinates(font_rid RID.Font) map[string]float32
	// If set to a positive value, overrides the oversampling factor of the viewport this font is used in. See [graphics.gd/classdb/Viewport.Instance.Oversampling]. This value doesn't override the oversampling parameter of draw_* methods. Used by dynamic fonts only.
	FontSetOversampling(font_rid RID.Font, oversampling Float.X)
	// Returns oversampling factor override. If set to a positive value, overrides the oversampling factor of the viewport this font is used in. See [graphics.gd/classdb/Viewport.Instance.Oversampling]. This value doesn't override the oversampling parameter of draw_* methods. Used by dynamic fonts only.
	FontGetOversampling(font_rid RID.Font) Float.X
	// Returns list of the font sizes in the cache. Each size is [Vector2i.XY] with font size and outline size.
	FontGetSizeCacheList(font_rid RID.Font) []Vector2i.XY
	// Removes all font sizes from the cache entry.
	FontClearSizeCache(font_rid RID.Font)
	// Removes specified font size from the cache entry.
	FontRemoveSizeCache(font_rid RID.Font, size Vector2i.XY)
	// 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.
	FontGetSizeCacheInfo(font_rid RID.Font) []FontSizeCacheInfo
	// Sets the font ascent (number of pixels above the baseline).
	FontSetAscent(font_rid RID.Font, size int, ascent Float.X)
	// Returns the font ascent (number of pixels above the baseline).
	FontGetAscent(font_rid RID.Font, size int) Float.X
	// Sets the font descent (number of pixels below the baseline).
	FontSetDescent(font_rid RID.Font, size int, descent Float.X)
	// Returns the font descent (number of pixels below the baseline).
	FontGetDescent(font_rid RID.Font, size int) Float.X
	// Sets pixel offset of the underline below the baseline.
	FontSetUnderlinePosition(font_rid RID.Font, size int, underline_position Float.X)
	// Returns pixel offset of the underline below the baseline.
	FontGetUnderlinePosition(font_rid RID.Font, size int) Float.X
	// Sets thickness of the underline in pixels.
	FontSetUnderlineThickness(font_rid RID.Font, size int, underline_thickness Float.X)
	// Returns thickness of the underline in pixels.
	FontGetUnderlineThickness(font_rid RID.Font, size int) Float.X
	// Sets scaling factor of the color bitmap font.
	FontSetScale(font_rid RID.Font, size int, scale Float.X)
	// Returns scaling factor of the color bitmap font.
	FontGetScale(font_rid RID.Font, size int) Float.X
	// Returns number of textures used by font cache entry.
	FontGetTextureCount(font_rid RID.Font, size Vector2i.XY) int
	// Removes all textures from font cache entry.
	FontClearTextures(font_rid RID.Font, size Vector2i.XY)
	// Removes specified texture from the cache entry.
	FontRemoveTexture(font_rid RID.Font, size Vector2i.XY, texture_index int)
	// Sets font cache texture image data.
	FontSetTextureImage(font_rid RID.Font, size Vector2i.XY, texture_index int, image Image.Instance)
	// Returns font cache texture image data.
	FontGetTextureImage(font_rid RID.Font, size Vector2i.XY, texture_index int) Image.Instance
	// Sets array containing glyph packing data.
	FontSetTextureOffsets(font_rid RID.Font, size Vector2i.XY, texture_index int, offset []int32)
	// Returns array containing glyph packing data.
	FontGetTextureOffsets(font_rid RID.Font, size Vector2i.XY, texture_index int) []int32
	// Returns list of rendered glyphs in the cache entry.
	FontGetGlyphList(font_rid RID.Font, size Vector2i.XY) []int32
	// Removes all rendered glyph information from the cache entry.
	FontClearGlyphs(font_rid RID.Font, size Vector2i.XY)
	// Removes specified rendered glyph information from the cache entry.
	FontRemoveGlyph(font_rid RID.Font, size Vector2i.XY, glyph int)
	// Returns glyph advance (offset of the next glyph).
	FontGetGlyphAdvance(font_rid RID.Font, size int, glyph int) Vector2.XY
	// Sets glyph advance (offset of the next glyph).
	FontSetGlyphAdvance(font_rid RID.Font, size int, glyph int, advance Vector2.XY)
	// Returns glyph offset from the baseline.
	FontGetGlyphOffset(font_rid RID.Font, size Vector2i.XY, glyph int) Vector2.XY
	// Sets glyph offset from the baseline.
	FontSetGlyphOffset(font_rid RID.Font, size Vector2i.XY, glyph int, offset Vector2.XY)
	// Returns size of the glyph.
	FontGetGlyphSize(font_rid RID.Font, size Vector2i.XY, glyph int) Vector2.XY
	// Sets size of the glyph.
	FontSetGlyphSize(font_rid RID.Font, size Vector2i.XY, glyph int, gl_size Vector2.XY)
	// Returns rectangle in the cache texture containing the glyph.
	FontGetGlyphUvRect(font_rid RID.Font, size Vector2i.XY, glyph int) Rect2.PositionSize
	// Sets rectangle in the cache texture containing the glyph.
	FontSetGlyphUvRect(font_rid RID.Font, size Vector2i.XY, glyph int, uv_rect Rect2.PositionSize)
	// Returns index of the cache texture containing the glyph.
	FontGetGlyphTextureIdx(font_rid RID.Font, size Vector2i.XY, glyph int) int
	// Sets index of the cache texture containing the glyph.
	FontSetGlyphTextureIdx(font_rid RID.Font, size Vector2i.XY, glyph int, texture_idx int)
	// Returns resource ID of the cache texture containing the glyph.
	FontGetGlyphTextureRid(font_rid RID.Font, size Vector2i.XY, glyph int) RID.Texture
	// Returns size of the cache texture containing the glyph.
	FontGetGlyphTextureSize(font_rid RID.Font, size Vector2i.XY, glyph int) Vector2.XY
	// Returns outline contours of the glyph.
	FontGetGlyphContours(font_rid RID.Font, size int, index int) GlyphContours
	// Returns list of the kerning overrides.
	FontGetKerningList(font_rid RID.Font, size int) []Vector2i.XY
	// Removes all kerning overrides.
	FontClearKerningMap(font_rid RID.Font, size int)
	// Removes kerning override for the pair of glyphs.
	FontRemoveKerning(font_rid RID.Font, size int, glyph_pair Vector2i.XY)
	// Sets kerning for the pair of glyphs.
	FontSetKerning(font_rid RID.Font, size int, glyph_pair Vector2i.XY, kerning Vector2.XY)
	// Returns kerning for the pair of glyphs.
	FontGetKerning(font_rid RID.Font, size int, glyph_pair Vector2i.XY) Vector2.XY
	// Returns the glyph index of a 'char', optionally modified by the 'variation_selector'.
	FontGetGlyphIndex(font_rid RID.Font, size int, char int, variation_selector int) int
	// Returns character code associated with 'glyph_index', or 0 if 'glyph_index' is invalid.
	FontGetCharFromGlyphIndex(font_rid RID.Font, size int, glyph_index int) int
	// Returns true if a Unicode 'char' is available in the font.
	FontHasChar(font_rid RID.Font, char int) bool
	// Returns a string containing all the characters available in the font.
	FontGetSupportedChars(font_rid RID.Font) string
	// Returns an array containing all glyph indices in the font.
	FontGetSupportedGlyphs(font_rid RID.Font) []int32
	// Renders the range of characters to the font cache texture.
	FontRenderRange(font_rid RID.Font, size Vector2i.XY, start int, end int)
	// Renders specified glyph to the font cache texture.
	FontRenderGlyph(font_rid RID.Font, size Vector2i.XY, index int)
	// 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.
	FontDrawGlyph(font_rid RID.Font, canvas RID.Canvas, size int, pos Vector2.XY, index int, color Color.RGBA, oversampling Float.X)
	// 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.
	FontDrawGlyphOutline(font_rid RID.Font, canvas RID.Canvas, size int, outline_size int, pos Vector2.XY, index int, color Color.RGBA, oversampling Float.X)
	// Returns true, if font supports given language ([ISO 639] code).
	//
	// [ISO 639]: https://en.wikipedia.org/wiki/ISO_639-1
	FontIsLanguageSupported(font_rid RID.Font, language string) bool
	// Adds override for [Interface.FontIsLanguageSupported].
	FontSetLanguageSupportOverride(font_rid RID.Font, language string, supported bool)
	// Returns true if support override is enabled for the 'language'.
	FontGetLanguageSupportOverride(font_rid RID.Font, language string) bool
	// Remove language support override.
	FontRemoveLanguageSupportOverride(font_rid RID.Font, language string)
	// Returns list of language support overrides.
	FontGetLanguageSupportOverrides(font_rid RID.Font) []string
	// Returns true, if font supports given script (ISO 15924 code).
	FontIsScriptSupported(font_rid RID.Font, script string) bool
	// Adds override for [Interface.FontIsScriptSupported].
	FontSetScriptSupportOverride(font_rid RID.Font, script string, supported bool)
	// Returns true if support override is enabled for the 'script'.
	FontGetScriptSupportOverride(font_rid RID.Font, script string) bool
	// Removes script support override.
	FontRemoveScriptSupportOverride(font_rid RID.Font, script string)
	// Returns list of script support overrides.
	FontGetScriptSupportOverrides(font_rid RID.Font) []string
	// Sets font OpenType feature set override.
	FontSetOpentypeFeatureOverrides(font_rid RID.Font, overrides map[string][2]string)
	// Returns font OpenType feature set override.
	FontGetOpentypeFeatureOverrides(font_rid RID.Font) map[string][2]string
	// Returns the dictionary of the supported OpenType features.
	FontSupportedFeatureList(font_rid RID.Font) map[string]OpenTypeFeature
	// Returns the dictionary of the supported OpenType variation coordinates.
	FontSupportedVariationList(font_rid RID.Font) map[int]struct {
		X int32
		Y int32
		Z int32
	}
	// Returns the font oversampling factor, shared by all fonts in the TextServer.
	FontGetGlobalOversampling() Float.X
	// Sets oversampling factor, shared by all font in the TextServer.
	FontSetGlobalOversampling(oversampling Float.X)
	// Increases the reference count of the specified oversampling level. This method is called by [graphics.gd/classdb/Viewport], and should not be used directly.
	ReferenceOversamplingLevel(oversampling Float.X)
	// Decreases the reference count of the specified oversampling level, and frees the font cache for oversampling level when the reference count reaches zero. This method is called by [graphics.gd/classdb/Viewport], and should not be used directly.
	UnreferenceOversamplingLevel(oversampling Float.X)
	// Returns size of the replacement character (box with character hexadecimal code that is drawn in place of invalid characters).
	GetHexCodeBoxSize(size int, index int) Vector2.XY
	// Draws box displaying character hexadecimal code.
	DrawHexCodeBox(canvas RID.Canvas, size int, pos Vector2.XY, index int, color Color.RGBA)
	// Creates a new buffer for complex text layout, with the given 'direction' and 'orientation'.
	CreateShapedText(direction TextServer.Direction, orientation TextServer.Orientation) RID.TextBuffer
	// Clears text buffer (removes text and inline objects).
	ShapedTextClear(shaped RID.TextBuffer)
	// Sets desired text direction. If set to [Textserver.DirectionAuto], direction will be detected based on the buffer contents and current locale.
	ShapedTextSetDirection(shaped RID.TextBuffer, direction TextServer.Direction)
	// Returns direction of the text.
	ShapedTextGetDirection(shaped RID.TextBuffer) TextServer.Direction
	// Returns direction of the text, inferred by the BiDi algorithm.
	ShapedTextGetInferredDirection(shaped RID.TextBuffer) TextServer.Direction
	// Overrides BiDi for the structured text.
	ShapedTextSetBidiOverride(shaped RID.TextBuffer, override []any)
	// Sets custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.
	ShapedTextSetCustomPunctuation(shaped RID.TextBuffer, punct string)
	// Returns custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.
	ShapedTextGetCustomPunctuation(shaped RID.TextBuffer) string
	// Sets ellipsis character used for text clipping.
	ShapedTextSetCustomEllipsis(shaped RID.TextBuffer, char int)
	// Returns ellipsis character used for text clipping.
	ShapedTextGetCustomEllipsis(shaped RID.TextBuffer) int
	// Sets desired text orientation.
	ShapedTextSetOrientation(shaped RID.TextBuffer, orientation TextServer.Orientation)
	// Returns text orientation.
	ShapedTextGetOrientation(shaped RID.TextBuffer) TextServer.Orientation
	// If set to true text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed.
	ShapedTextSetPreserveInvalid(shaped RID.TextBuffer, enabled bool)
	// Returns true if text buffer is configured to display hexadecimal codes in place of invalid characters.
	ShapedTextGetPreserveInvalid(shaped RID.TextBuffer) bool
	// If set to true text buffer will display control characters.
	ShapedTextSetPreserveControl(shaped RID.TextBuffer, enabled bool)
	// Returns true if text buffer is configured to display control characters.
	ShapedTextGetPreserveControl(shaped RID.TextBuffer) bool
	// Sets extra spacing added between glyphs or lines in pixels.
	ShapedTextSetSpacing(shaped RID.TextBuffer, spacing TextServer.SpacingType, value int)
	// Returns extra spacing added between glyphs or lines in pixels.
	ShapedTextGetSpacing(shaped RID.TextBuffer, spacing TextServer.SpacingType) int
	// Adds text span and font to draw it to the text buffer.
	ShapedTextAddString(shaped RID.TextBuffer, text string, fonts []RID.TextBuffer, size int, opentype_features map[string]uint32, language string, meta any) bool
	// Adds inline object to the text buffer, 'key' must be unique. In the text, object is represented as 'length' object replacement characters.
	ShapedTextAddObject(shaped RID.TextBuffer, key any, size Vector2.XY, inline_align GUI.InlineAlignment, length int, baseline Float.X) bool
	// Sets new size and alignment of embedded object.
	ShapedTextResizeObject(shaped RID.TextBuffer, key any, size Vector2.XY, inline_align GUI.InlineAlignment, baseline Float.X) bool
	// Returns the text buffer source text, including object replacement characters.
	ShapedGetText(shaped RID.TextBuffer) string
	// Returns number of text spans added using [Interface.ShapedTextAddString] or [Interface.ShapedTextAddObject].
	ShapedGetSpanCount(shaped RID.TextBuffer) int
	// Returns text span metadata.
	ShapedGetSpanMeta(shaped RID.TextBuffer, index int) any
	// Returns text embedded object key.
	ShapedGetSpanEmbeddedObject(shaped RID.TextBuffer, index int) any
	// Returns the text span source text.
	ShapedGetSpanText(shaped RID.TextBuffer, index int) string
	// Returns the text span embedded object key.
	ShapedGetSpanObject(shaped RID.TextBuffer, index int) any
	// Changes text span font, font size, and OpenType features, without changing the text.
	ShapedSetSpanUpdateFont(shaped RID.TextBuffer, index int, fonts [][]RID.Font, size int, opentype_features map[string]uint32)
	// Returns the number of uniform text runs in the buffer.
	ShapedGetRunCount(shaped RID.TextBuffer) int
	// Returns the source text of the 'index' text run (in visual order).
	ShapedGetRunText(shaped RID.TextBuffer, index int) string
	// Returns the source text range of the 'index' text run (in visual order).
	ShapedGetRunRange(shaped RID.TextBuffer, index int) Vector2i.XY
	// Returns the font RID of the 'index' text run (in visual order).
	ShapedGetRunFontRid(shaped RID.TextBuffer, index int) RID.Font
	// Returns the font size of the 'index' text run (in visual order).
	ShapedGetRunFontSize(shaped RID.TextBuffer, index int) int
	// Returns the language of the 'index' text run (in visual order).
	ShapedGetRunLanguage(shaped RID.TextBuffer, index int) string
	// Returns the direction of the 'index' text run (in visual order).
	ShapedGetRunDirection(shaped RID.TextBuffer, index int) TextServer.Direction
	// Returns the embedded object of the 'index' text run (in visual order).
	ShapedGetRunObject(shaped RID.TextBuffer, index int) any
	// Returns text buffer for the substring of the text in the 'shaped' text buffer (including inline objects).
	ShapedTextSubstr(shaped RID.TextBuffer, start int, length int) RID.TextBuffer
	// Returns the parent buffer from which the substring originates.
	ShapedTextGetParent(shaped RID.TextBuffer) RID.TextBuffer
	// Adjusts text width to fit to specified width, returns new text width.
	ShapedTextFitToWidth(shaped RID.TextBuffer, width Float.X, justification_flags TextServer.JustificationFlag) Float.X
	// Aligns shaped text to the given tab-stops.
	ShapedTextTabAlign(shaped RID.TextBuffer, tab_stops []float32) Float.X
	// Shapes buffer if it's not shaped. Returns true if the string is shaped successfully.
	ShapedTextShape(shaped RID.TextBuffer) bool
	// Updates break points in the shaped text. This method is called by default implementation of text breaking functions.
	ShapedTextUpdateBreaks(shaped RID.TextBuffer) bool
	// Updates justification points in the shaped text. This method is called by default implementation of text justification functions.
	ShapedTextUpdateJustificationOps(shaped RID.TextBuffer) bool
	// Returns true if buffer is successfully shaped.
	ShapedTextIsReady(shaped RID.TextBuffer) bool
	// Returns an array of glyphs in the visual order.
	ShapedTextGetGlyphs(shaped RID.TextBuffer) *Glyph
	// Returns text glyphs in the logical order.
	ShapedTextSortLogical(shaped RID.TextBuffer) *Glyph
	// Returns number of glyphs in the buffer.
	ShapedTextGetGlyphCount(shaped RID.TextBuffer) int
	// Returns substring buffer character range in the parent buffer.
	ShapedTextGetRange(shaped RID.TextBuffer) Vector2i.XY
	// Breaks text to the lines and columns. Returns character ranges for each segment.
	ShapedTextGetLineBreaksAdv(shaped RID.TextBuffer, width []float32, start int, once bool, break_flags TextServer.LineBreakFlag) []int32
	// Breaks text to the lines and returns character ranges for each line.
	ShapedTextGetLineBreaks(shaped RID.TextBuffer, width Float.X, start int, break_flags TextServer.LineBreakFlag) []int32
	// Breaks text into words and returns array of character ranges. Use 'grapheme_flags' to set what characters are used for breaking.
	ShapedTextGetWordBreaks(shaped RID.TextBuffer, grapheme_flags TextServer.GraphemeFlag, skip_grapheme_flags TextServer.GraphemeFlag) []int32
	// Returns the position of the overrun trim.
	ShapedTextGetTrimPos(shaped RID.TextBuffer) int
	// Returns position of the ellipsis.
	ShapedTextGetEllipsisPos(shaped RID.TextBuffer) int
	// Returns number of glyphs in the ellipsis.
	ShapedTextGetEllipsisGlyphCount(shaped RID.TextBuffer) int
	// Returns array of the glyphs in the ellipsis.
	ShapedTextGetEllipsisGlyphs(shaped RID.TextBuffer) *Glyph
	// Trims text if it exceeds the given width.
	ShapedTextOverrunTrimToWidth(shaped RID.TextBuffer, width Float.X, trim_flags TextServer.TextOverrunFlag)
	// Returns array of inline objects.
	ShapedTextGetObjects(shaped RID.TextBuffer) []any
	// Returns bounding rectangle of the inline object.
	ShapedTextGetObjectRect(shaped RID.TextBuffer, key any) Rect2.PositionSize
	// Returns the character range of the inline object.
	ShapedTextGetObjectRange(shaped RID.TextBuffer, key any) Vector2i.XY
	// Returns the glyph index of the inline object.
	ShapedTextGetObjectGlyph(shaped RID.TextBuffer, key any) int
	// Returns size of the text.
	ShapedTextGetSize(shaped RID.TextBuffer) Vector2.XY
	// Returns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
	ShapedTextGetAscent(shaped RID.TextBuffer) Float.X
	// Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
	ShapedTextGetDescent(shaped RID.TextBuffer) Float.X
	// Returns width (for horizontal layout) or height (for vertical) of the text.
	ShapedTextGetWidth(shaped RID.TextBuffer) Float.X
	// Returns pixel offset of the underline below the baseline.
	ShapedTextGetUnderlinePosition(shaped RID.TextBuffer) Float.X
	// Returns thickness of the underline.
	ShapedTextGetUnderlineThickness(shaped RID.TextBuffer) Float.X
	// Returns dominant direction of in the range of text.
	ShapedTextGetDominantDirectionInRange(shaped RID.TextBuffer, start int, end int) int
	// Returns shapes of the carets corresponding to the character offset 'position' in the text. Returned caret shape is 1 pixel wide rectangle.
	ShapedTextGetCarets(shaped RID.TextBuffer, position int, caret *CaretInfo)
	// Returns selection rectangles for the specified character range.
	ShapedTextGetSelection(shaped RID.TextBuffer, start int, end int) []Vector2.XY
	// Returns grapheme index at the specified pixel offset at the baseline, or -1 if none is found.
	ShapedTextHitTestGrapheme(shaped RID.TextBuffer, coord Float.X) int
	// Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position.
	ShapedTextHitTestPosition(shaped RID.TextBuffer, coord Float.X) int
	// 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.
	ShapedTextDraw(shaped RID.TextBuffer, canvas RID.Canvas, pos Vector2.XY, clip_l Float.X, clip_r Float.X, color Color.RGBA, oversampling Float.X)
	// 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.
	ShapedTextDrawOutline(shaped RID.TextBuffer, canvas RID.Canvas, pos Vector2.XY, clip_l Float.X, clip_r Float.X, outline_size int, color Color.RGBA, oversampling Float.X)
	// Returns composite character's bounds as offsets from the start of the line.
	ShapedTextGetGraphemeBounds(shaped RID.TextBuffer, pos int) Vector2.XY
	// Returns grapheme end position closest to the 'pos'.
	ShapedTextNextGraphemePos(shaped RID.TextBuffer, pos int) int
	// Returns grapheme start position closest to the 'pos'.
	ShapedTextPrevGraphemePos(shaped RID.TextBuffer, pos int) int
	// Returns array of the composite character boundaries.
	ShapedTextGetCharacterBreaks(shaped RID.TextBuffer) []int32
	// Returns composite character end position closest to the 'pos'.
	ShapedTextNextCharacterPos(shaped RID.TextBuffer, pos int) int
	// Returns composite character start position closest to the 'pos'.
	ShapedTextPrevCharacterPos(shaped RID.TextBuffer, pos int) int
	// Returns composite character position closest to the 'pos'.
	ShapedTextClosestCharacterPos(shaped RID.TextBuffer, pos int) int
	// Converts a number from the Western Arabic (0..9) to the numeral systems used in 'language'.
	FormatNumber(number string, language string) string
	// Converts 'number' from the numeral systems used in 'language' to Western Arabic (0..9).
	ParseNumber(number string, language string) string
	// Returns percent sign used in the 'language'.
	PercentSign(language string) string
	// Strips diacritics from the string.
	StripDiacritics(s string) string
	// Returns true if 'string' is a valid identifier.
	IsValidIdentifier(s string) bool
	IsValidLetter(unicode int) bool
	// 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.
	StringGetWordBreaks(s string, language string, chars_per_line int) []int32
	// Returns array of the composite character boundaries.
	StringGetCharacterBreaks(s string, language string) []int32
	// Returns index of the first string in 'dict' which is visually confusable with the 'string', or -1 if none is found.
	IsConfusable(s string, dict []string) int
	// Returns true if 'string' is likely to be an attempt at confusing the reader.
	SpoofCheck(s string) bool
	// Returns the string converted to uppercase.
	StringToUpper(s string, language string) string
	// Returns the string converted to lowercase.
	StringToLower(s string, language string) string
	// Returns the string converted to title case.
	StringToTitle(s string, language string) string
	// Default implementation of the BiDi algorithm override function.
	ParseStructuredText(parser_type TextServer.StructuredTextParser, args []any, text string) []Vector3i.XYZ
	// This method is called before text server is unregistered.
	Cleanup()
}

type OpenTypeFeature

type OpenTypeFeature struct {
	Label  string       `gd:"label"`
	Type   reflect.Type `gd:"type"`
	Hidden bool         `gd:"hidden"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL