From 6ab672d1ef7ece5c3019d46aeb98df3686f37e26 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu, 4 Nov 2021 14:33:37 +0200 Subject: Implement text-to-speech support on Android, iOS, HTML5, Linux, macOS and Windows. Implement TextServer word break method. --- servers/text/text_server_extension.cpp | 10 ++++++++++ servers/text/text_server_extension.h | 3 +++ 2 files changed, 13 insertions(+) (limited to 'servers/text') diff --git a/servers/text/text_server_extension.cpp b/servers/text/text_server_extension.cpp index 001706bb6f..005cb68302 100644 --- a/servers/text/text_server_extension.cpp +++ b/servers/text/text_server_extension.cpp @@ -293,6 +293,8 @@ void TextServerExtension::_bind_methods() { GDVIRTUAL_BIND(strip_diacritics, "string"); + GDVIRTUAL_BIND(string_get_word_breaks, "string", "language"); + GDVIRTUAL_BIND(string_to_upper, "string", "language"); GDVIRTUAL_BIND(string_to_lower, "string", "language"); @@ -1503,6 +1505,14 @@ Array TextServerExtension::parse_structured_text(StructuredTextParser p_parser_t return Array(); } +PackedInt32Array TextServerExtension::string_get_word_breaks(const String &p_string, const String &p_language) const { + PackedInt32Array ret; + if (GDVIRTUAL_CALL(string_get_word_breaks, p_string, p_language, ret)) { + return ret; + } + return PackedInt32Array(); +} + TextServerExtension::TextServerExtension() { //NOP } diff --git a/servers/text/text_server_extension.h b/servers/text/text_server_extension.h index ce781097f3..7b7fc61ed7 100644 --- a/servers/text/text_server_extension.h +++ b/servers/text/text_server_extension.h @@ -485,6 +485,9 @@ public: virtual String strip_diacritics(const String &p_string) const override; GDVIRTUAL1RC(String, strip_diacritics, const String &); + virtual PackedInt32Array string_get_word_breaks(const String &p_string, const String &p_language = "") const override; + GDVIRTUAL2RC(PackedInt32Array, string_get_word_breaks, const String &, const String &); + virtual String string_to_upper(const String &p_string, const String &p_language = "") const override; virtual String string_to_lower(const String &p_string, const String &p_language = "") const override; GDVIRTUAL2RC(String, string_to_upper, const String &, const String &); -- cgit v1.2.3