summaryrefslogtreecommitdiffstats
path: root/servers/text
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2023-10-01 13:39:13 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2023-12-04 08:21:42 +0200
commit56579f397decc0d399ff3ca49f0a3abeadda682b (patch)
tree7782d59d8b691719c136a36e733cdb2cb4cf4cf9 /servers/text
parentd76c1d0e516fedc535a2e394ab780cac79203477 (diff)
downloadredot-engine-56579f397decc0d399ff3ca49f0a3abeadda682b.tar.gz
[Text Overrun] Add option to set custom ellipsis character, add support for system font fallback.
Diffstat (limited to 'servers/text')
-rw-r--r--servers/text/text_server_extension.cpp13
-rw-r--r--servers/text/text_server_extension.h5
2 files changed, 18 insertions, 0 deletions
diff --git a/servers/text/text_server_extension.cpp b/servers/text/text_server_extension.cpp
index d6844bba6a..ec622cdb1c 100644
--- a/servers/text/text_server_extension.cpp
+++ b/servers/text/text_server_extension.cpp
@@ -236,6 +236,9 @@ void TextServerExtension::_bind_methods() {
GDVIRTUAL_BIND(_shaped_text_set_custom_punctuation, "shaped", "punct");
GDVIRTUAL_BIND(_shaped_text_get_custom_punctuation, "shaped");
+ GDVIRTUAL_BIND(_shaped_text_set_custom_ellipsis, "shaped", "char");
+ GDVIRTUAL_BIND(_shaped_text_get_custom_ellipsis, "shaped");
+
GDVIRTUAL_BIND(_shaped_text_set_orientation, "shaped", "orientation");
GDVIRTUAL_BIND(_shaped_text_get_orientation, "shaped");
@@ -1058,6 +1061,16 @@ String TextServerExtension::shaped_text_get_custom_punctuation(const RID &p_shap
return ret;
}
+void TextServerExtension::shaped_text_set_custom_ellipsis(const RID &p_shaped, int64_t p_char) {
+ GDVIRTUAL_CALL(_shaped_text_set_custom_ellipsis, p_shaped, p_char);
+}
+
+int64_t TextServerExtension::shaped_text_get_custom_ellipsis(const RID &p_shaped) const {
+ int64_t ret = 0;
+ GDVIRTUAL_CALL(_shaped_text_get_custom_ellipsis, p_shaped, ret);
+ return ret;
+}
+
void TextServerExtension::shaped_text_set_preserve_invalid(const 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 7605ed480d..d0d7ee31ad 100644
--- a/servers/text/text_server_extension.h
+++ b/servers/text/text_server_extension.h
@@ -391,6 +391,11 @@ public:
GDVIRTUAL2(_shaped_text_set_custom_punctuation, RID, String);
GDVIRTUAL1RC(String, _shaped_text_get_custom_punctuation, RID);
+ virtual void shaped_text_set_custom_ellipsis(const RID &p_shaped, int64_t p_char) override;
+ virtual int64_t shaped_text_get_custom_ellipsis(const RID &p_shaped) const override;
+ GDVIRTUAL2(_shaped_text_set_custom_ellipsis, RID, int64_t);
+ GDVIRTUAL1RC(int64_t, _shaped_text_get_custom_ellipsis, RID);
+
virtual void shaped_text_set_orientation(const RID &p_shaped, Orientation p_orientation = ORIENTATION_HORIZONTAL) override;
virtual Orientation shaped_text_get_orientation(const RID &p_shaped) const override;
GDVIRTUAL2(_shaped_text_set_orientation, RID, Orientation);