Base class for TextServer custom implementations (plugins).
External TextServer implementations should inherit from this class.
Creates new, empty font cache entry resource. To free the resulting resourec, use [method _free] method.
Creates new buffer for complex text layout, with the given [code]direction[/code] and [code]orientation[/code]. To free the resulting buffer, use [method _free] method.
[b]Note:[/b] Direction is ignored if server does not support [code]FEATURE_BIDI_LAYOUT[/code] feature.
[b]Note:[/b] Orientation is ignored if server does not support [code]FEATURE_VERTICAL_LAYOUT[/code] feature.
Draws box displaying character hexadecimal code. Used for replacing missing characters.
Removes all rendered glyphs information from the cache entry.
[b]Note:[/b] This function will not remove textures associated with the glyphs, use [method _font_remove_texture] to remove them manually.
Removes all kerning overrides.
Removes all font sizes from the cache entry
Removes all textures from font cache entry.
[b]Note:[/b] This function will not remove glyphs associated with the texture, use [method _font_remove_glyph] to remove them manually.
Draws single glyph into a canvas item at the position, using [code]font_rid[/code] at the size [code]size[/code].
[b]Note:[/b] Glyph index is specific to the font, use glyphs indices returned by [method _shaped_text_get_glyphs] or [method _font_get_glyph_index].
Draws single glyph outline of size [code]outline_size[/code] into a canvas item at the position, using [code]font_rid[/code] at the size [code]size[/code].
[b]Note:[/b] Glyph index is specific to the font, use glyphs indices returned by [method _shaped_text_get_glyphs] or [method _font_get_glyph_index].
Returns the font ascent (number of pixels above the baseline).
Returns the font descent (number of pixels below the baseline).
Returns bitmap font fixed size.
Returns the font oversampling factor, shared by all fonts in the TextServer.
Returns glyph advance (offset of the next glyph).
[b]Note:[/b] Advance for glyphs outlines is the same as the base glyph advance and is not saved.
Returns outline contours of the glyph as a [code]Dictionary[/code] with the following contents:
[code]points[/code] - [PackedVector3Array], containing outline points. [code]x[/code] and [code]y[/code] are point coordinates. [code]z[/code] is the type of the point, using the [enum TextServer.ContourPointTag] values.
[code]contours[/code] - [PackedInt32Array], containing indices the end points of each contour.
[code]orientation[/code] - [bool], contour orientation. If [code]true[/code], clockwise contours must be filled.
Returns the glyph index of a [code]char[/code], optionally modified by the [code]variation_selector[/code].
Returns list of rendered glyphs in the cache entry.
Returns glyph offset from the baseline.
Returns size of the glyph.
Returns index of the cache texture containing the glyph.
Returns rectangle in the cache texture containing the glyph.
Returns the font hinting mode. Used by dynamic fonts only.
Returns kerning for the pair of glyphs.
Returns list of the kerning overrides.
Returns [code]true[/code] if support override is enabled for the [code]language[/code].
Returns list of language support overrides.
Return the width of the range around the shape between the minimum and maximum representable signed distance.
Returns source font size used to generate MSDF textures.
Returns font family name.
Returns font oversampling factor, if set to [code]0.0[/code] global oversampling factor is used instead. Used by dynamic fonts only.
Returns scaling factor of the color bitmap font.
Returns [code]true[/code] if support override is enabled for the [code]script[/code].
Returns list of script support overrides.
Return list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size.
Returns extra spacing added between glyphs in pixels.
Returns font style flags, see [enum TextServer.FontStyle].
Returns font style name.
Returns a string containing all the characters available in the font.
Returns number of textures used by font cache entry.
Returns font cache texture image data.
Returns array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty.
Returns pixel offset of the underline below the baseline.
Returns thickness of the underline in pixels.
Returns variation coordinates for the specified font cache entry. See [method _font_supported_variation_list] for more info.
Return [code]true[/code] if a Unicode [code]char[/code] is available in the font.
Returns [code]true[/code] if font 8-bit anitialiased glyph rendering is supported and enabled.
Returns [code]true[/code] if auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only.
Returns [code]true[/code], if font supports given language ([url=https://en.wikipedia.org/wiki/ISO_639-1]ISO 639[/url] code).
Returns [code]true[/code] if glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
Returns [code]true[/code], if font supports given script (ISO 15924 code).
Removes specified rendered glyph information from the cache entry.
[b]Note:[/b] This function will not remove textures associated with the glyphs, use [method _font_remove_texture] to remove them manually.
Removes kerning override for the pair of glyphs.
Remove language support override.
Removes script support override.
Removes specified font size from the cache entry.
Removes specified texture from font cache entry.
[b]Note:[/b] This function will not remove glyphs associated with the texture, remove them manually, using [method _font_remove_glyph].
Renders specified glyph the the font cache texture.
Renders the range of characters to the font cache texture.
If set to [code]true[/code], 8-bit antialiased glyph rendering is used, otherwise 1-bit rendering is used. Used by dynamic fonts only.
Sets the font ascent (number of pixels above the baseline).
Sets font source data, e.g contents of the dynamic font source file.
Sets the font descent (number of pixels below the baseline).
Sets bitmap font fixed size. If set to value greater than zero, same cache entry will be used for all font sizes.
If set to [code]true[/code] auto-hinting is preferred over font built-in hinting.
Sets oversampling factor, shared by all font in the TextServer.
[b]Note:[/b] This value can be automatically changed by display server.
Sets glyph advance (offset of the next glyph).
[b]Note:[/b] Advance for glyphs outlines is the same as the base glyph advance and is not saved.
Sets glyph offset from the baseline.
Sets size of the glyph.
Sets index of the cache texture containing the glyph.
Sets rectangle in the cache texture containing the glyph.
Sets font hinting mode. Used by dynamic fonts only.
Sets kerning for the pair of glyphs.
Adds override for [method _font_is_language_supported].
Sets the width of the range around the shape between the minimum and maximum representable signed distance.
Sets source font size used to generate MSDF textures.
If set to [code]true[/code], glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
Sets the font family name.
Sets font oversampling factor, if set to [code]0.0[/code] global oversampling factor is used instead. Used by dynamic fonts only.
Sets scaling factor of the color bitmap font.
Adds override for [method _font_is_script_supported].
Sets extra spacing added between glyphs in pixels.
Sets the font style flags, see [enum TextServer.FontStyle].
Sets the font style name.
Sets font cache texture image data.
Sets array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty.
Sets pixel offset of the underline below the baseline.
Sets thickness of the underline in pixels.
Sets variation coordinates for the specified font cache entry. See [method _font_supported_variation_list] for more info.
Returns the dictionary of the supported OpenType features.
Returns the dictionary of the supported OpenType variation coordinates.
Converts a number from the Western Arabic (0..9) to the numeral systems used in [code]language[/code].
Frees an object created by this [TextServer].
Returns text server features, see [enum TextServer.Feature].
Returns size of the replacement character (box with character hexadecimal code that is drawn in place of invalid characters).
Returns the name of the server interface.
Returns default TextServer database (e.g. ICU break iterators and dictionaries) filename.
Returns TextServer database (e.g. ICU break iterators and dictionaries) description.
Returns [code]true[/code] if [code]rid[/code] is valid resource owned by this text server.
Returns [code]true[/code] if the server supports a feature.
Returns [code]true[/code] if locale is right-to-left.
Loads optional TextServer database (e.g. ICU break iterators and dictionaries).
[b]Note:[/b] This function should be called before any other TextServer functions used, otherwise it won't have any effect.
Converts readable feature, variation, script or language name to OpenType tag.
Converts a number from the numeral systems used in [code]language[/code] to Western Arabic (0..9).
Returns percent sign used in the [code]language[/code].
Saves optional TextServer database (e.g. ICU break iterators and dictionaries) to the file.
[b]Note:[/b] This function is used by during project export, to include TextServer database.
Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters.
Adds text span and font to draw it to the text buffer.
Clears text buffer (removes text and inline objects).
Draw shaped text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout).
Draw the outline of the shaped text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout).
Adjusts text with to fit to specified width, returns new text width
Returns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
[b]Note:[/b] Overall ascent can be higher than font ascent, if some glyphs are displaced from the baseline.
Returns shapes of the carets corresponding to the character offset [code]position[/code] in the text. Returned caret shape is 1 pixel wide rectangle.
Returns custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.
Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
[b]Note:[/b] Overall descent can be higher than font descent, if some glyphs are displaced from the baseline.
Returns direction of the text.
Returns dominant direction of in the range of text.
Returns number of glyphs in the ellipsis.
Returns array of the glyphs in the ellipsis.
Returns position of the ellipsis.
Returns text glyphs count.
Copies text glyphs in the visual order, into preallocated array of the size returned by [method _shaped_text_get_glyph_count].
Returns composite character's bounds as offsets from the start of the line.
Breaks text to the lines and returns character ranges for each line.
Breaks text to the lines and columns. Returns character ranges for each segment.
Returns bounding rectangle of the inline object.
Returns array of inline objects.
Returns text orientation.
Sets text orientation.
Returns [code]true[/code] if text buffer is configured to display control characters.
Returns [code]true[/code] if text buffer is configured to display hexadecimal codes in place of invalid characters.
[b]Note:[/b] If set to [code]false[/code], nothing is displayed in place of invalid characters.
Returns substring buffer character range in the parent buffer.
Returns selection rectangles for the specified character range.
Returns size of the text.
Returns ellipsis and trim positions.
Returns pixel offset of the underline below the baseline.
Returns thickness of the underline.
Returns width (for horizontal layout) or height (for vertical) of the text.
Breaks text into words and returns array of character ranges.
Returns grapheme index at the specified pixel offset at the baseline, or [code]-1[/code] if none is found.
Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position.
Returns [code]true[/code] if buffer is successfully shaped.
Returns composite character end position closest to the [code]pos[/code].
Trims text if it exceeds the given width.
Returns composite character start position closest to the [code]pos[/code].
Sets new size and alignment of embedded object.
Overrides BiDi for the structured text.
Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
Sets custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.
Sets desired text direction. If set to [code]TEXT_DIRECTION_AUTO[/code], direction will be detected based on the buffer contents and current locale.
[b]Note:[/b] Direction is ignored if server does not support [code]FEATURE_BIDI_LAYOUT[/code] feature.
Sets desired text orientation.
[b]Note:[/b] Orientation is ignored if server does not support [code]FEATURE_VERTICAL_LAYOUT[/code] feature.
If set to [code]true[/code] text buffer will display control characters.
If set to [code]true[/code] text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed.
Shapes buffer if it's not shaped. Returns [code]true[/code] if the string is shaped successfully.
[b]Note:[/b] It is not necessary to call this function manually, buffer will be shaped automatically as soon as any of its output data is requested.
Copies text glyphs in the logical order, into preallocated array of the size returned by [method _shaped_text_get_glyph_count].
Returns text buffer for the substring of the text in the [code]shaped[/code] text buffer (including inline objects).
Aligns shaped text to the given tab-stops.
Updates line and word breaks.
Updates justification opportunities (spaces, kashidas, etc.).
Converts OpenType tag to readable feature, variation, script or language name.