diff options
Diffstat (limited to 'servers/text')
-rw-r--r-- | servers/text/text_server_extension.cpp | 9 | ||||
-rw-r--r-- | servers/text/text_server_extension.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/servers/text/text_server_extension.cpp b/servers/text/text_server_extension.cpp index a51b62e730..a2195d1ddf 100644 --- a/servers/text/text_server_extension.cpp +++ b/servers/text/text_server_extension.cpp @@ -194,6 +194,7 @@ void TextServerExtension::_bind_methods() { GDVIRTUAL_BIND(_shaped_text_set_direction, "shaped", "direction"); GDVIRTUAL_BIND(_shaped_text_get_direction, "shaped"); + GDVIRTUAL_BIND(_shaped_text_get_inferred_direction, "shaped"); GDVIRTUAL_BIND(_shaped_text_set_bidi_override, "shaped", "override"); @@ -954,6 +955,14 @@ TextServer::Direction TextServerExtension::shaped_text_get_direction(RID p_shape return TextServer::Direction::DIRECTION_AUTO; } +TextServer::Direction TextServerExtension::shaped_text_get_inferred_direction(RID p_shaped) const { + int ret; + if (GDVIRTUAL_CALL(_shaped_text_get_inferred_direction, p_shaped, ret)) { + return (TextServer::Direction)ret; + } + return TextServer::Direction::DIRECTION_LTR; +} + void TextServerExtension::shaped_text_set_orientation(RID p_shaped, TextServer::Orientation p_orientation) { GDVIRTUAL_CALL(_shaped_text_set_orientation, p_shaped, p_orientation); } diff --git a/servers/text/text_server_extension.h b/servers/text/text_server_extension.h index 9b456c2dd7..77f2ced951 100644 --- a/servers/text/text_server_extension.h +++ b/servers/text/text_server_extension.h @@ -315,8 +315,10 @@ public: virtual void shaped_text_set_direction(RID p_shaped, Direction p_direction = DIRECTION_AUTO) override; virtual Direction shaped_text_get_direction(RID p_shaped) const override; + virtual Direction shaped_text_get_inferred_direction(RID p_shaped) const override; GDVIRTUAL2(_shaped_text_set_direction, RID, Direction); GDVIRTUAL1RC(/*Direction*/ int, _shaped_text_get_direction, RID); + GDVIRTUAL1RC(/*Direction*/ int, _shaped_text_get_inferred_direction, RID); virtual void shaped_text_set_bidi_override(RID p_shaped, const Array &p_override) override; GDVIRTUAL2(_shaped_text_set_bidi_override, RID, const Array &); |