From 6b6f101983bcbf1513156046108edc2afe24982c Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Fri, 2 Oct 2020 15:02:02 +0300 Subject: [Complex Text Layouts] Refactor RichTextLabel. --- doc/classes/CharFXTransform.xml | 31 +++---- doc/classes/RichTextLabel.xml | 191 ++++++++++++++++++++++++++++++++++------ 2 files changed, 175 insertions(+), 47 deletions(-) (limited to 'doc/classes') diff --git a/doc/classes/CharFXTransform.xml b/doc/classes/CharFXTransform.xml index d1759adf30..b4cb110337 100644 --- a/doc/classes/CharFXTransform.xml +++ b/doc/classes/CharFXTransform.xml @@ -13,24 +13,6 @@ - - The index of the current character (starting from 0). Setting this property won't affect drawing. - - - The Unicode codepoint the character will use. This only affects non-whitespace characters. [method @GDScript.ord] can be useful here. For example, the following will replace all characters with asterisks: - [codeblocks] - [gdscript] - # `char_fx` is the CharFXTransform parameter from `_process_custom_fx()`. - # See the RichTextEffect documentation for details. - char_fx.character = ord("*") - [/gdscript] - [csharp] - // `char_fx` is the CharFXTransform parameter from `_process_custom_fx()`. - // See the RichTextEffect documentation for details. - charFx.Character = char.GetNumericValue('*'); - [/csharp] - [/codeblocks] - The color the character will be drawn with. @@ -45,11 +27,20 @@ {"foo": "hello", "bar": true, "baz": 42, "color": Color(1, 1, 1, 1)} [/codeblock] + + Font resource used to render glyph. + + + Font specific glyph index. + The position offset the character will be drawn with (in pixels). - - The index of the current character (starting from 0). Setting this property won't affect drawing. + + If [code]ture[/code], FX transform is called for outline drawing. Setting this property won't affect drawing. + + + Absolute character range in the string, corresponding to the glyph. Setting this property won't affect drawing. If [code]true[/code], the character will be drawn. If [code]false[/code], the character will be hidden. Characters around hidden characters will reflow to take the space of hidden characters. If this is not desired, set their [member color] to [code]Color(1, 1, 1, 0)[/code] instead. diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index faf0d97766..0fd440fa75 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -25,6 +25,8 @@ + + Adds an image's opening and closing tags to the tag stack, optionally providing a [code]width[/code] and [code]height[/code] to resize the image and a [code]color[/code] to tint the image. If [code]width[/code] or [code]height[/code] is set to 0, the image size will be adjusted in order to keep the original aspect ratio. @@ -132,15 +134,6 @@ Terminates the current tag. Use after [code]push_*[/code] methods to close BBCodes manually. Does not need to follow [code]add_*[/code] methods. - - - - - - - Adds an [code][align][/code] tag based on the given [code]align[/code] value. See [enum Align] for possible values. - - @@ -180,6 +173,24 @@ Adds a [code][font][/code] tag to the tag stack. Overrides default fonts for its duration. + + + + + + + Adds a [code][ot_feature][/code] tag to the tag stack. Overrides default OpenType font feature for its duration. + + + + + + + + + Adds a [code][font_size][/code] tag to the tag stack. Overrides default font size for its duration. + + @@ -199,10 +210,14 @@ - + + + + + - Adds a [code][list][/code] tag to the tag stack. Similar to the BBCodes [code][ol][/code] or [code][ul][/code], but supports more list types. Not fully implemented! + Adds [code][ol][/code] or [code][ul][/code] tag to the tag stack. Multiplies [code]level[/code] by current [member tab_size] to determine new margin length. @@ -228,6 +243,39 @@ Adds a [code][font][/code] tag with a normal font to the tag stack. + + + + + + + Adds a [code][outline_color][/code] tag to the tag stack. Adds text outline for its duration. + + + + + + + + + Adds a [code][outline_size][/code] tag to the tag stack. Overrides default text outline size for its duration. + + + + + + + + + + + + + + + Adds a [code][p][/code] tag to the tag stack. + + @@ -240,8 +288,10 @@ + + - Adds a [code][table=columns][/code] tag to the tag stack. + Adds a [code][table=columns,inline_align][/code] tag to the tag stack. @@ -270,6 +320,46 @@ Scrolls the window's top line to match [code]line[/code]. + + + + + + + Sets color of a table cell border. + + + + + + + + + Sets inner padding of a table cell. + + + + + + + + + + + Sets color of a table cell. Separate colors for alternating rows can be specified. + + + + + + + + + + + Sets minimum and maximum size overrides for a table cell. + + @@ -302,6 +392,9 @@ If [code]true[/code], the label's height will be automatically updated to fit its content. [b]Note:[/b] This property is used as a workaround to fix issues with [RichTextLabel] in [Container]s, but it's unreliable in some cases and will be removed in future versions. + + Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. + If [code]true[/code], the label underlines meta tags such as [code][url]{text}[/url][/code]. @@ -322,6 +415,12 @@ If [code]true[/code], the label allows text selection. + + Set BiDi algorithm override for the structured text. + + + Set additional options for BiDi override. + The number of spaces associated with a single tab length. Does not affect [code]\t[/code] in text tags, only indent tags. @@ -329,6 +428,9 @@ The raw text of the label. When set, clears the tag stack and adds a raw text tag to the top of it. Does not parse BBCodes. Does not modify [member bbcode_text]. + + Base text writing direction. + The restricted number of characters to display in the label. If [code]-1[/code], all characters will be displayed. @@ -375,7 +477,10 @@ Each list item has a letter marker. - + + Each list item has a roman number marker. + + Each list item has a filled circle marker. @@ -388,42 +493,56 @@ - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + The font used for bold text. + + The font size used for bold text. + The font used for bold italics text. + + The font size used for bold italics text. + The default text color. @@ -439,18 +558,27 @@ The font used for italics text. + + The font size used for italics text. + The vertical space between lines. The font used for monospace text. + + The font size used for monospace text. + The normal background for the [RichTextLabel]. The default text font. + + The default text font size. + The color of the selection box. @@ -463,9 +591,18 @@ The vertical offset of the font's shadow. + + The default cell border color. + + + The default background color for even rows. + The horizontal separation of elements in a table. + + The default background color for odd rows. + The vertical separation of elements in a table. -- cgit v1.2.3