Merge pull request #39148 from HaSa1002/rtl

Remove bbcode_text from RichTextLabel
This commit is contained in:
Rémi Verschelde 2021-09-16 23:40:00 +02:00 committed by GitHub
commit 60d67f93c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 57 additions and 58 deletions

View file

@ -5,7 +5,7 @@
</brief_description> </brief_description>
<description> <description>
Rich text can contain custom text, fonts, images and some basic formatting. The label manages these as an internal tag stack. It also adapts itself to given width/heights. Rich text can contain custom text, fonts, images and some basic formatting. The label manages these as an internal tag stack. It also adapts itself to given width/heights.
[b]Note:[/b] Assignments to [member bbcode_text] clear the tag stack and reconstruct it from the property's contents. Any edits made to [member bbcode_text] will erase previous edits made from other manual sources such as [method append_bbcode] and the [code]push_*[/code] / [method pop] methods. [b]Note:[/b] Assignments to [member text] clear the tag stack and reconstruct it from the property's contents. Any edits made to [member text] will erase previous edits made from other manual sources such as [method append_text] and the [code]push_*[/code] / [method pop] methods.
[b]Note:[/b] RichTextLabel doesn't support entangled BBCode tags. For example, instead of using [code][b]bold[i]bold italic[/b]italic[/i][/code], use [code][b]bold[i]bold italic[/i][/b][i]italic[/i][/code]. [b]Note:[/b] RichTextLabel doesn't support entangled BBCode tags. For example, instead of using [code][b]bold[i]bold italic[/b]italic[/i][/code], use [code][b]bold[i]bold italic[/i][/b][i]italic[/i][/code].
[b]Note:[/b] [code]push_*/pop[/code] functions won't affect BBCode. [b]Note:[/b] [code]push_*/pop[/code] functions won't affect BBCode.
[b]Note:[/b] Unlike [Label], RichTextLabel doesn't have a [i]property[/i] to horizontally align text to the center. Instead, enable [member bbcode_enabled] and surround the text in a [code][center][/code] tag as follows: [code][center]Example[/center][/code]. There is currently no built-in way to vertically align text either, but this can be emulated by relying on anchors/containers and the [member fit_content_height] property. [b]Note:[/b] Unlike [Label], RichTextLabel doesn't have a [i]property[/i] to horizontally align text to the center. Instead, enable [member bbcode_enabled] and surround the text in a [code][center][/code] tag as follows: [code][center]Example[/center][/code]. There is currently no built-in way to vertically align text either, but this can be emulated by relying on anchors/containers and the [member fit_content_height] property.
@ -35,18 +35,18 @@
Adds raw non-BBCode-parsed text to the tag stack. Adds raw non-BBCode-parsed text to the tag stack.
</description> </description>
</method> </method>
<method name="append_bbcode"> <method name="append_text">
<return type="int" enum="Error" /> <return type="int" enum="Error" />
<argument index="0" name="bbcode" type="String" /> <argument index="0" name="bbcode" type="String" />
<description> <description>
Parses [code]bbcode[/code] and adds tags to the tag stack as needed. Returns the result of the parsing, [constant OK] if successful. Parses [code]bbcode[/code] and adds tags to the tag stack as needed. Returns the result of the parsing, [constant OK] if successful.
[b]Note:[/b] Using this method, you can't close a tag that was opened in a previous [method append_bbcode] call. This is done to improve performance, especially when updating large RichTextLabels since rebuilding the whole BBCode every time would be slower. If you absolutely need to close a tag in a future method call, append the [member bbcode_text] instead of using [method append_bbcode]. [b]Note:[/b] Using this method, you can't close a tag that was opened in a previous [method append_text] call. This is done to improve performance, especially when updating large RichTextLabels since rebuilding the whole BBCode every time would be slower. If you absolutely need to close a tag in a future method call, append the [member text] instead of using [method append_text].
</description> </description>
</method> </method>
<method name="clear"> <method name="clear">
<return type="void" /> <return type="void" />
<description> <description>
Clears the tag stack and sets [member bbcode_text] to an empty string. Clears the tag stack and sets [member text] to an empty string.
</description> </description>
</method> </method>
<method name="get_content_height" qualifiers="const"> <method name="get_content_height" qualifiers="const">
@ -67,6 +67,12 @@
Returns the total number of paragraphs (newlines or [code]p[/code] tags in the tag stack's text tags). Considers wrapped text as one paragraph. Returns the total number of paragraphs (newlines or [code]p[/code] tags in the tag stack's text tags). Considers wrapped text as one paragraph.
</description> </description>
</method> </method>
<method name="get_parsed_text" qualifiers="const">
<return type="String" />
<description>
Returns the text without BBCode mark-up.
</description>
</method>
<method name="get_selected_text" qualifiers="const"> <method name="get_selected_text" qualifiers="const">
<return type="String" /> <return type="String" />
<description> <description>
@ -126,7 +132,7 @@
<return type="int" enum="Error" /> <return type="int" enum="Error" />
<argument index="0" name="bbcode" type="String" /> <argument index="0" name="bbcode" type="String" />
<description> <description>
The assignment version of [method append_bbcode]. Clears the tag stack and inserts the new content. Returns [constant OK] if parses [code]bbcode[/code] successfully. The assignment version of [method append_text]. Clears the tag stack and inserts the new content. Returns [constant OK] if parses [code]bbcode[/code] successfully.
</description> </description>
</method> </method>
<method name="parse_expressions_for_values"> <method name="parse_expressions_for_values">
@ -368,10 +374,6 @@
<member name="bbcode_enabled" type="bool" setter="set_use_bbcode" getter="is_using_bbcode" default="false"> <member name="bbcode_enabled" type="bool" setter="set_use_bbcode" getter="is_using_bbcode" default="false">
If [code]true[/code], the label uses BBCode formatting. If [code]true[/code], the label uses BBCode formatting.
</member> </member>
<member name="bbcode_text" type="String" setter="set_bbcode" getter="get_bbcode" default="&quot;&quot;">
The label's text in BBCode format. Is not representative of manual modifications to the internal tag stack. Erases changes made by other methods when edited.
[b]Note:[/b] It is unadvised to use the [code]+=[/code] operator with [code]bbcode_text[/code] (e.g. [code]bbcode_text += "some string"[/code]) as it replaces the whole text and can cause slowdowns. Use [method append_bbcode] for adding text instead, unless you absolutely need to close a tag that was opened in an earlier method call.
</member>
<member name="custom_effects" type="Array" setter="set_effects" getter="get_effects" default="[]"> <member name="custom_effects" type="Array" setter="set_effects" getter="get_effects" default="[]">
The currently installed custom effects. This is an array of [RichTextEffect]s. The currently installed custom effects. This is an array of [RichTextEffect]s.
To add a custom effect, it's more convenient to use [method install_effect]. To add a custom effect, it's more convenient to use [method install_effect].
@ -413,8 +415,8 @@
The number of spaces associated with a single tab length. Does not affect [code]\t[/code] in text tags, only indent tags. The number of spaces associated with a single tab length. Does not affect [code]\t[/code] in text tags, only indent tags.
</member> </member>
<member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;"> <member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
The raw text of the label. The label's text in BBCode format. Is not representative of manual modifications to the internal tag stack. Erases changes made by other methods when edited.
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]. [b]Note:[/b] If [member bbcode_enabled] is [code]true[/code], it is unadvised to use the [code]+=[/code] operator with [code]text[/code] (e.g. [code]text += "some string"[/code]) as it replaces the whole text and can cause slowdowns. Use [method append_text] for adding text instead, unless you absolutely need to close a tag that was opened in an earlier method call.
</member> </member>
<member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0"> <member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0">
Base text writing direction. Base text writing direction.

View file

@ -480,7 +480,7 @@ void EditorHelp::_update_doc() {
} }
class_desc->push_color(symbol_color); class_desc->push_color(symbol_color);
class_desc->append_bbcode("[url=" + link + "]" + linktxt + "[/url]"); class_desc->append_text("[url=" + link + "]" + linktxt + "[/url]");
class_desc->pop(); class_desc->pop();
class_desc->add_newline(); class_desc->add_newline();
} }
@ -1180,9 +1180,9 @@ void EditorHelp::_update_doc() {
class_desc->add_text(" "); class_desc->add_text(" ");
class_desc->push_color(comment_color); class_desc->push_color(comment_color);
if (cd.is_script_doc) { if (cd.is_script_doc) {
class_desc->append_bbcode(TTR("There is currently no description for this property.")); class_desc->append_text(TTR("There is currently no description for this property."));
} else { } else {
class_desc->append_bbcode(TTR("There is currently no description for this property. Please help us by [color=$color][url=$url]contributing one[/url][/color]!").replace("$url", CONTRIBUTE_URL).replace("$color", link_color_text)); class_desc->append_text(TTR("There is currently no description for this property. Please help us by [color=$color][url=$url]contributing one[/url][/color]!").replace("$url", CONTRIBUTE_URL).replace("$color", link_color_text));
} }
class_desc->pop(); class_desc->pop();
} }
@ -1229,7 +1229,7 @@ void EditorHelp::_update_doc() {
class_desc->push_font(doc_font); class_desc->push_font(doc_font);
class_desc->push_indent(1); class_desc->push_indent(1);
if (methods_filtered[i].errors_returned.size()) { if (methods_filtered[i].errors_returned.size()) {
class_desc->append_bbcode(TTR("Error codes returned:")); class_desc->append_text(TTR("Error codes returned:"));
class_desc->add_newline(); class_desc->add_newline();
class_desc->push_list(0, RichTextLabel::LIST_DOTS, false); class_desc->push_list(0, RichTextLabel::LIST_DOTS, false);
for (int j = 0; j < methods_filtered[i].errors_returned.size(); j++) { for (int j = 0; j < methods_filtered[i].errors_returned.size(); j++) {
@ -1246,7 +1246,7 @@ void EditorHelp::_update_doc() {
} }
class_desc->push_bold(); class_desc->push_bold();
class_desc->append_bbcode(text); class_desc->append_text(text);
class_desc->pop(); class_desc->pop();
} }
class_desc->pop(); class_desc->pop();
@ -1260,9 +1260,9 @@ void EditorHelp::_update_doc() {
class_desc->add_text(" "); class_desc->add_text(" ");
class_desc->push_color(comment_color); class_desc->push_color(comment_color);
if (cd.is_script_doc) { if (cd.is_script_doc) {
class_desc->append_bbcode(TTR("There is currently no description for this method.")); class_desc->append_text(TTR("There is currently no description for this method."));
} else { } else {
class_desc->append_bbcode(TTR("There is currently no description for this method. Please help us by [color=$color][url=$url]contributing one[/url][/color]!").replace("$url", CONTRIBUTE_URL).replace("$color", link_color_text)); class_desc->append_text(TTR("There is currently no description for this method. Please help us by [color=$color][url=$url]contributing one[/url][/color]!").replace("$url", CONTRIBUTE_URL).replace("$color", link_color_text));
} }
class_desc->pop(); class_desc->pop();
} }

View file

@ -230,7 +230,7 @@ void EditorAssetLibraryItemDescription::configure(const String &p_title, int p_a
description->add_text(TTR("View Files")); description->add_text(TTR("View Files"));
description->pop(); description->pop();
description->add_text("\n" + TTR("Description:") + "\n\n"); description->add_text("\n" + TTR("Description:") + "\n\n");
description->append_bbcode(p_description); description->append_text(p_description);
set_title(p_title); set_title(p_title);
} }

View file

@ -1374,8 +1374,8 @@ void RichTextLabel::_notification(int p_what) {
} break; } break;
case NOTIFICATION_THEME_CHANGED: case NOTIFICATION_THEME_CHANGED:
case NOTIFICATION_ENTER_TREE: { case NOTIFICATION_ENTER_TREE: {
if (bbcode != "") { if (text != "") {
set_bbcode(bbcode); set_text(text);
} }
main->first_invalid_line = 0; //invalidate ALL main->first_invalid_line = 0; //invalidate ALL
@ -2767,10 +2767,10 @@ bool RichTextLabel::is_scroll_following() const {
Error RichTextLabel::parse_bbcode(const String &p_bbcode) { Error RichTextLabel::parse_bbcode(const String &p_bbcode) {
clear(); clear();
return append_bbcode(p_bbcode); return append_text(p_bbcode);
} }
Error RichTextLabel::append_bbcode(const String &p_bbcode) { Error RichTextLabel::append_text(const String &p_bbcode) {
int pos = 0; int pos = 0;
List<String> tag_stack; List<String> tag_stack;
@ -3824,8 +3824,8 @@ int RichTextLabel::get_selection_to() const {
return selection.to_frame->lines[selection.to_line].char_offset + selection.to_char - 1; return selection.to_frame->lines[selection.to_line].char_offset + selection.to_char - 1;
} }
void RichTextLabel::set_bbcode(const String &p_bbcode) { void RichTextLabel::set_text(const String &p_bbcode) {
bbcode = p_bbcode; text = p_bbcode;
if (is_inside_tree() && use_bbcode) { if (is_inside_tree() && use_bbcode) {
parse_bbcode(p_bbcode); parse_bbcode(p_bbcode);
} else { // raw text } else { // raw text
@ -3834,8 +3834,8 @@ void RichTextLabel::set_bbcode(const String &p_bbcode) {
} }
} }
String RichTextLabel::get_bbcode() const { String RichTextLabel::get_text() const {
return bbcode; return text;
} }
void RichTextLabel::set_use_bbcode(bool p_enable) { void RichTextLabel::set_use_bbcode(bool p_enable) {
@ -3843,15 +3843,15 @@ void RichTextLabel::set_use_bbcode(bool p_enable) {
return; return;
} }
use_bbcode = p_enable; use_bbcode = p_enable;
set_bbcode(bbcode);
notify_property_list_changed(); notify_property_list_changed();
set_text(text);
} }
bool RichTextLabel::is_using_bbcode() const { bool RichTextLabel::is_using_bbcode() const {
return use_bbcode; return use_bbcode;
} }
String RichTextLabel::get_text() { String RichTextLabel::get_parsed_text() const {
String text = ""; String text = "";
Item *it = main; Item *it = main;
while (it) { while (it) {
@ -3870,11 +3870,6 @@ String RichTextLabel::get_text() {
return text; return text;
} }
void RichTextLabel::set_text(const String &p_string) {
clear();
add_text(p_string);
}
void RichTextLabel::set_text_direction(Control::TextDirection p_text_direction) { void RichTextLabel::set_text_direction(Control::TextDirection p_text_direction) {
ERR_FAIL_COND((int)p_text_direction < -1 || (int)p_text_direction > 3); ERR_FAIL_COND((int)p_text_direction < -1 || (int)p_text_direction > 3);
if (text_direction != p_text_direction) { if (text_direction != p_text_direction) {
@ -3948,8 +3943,8 @@ float RichTextLabel::get_percent_visible() const {
void RichTextLabel::set_effects(Array p_effects) { void RichTextLabel::set_effects(Array p_effects) {
custom_effects = p_effects; custom_effects = p_effects;
if ((bbcode != "") && use_bbcode) { if ((text != "") && use_bbcode) {
parse_bbcode(bbcode); parse_bbcode(text);
} }
} }
@ -3963,8 +3958,8 @@ void RichTextLabel::install_effect(const Variant effect) {
if (rteffect.is_valid()) { if (rteffect.is_valid()) {
custom_effects.push_back(effect); custom_effects.push_back(effect);
if ((bbcode != "") && use_bbcode) { if ((text != "") && use_bbcode) {
parse_bbcode(bbcode); parse_bbcode(text);
} }
} }
} }
@ -3977,14 +3972,20 @@ int RichTextLabel::get_content_height() const {
return total_height; return total_height;
} }
void RichTextLabel::_validate_property(PropertyInfo &property) const { #ifndef DISABLE_DEPRECATED
if (!use_bbcode && property.name == "bbcode_text") { // People will be very angry, if their texts get erased, because of #39148. (3.x -> 4.0)
property.usage = PROPERTY_USAGE_NOEDITOR; // Altough some people may not used bbcode_text, so we only overwrite, if bbcode_text is not empty
bool RichTextLabel::_set(const StringName &p_name, const Variant &p_value) {
if (p_name == "bbcode_text" && !((String)p_value).is_empty()) {
set_text(p_value);
return true;
} }
return false;
} }
#endif
void RichTextLabel::_bind_methods() { void RichTextLabel::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_text"), &RichTextLabel::get_text); ClassDB::bind_method(D_METHOD("get_parsed_text"), &RichTextLabel::get_parsed_text);
ClassDB::bind_method(D_METHOD("add_text", "text"), &RichTextLabel::add_text); ClassDB::bind_method(D_METHOD("add_text", "text"), &RichTextLabel::add_text);
ClassDB::bind_method(D_METHOD("set_text", "text"), &RichTextLabel::set_text); ClassDB::bind_method(D_METHOD("set_text", "text"), &RichTextLabel::set_text);
ClassDB::bind_method(D_METHOD("add_image", "image", "width", "height", "color", "inline_align"), &RichTextLabel::add_image, DEFVAL(0), DEFVAL(0), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(INLINE_ALIGN_CENTER)); ClassDB::bind_method(D_METHOD("add_image", "image", "width", "height", "color", "inline_align"), &RichTextLabel::add_image, DEFVAL(0), DEFVAL(0), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(INLINE_ALIGN_CENTER));
@ -4062,10 +4063,9 @@ void RichTextLabel::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_selected_text"), &RichTextLabel::get_selected_text); ClassDB::bind_method(D_METHOD("get_selected_text"), &RichTextLabel::get_selected_text);
ClassDB::bind_method(D_METHOD("parse_bbcode", "bbcode"), &RichTextLabel::parse_bbcode); ClassDB::bind_method(D_METHOD("parse_bbcode", "bbcode"), &RichTextLabel::parse_bbcode);
ClassDB::bind_method(D_METHOD("append_bbcode", "bbcode"), &RichTextLabel::append_bbcode); ClassDB::bind_method(D_METHOD("append_text", "bbcode"), &RichTextLabel::append_text);
ClassDB::bind_method(D_METHOD("set_bbcode", "text"), &RichTextLabel::set_bbcode); ClassDB::bind_method(D_METHOD("get_text"), &RichTextLabel::get_text);
ClassDB::bind_method(D_METHOD("get_bbcode"), &RichTextLabel::get_bbcode);
ClassDB::bind_method(D_METHOD("set_visible_characters", "amount"), &RichTextLabel::set_visible_characters); ClassDB::bind_method(D_METHOD("set_visible_characters", "amount"), &RichTextLabel::set_visible_characters);
ClassDB::bind_method(D_METHOD("get_visible_characters"), &RichTextLabel::get_visible_characters); ClassDB::bind_method(D_METHOD("get_visible_characters"), &RichTextLabel::get_visible_characters);
@ -4092,16 +4092,13 @@ void RichTextLabel::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_effects"), &RichTextLabel::get_effects); ClassDB::bind_method(D_METHOD("get_effects"), &RichTextLabel::get_effects);
ClassDB::bind_method(D_METHOD("install_effect", "effect"), &RichTextLabel::install_effect); ClassDB::bind_method(D_METHOD("install_effect", "effect"), &RichTextLabel::install_effect);
ADD_GROUP("BBCode", "bbcode_");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "bbcode_enabled"), "set_use_bbcode", "is_using_bbcode");
ADD_PROPERTY(PropertyInfo(Variant::STRING, "bbcode_text", PROPERTY_HINT_MULTILINE_TEXT), "set_bbcode", "get_bbcode");
ADD_PROPERTY(PropertyInfo(Variant::INT, "visible_characters", PROPERTY_HINT_RANGE, "-1,128000,1"), "set_visible_characters", "get_visible_characters"); ADD_PROPERTY(PropertyInfo(Variant::INT, "visible_characters", PROPERTY_HINT_RANGE, "-1,128000,1"), "set_visible_characters", "get_visible_characters");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "percent_visible", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_percent_visible", "get_percent_visible"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "percent_visible", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_percent_visible", "get_percent_visible");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "meta_underlined"), "set_meta_underline", "is_meta_underlined"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "meta_underlined"), "set_meta_underline", "is_meta_underlined");
ADD_PROPERTY(PropertyInfo(Variant::INT, "tab_size", PROPERTY_HINT_RANGE, "0,24,1"), "set_tab_size", "get_tab_size"); ADD_PROPERTY(PropertyInfo(Variant::INT, "tab_size", PROPERTY_HINT_RANGE, "0,24,1"), "set_tab_size", "get_tab_size");
ADD_PROPERTY(PropertyInfo(Variant::STRING, "text", PROPERTY_HINT_MULTILINE_TEXT), "set_text", "get_text"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "text", PROPERTY_HINT_MULTILINE_TEXT), "set_text", "get_text");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "bbcode_enabled"), "set_use_bbcode", "is_using_bbcode");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fit_content_height"), "set_fit_content_height", "is_fit_content_height_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fit_content_height"), "set_fit_content_height", "is_fit_content_height_enabled");

View file

@ -85,7 +85,6 @@ public:
protected: protected:
void _notification(int p_what); void _notification(int p_what);
static void _bind_methods(); static void _bind_methods();
void _validate_property(PropertyInfo &property) const override;
private: private:
struct Item; struct Item;
@ -452,16 +451,19 @@ private:
virtual Dictionary parse_expressions_for_values(Vector<String> p_expressions); virtual Dictionary parse_expressions_for_values(Vector<String> p_expressions);
void _draw_fbg_boxes(RID p_ci, RID p_rid, Vector2 line_off, Item *it_from, Item *it_to, int start, int end, int fbg_flag); void _draw_fbg_boxes(RID p_ci, RID p_rid, Vector2 line_off, Item *it_from, Item *it_to, int start, int end, int fbg_flag);
#ifndef DISABLE_DEPRECATED
// Kept for compatibility from 3.x to 4.0.
bool _set(const StringName &p_name, const Variant &p_value);
#endif
bool use_bbcode = false; bool use_bbcode = false;
String bbcode; String text;
int fixed_width = -1; int fixed_width = -1;
bool fit_content_height = false; bool fit_content_height = false;
public: public:
String get_text(); String get_parsed_text() const;
void add_text(const String &p_text); void add_text(const String &p_text);
void add_image(const Ref<Texture2D> &p_image, const int p_width = 0, const int p_height = 0, const Color &p_color = Color(1.0, 1.0, 1.0), InlineAlign p_align = INLINE_ALIGN_CENTER); void add_image(const Ref<Texture2D> &p_image, const int p_width = 0, const int p_height = 0, const Color &p_color = Color(1.0, 1.0, 1.0), InlineAlign p_align = INLINE_ALIGN_CENTER);
void add_newline(); void add_newline();
@ -548,15 +550,13 @@ public:
void selection_copy(); void selection_copy();
Error parse_bbcode(const String &p_bbcode); Error parse_bbcode(const String &p_bbcode);
Error append_bbcode(const String &p_bbcode); Error append_text(const String &p_bbcode);
void set_use_bbcode(bool p_enable); void set_use_bbcode(bool p_enable);
bool is_using_bbcode() const; bool is_using_bbcode() const;
void set_bbcode(const String &p_bbcode); void set_text(const String &p_bbcode);
String get_bbcode() const; String get_text() const;
void set_text(const String &p_string);
void set_text_direction(TextDirection p_text_direction); void set_text_direction(TextDirection p_text_direction);
TextDirection get_text_direction() const; TextDirection get_text_direction() const;