summaryrefslogtreecommitdiff
path: root/servers/text
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-11-09 00:13:59 +0100
committerGitHub <noreply@github.com>2021-11-09 00:13:59 +0100
commit59686536622473e14b253268354ecfbae63d0d58 (patch)
treee5e80d83546613dc9aba31624e196bf0920f2905 /servers/text
parentd9a74fd07f34ac756e6652156b14bb7acd13038f (diff)
parentdaa613333ec4ac53964e2ba3f22f10e0f5212991 (diff)
Merge pull request #46721 from bruvzg/custom_word_break_punct
Diffstat (limited to 'servers/text')
-rw-r--r--servers/text/text_server_extension.cpp15
-rw-r--r--servers/text/text_server_extension.h5
2 files changed, 20 insertions, 0 deletions
diff --git a/servers/text/text_server_extension.cpp b/servers/text/text_server_extension.cpp
index a830b8353a..0a7523e33a 100644
--- a/servers/text/text_server_extension.cpp
+++ b/servers/text/text_server_extension.cpp
@@ -194,6 +194,9 @@ void TextServerExtension::_bind_methods() {
GDVIRTUAL_BIND(_shaped_text_set_bidi_override, "shaped", "override");
+ GDVIRTUAL_BIND(_shaped_text_set_custom_punctuation, "shaped", "punct");
+ GDVIRTUAL_BIND(_shaped_text_get_custom_punctuation, "shaped");
+
GDVIRTUAL_BIND(_shaped_text_set_orientation, "shaped", "orientation");
GDVIRTUAL_BIND(_shaped_text_get_orientation, "shaped");
@@ -951,6 +954,18 @@ void TextServerExtension::shaped_text_set_bidi_override(RID p_shaped, const Arra
GDVIRTUAL_CALL(_shaped_text_set_bidi_override, p_shaped, p_override);
}
+void TextServerExtension::shaped_text_set_custom_punctuation(RID p_shaped, const String &p_punct) {
+ GDVIRTUAL_CALL(_shaped_text_set_custom_punctuation, p_shaped, p_punct);
+}
+
+String TextServerExtension::shaped_text_get_custom_punctuation(RID p_shaped) const {
+ String ret;
+ if (GDVIRTUAL_CALL(_shaped_text_get_custom_punctuation, p_shaped, ret)) {
+ return ret;
+ }
+ return String();
+}
+
void TextServerExtension::shaped_text_set_preserve_invalid(RID p_shaped, bool p_enabled) {
GDVIRTUAL_CALL(_shaped_text_set_preserve_invalid, p_shaped, p_enabled);
}
diff --git a/servers/text/text_server_extension.h b/servers/text/text_server_extension.h
index fd3bb45eaf..e419b4055d 100644
--- a/servers/text/text_server_extension.h
+++ b/servers/text/text_server_extension.h
@@ -316,6 +316,11 @@ public:
virtual void shaped_text_set_bidi_override(RID p_shaped, const Array &p_override) override;
GDVIRTUAL2(_shaped_text_set_bidi_override, RID, const Array &);
+ virtual void shaped_text_set_custom_punctuation(RID p_shaped, const String &p_punct) override;
+ virtual String shaped_text_get_custom_punctuation(RID p_shaped) const override;
+ GDVIRTUAL2(_shaped_text_set_custom_punctuation, RID, String);
+ GDVIRTUAL1RC(String, _shaped_text_get_custom_punctuation, RID);
+
virtual void shaped_text_set_orientation(RID p_shaped, Orientation p_orientation = ORIENTATION_HORIZONTAL) override;
virtual Orientation shaped_text_get_orientation(RID p_shaped) const override;
GDVIRTUAL2(_shaped_text_set_orientation, RID, Orientation);