diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2020-12-10 17:30:25 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2021-03-31 09:32:14 +0300 |
commit | 0d3fa2a12558d90e7b9cc05f38e8b5c866a2d794 (patch) | |
tree | 23385098a4f26118be7ab4537c49db73d1d60186 /modules/gdnative/text | |
parent | 2a66714bfb4654f466479c7b0bc8be103ee9218a (diff) |
[Complex Text Layouts] Provide access to glyph contour points.
Diffstat (limited to 'modules/gdnative/text')
-rw-r--r-- | modules/gdnative/text/text_server_gdnative.cpp | 6 | ||||
-rw-r--r-- | modules/gdnative/text/text_server_gdnative.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/modules/gdnative/text/text_server_gdnative.cpp b/modules/gdnative/text/text_server_gdnative.cpp index 7cd8de5f2e..7cb749309a 100644 --- a/modules/gdnative/text/text_server_gdnative.cpp +++ b/modules/gdnative/text/text_server_gdnative.cpp @@ -359,6 +359,12 @@ Vector2 TextServerGDNative::font_draw_glyph_outline(RID p_font, RID p_canvas, in return advance; } +bool TextServerGDNative::font_get_glyph_contours(RID p_font, int p_size, uint32_t p_index, Vector<Vector3> &r_points, Vector<int32_t> &r_contours, bool &r_orientation) const { + ERR_FAIL_COND_V(interface == nullptr, false); + ERR_FAIL_COND_V(interface->font_get_glyph_contours == nullptr, false); + return interface->font_get_glyph_contours(data, (godot_rid *)&p_font, p_size, p_index, (godot_packed_vector3_array *)&r_points, (godot_packed_int32_array *)&r_contours, (bool *)&r_orientation); +} + float TextServerGDNative::font_get_oversampling() const { ERR_FAIL_COND_V(interface == nullptr, 1.f); return interface->font_get_oversampling(data); diff --git a/modules/gdnative/text/text_server_gdnative.h b/modules/gdnative/text/text_server_gdnative.h index 931bb44885..7e42b16fe1 100644 --- a/modules/gdnative/text/text_server_gdnative.h +++ b/modules/gdnative/text/text_server_gdnative.h @@ -126,6 +126,8 @@ public: virtual Vector2 font_draw_glyph(RID p_font, RID p_canvas, int p_size, const Vector2 &p_pos, uint32_t p_index, const Color &p_color = Color(1, 1, 1)) const override; virtual Vector2 font_draw_glyph_outline(RID p_font, RID p_canvas, int p_size, int p_outline_size, const Vector2 &p_pos, uint32_t p_index, const Color &p_color = Color(1, 1, 1)) const override; + virtual bool font_get_glyph_contours(RID p_font, int p_size, uint32_t p_index, Vector<Vector3> &r_points, Vector<int32_t> &r_contours, bool &r_orientation) const override; + virtual float font_get_oversampling() const override; virtual void font_set_oversampling(float p_oversampling) override; |