summaryrefslogtreecommitdiff
path: root/scene/resources/text_paragraph.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/text_paragraph.h')
-rw-r--r--scene/resources/text_paragraph.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/scene/resources/text_paragraph.h b/scene/resources/text_paragraph.h
index f7f49e9058..38b2bd9a1d 100644
--- a/scene/resources/text_paragraph.h
+++ b/scene/resources/text_paragraph.h
@@ -39,6 +39,10 @@
class TextParagraph : public Reference {
GDCLASS(TextParagraph, Reference);
+ RID dropcap_rid;
+ int dropcap_lines = 0;
+ Rect2 dropcap_margins;
+
RID rid;
Vector<RID> lines;
int spacing_top = 0;
@@ -60,6 +64,7 @@ protected:
public:
RID get_rid() const;
RID get_line_rid(int p_line) const;
+ RID get_dropcap_rid() const;
void clear();
@@ -77,6 +82,9 @@ public:
void set_bidi_override(const Vector<Vector2i> &p_override);
+ bool set_dropcap(const String &p_text, const Ref<Font> &p_fonts, int p_size, const Rect2 &p_dropcap_margins = Rect2(), const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "");
+ void clear_dropcap();
+
bool add_string(const String &p_text, const Ref<Font> &p_fonts, int p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "");
bool add_object(Variant p_key, const Size2 &p_size, VAlign p_inline_align = VALIGN_CENTER, int p_length = 1);
bool resize_object(Variant p_key, const Size2 &p_size, VAlign p_inline_align = VALIGN_CENTER);
@@ -108,12 +116,18 @@ public:
float get_line_underline_position(int p_line) const;
float get_line_underline_thickness(int p_line) const;
- void draw(RID p_canvas, const Vector2 &p_pos, const Color &p_color = Color(1, 1, 1)) const;
- void draw_outline(RID p_canvas, const Vector2 &p_pos, int p_outline_size = 1, const Color &p_color = Color(1, 1, 1)) const;
+ Size2 get_dropcap_size() const;
+ int get_dropcap_lines() const;
+
+ void draw(RID p_canvas, const Vector2 &p_pos, const Color &p_color = Color(1, 1, 1), const Color &p_dc_color = Color(1, 1, 1)) const;
+ void draw_outline(RID p_canvas, const Vector2 &p_pos, int p_outline_size = 1, const Color &p_color = Color(1, 1, 1), const Color &p_dc_color = Color(1, 1, 1)) const;
void draw_line(RID p_canvas, const Vector2 &p_pos, int p_line, const Color &p_color = Color(1, 1, 1)) const;
void draw_line_outline(RID p_canvas, const Vector2 &p_pos, int p_line, int p_outline_size = 1, const Color &p_color = Color(1, 1, 1)) const;
+ void draw_dropcap(RID p_canvas, const Vector2 &p_pos, const Color &p_color = Color(1, 1, 1)) const;
+ void draw_dropcap_outline(RID p_canvas, const Vector2 &p_pos, int p_outline_size = 1, const Color &p_color = Color(1, 1, 1)) const;
+
int hit_test(const Point2 &p_coords) const;
void _set_bidi_override(const Array &p_override);