summaryrefslogtreecommitdiff
path: root/servers/text_server.h
diff options
context:
space:
mode:
Diffstat (limited to 'servers/text_server.h')
-rw-r--r--servers/text_server.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/servers/text_server.h b/servers/text_server.h
index 9304771d1b..5da38a627a 100644
--- a/servers/text_server.h
+++ b/servers/text_server.h
@@ -103,6 +103,7 @@ public:
BREAK_WORD_BOUND = 1 << 1,
BREAK_GRAPHEME_BOUND = 1 << 2,
BREAK_ADAPTIVE = 1 << 3,
+ BREAK_TRIM_EDGE_SPACES = 1 << 4,
};
enum OverrunBehavior {
@@ -229,6 +230,7 @@ public:
virtual String tag_to_name(int64_t p_tag) const { return ""; };
/* Font interface */
+
virtual RID create_font() = 0;
virtual void font_set_data(const RID &p_font_rid, const PackedByteArray &p_data) = 0;
@@ -248,8 +250,14 @@ public:
virtual void font_set_style_name(const RID &p_font_rid, const String &p_name) = 0;
virtual String font_get_style_name(const RID &p_font_rid) const = 0;
- virtual void font_set_antialiasing(RID p_font_rid, FontAntialiasing p_antialiasing) = 0;
- virtual FontAntialiasing font_get_antialiasing(RID p_font_rid) const = 0;
+ virtual void font_set_weight(const RID &p_font_rid, int64_t p_weight) = 0;
+ virtual int64_t font_get_weight(const RID &p_font_rid) const = 0;
+
+ virtual void font_set_stretch(const RID &p_font_rid, int64_t p_stretch) = 0;
+ virtual int64_t font_get_stretch(const RID &p_font_rid) const = 0;
+
+ virtual void font_set_antialiasing(const RID &p_font_rid, FontAntialiasing p_antialiasing) = 0;
+ virtual FontAntialiasing font_get_antialiasing(const RID &p_font_rid) const = 0;
virtual void font_set_generate_mipmaps(const RID &p_font_rid, bool p_generate_mipmaps) = 0;
virtual bool font_get_generate_mipmaps(const RID &p_font_rid) const = 0;
@@ -266,6 +274,9 @@ public:
virtual void font_set_fixed_size(const RID &p_font_rid, int64_t p_fixed_size) = 0;
virtual int64_t font_get_fixed_size(const RID &p_font_rid) const = 0;
+ virtual void font_set_allow_system_fallback(const RID &p_font_rid, bool p_allow_system_fallback) = 0;
+ virtual bool font_is_allow_system_fallback(const RID &p_font_rid) const = 0;
+
virtual void font_set_force_autohinter(const RID &p_font_rid, bool p_force_autohinter) = 0;
virtual bool font_is_force_autohinter(const RID &p_font_rid) const = 0;
@@ -408,13 +419,13 @@ public:
virtual void shaped_text_set_spacing(const RID &p_shaped, SpacingType p_spacing, int64_t p_value) = 0;
virtual int64_t shaped_text_get_spacing(const RID &p_shaped, SpacingType p_spacing) const = 0;
- virtual bool shaped_text_add_string(const RID &p_shaped, const String &p_text, const Array &p_fonts, int64_t p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "", const Variant &p_meta = Variant()) = 0;
+ virtual bool shaped_text_add_string(const RID &p_shaped, const String &p_text, const TypedArray<RID> &p_fonts, int64_t p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "", const Variant &p_meta = Variant()) = 0;
virtual bool shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int64_t p_length = 1) = 0;
virtual bool shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER) = 0;
virtual int64_t shaped_get_span_count(const RID &p_shaped) const = 0;
virtual Variant shaped_get_span_meta(const RID &p_shaped, int64_t p_index) const = 0;
- virtual void shaped_set_span_update_font(const RID &p_shaped, int64_t p_index, const Array &p_fonts, int64_t p_size, const Dictionary &p_opentype_features = Dictionary()) = 0;
+ virtual void shaped_set_span_update_font(const RID &p_shaped, int64_t p_index, const TypedArray<RID> &p_fonts, int64_t p_size, const Dictionary &p_opentype_features = Dictionary()) = 0;
virtual RID shaped_text_substr(const RID &p_shaped, int64_t p_start, int64_t p_length) const = 0; // Copy shaped substring (e.g. line break) without reshaping, but correctly reordered, preservers range.
virtual RID shaped_text_get_parent(const RID &p_shaped) const = 0;
@@ -484,7 +495,7 @@ public:
// String functions.
virtual PackedInt32Array string_get_word_breaks(const String &p_string, const String &p_language = "") const = 0;
- virtual int is_confusable(const String &p_string, const PackedStringArray &p_dict) const { return -1; };
+ virtual int64_t is_confusable(const String &p_string, const PackedStringArray &p_dict) const { return -1; };
virtual bool spoof_check(const String &p_string) const { return false; };
virtual String strip_diacritics(const String &p_string) const;
@@ -496,6 +507,8 @@ public:
TypedArray<Vector2i> parse_structured_text(StructuredTextParser p_parser_type, const Array &p_args, const String &p_text) const;
+ virtual void cleanup() {}
+
TextServer();
~TextServer();
};