summaryrefslogtreecommitdiff
path: root/scene/resources/dynamic_font.h
diff options
context:
space:
mode:
authorZher Huei Lee <lee.zh.92@gmail.com>2016-08-02 11:05:20 +0100
committerZher Huei Lee <lee.zh.92@gmail.com>2016-08-02 11:05:20 +0100
commitaf6ef01c692311410c084b0bf4f3fe2f4d46786d (patch)
tree5ff40b59b2b9f1d1bda4ef86dcfe4edad0ba826b /scene/resources/dynamic_font.h
parent7b165e8ac27c8c6f979bf6e2da32a9a58836da08 (diff)
Added extra spacing support for DynamicFont
Side effect is that label min-size will now take into account kerning.
Diffstat (limited to 'scene/resources/dynamic_font.h')
-rw-r--r--scene/resources/dynamic_font.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/scene/resources/dynamic_font.h b/scene/resources/dynamic_font.h
index c43dcd37f9..899973f22f 100644
--- a/scene/resources/dynamic_font.h
+++ b/scene/resources/dynamic_font.h
@@ -159,6 +159,17 @@ class DynamicFont : public Font {
OBJ_TYPE( DynamicFont, Font );
+public:
+
+ enum SpacingType{
+ SPACING_TOP,
+ SPACING_BOTTOM,
+ SPACING_CHAR,
+ SPACING_SPACE
+ };
+
+private:
+
Ref<DynamicFontData> data;
Ref<DynamicFontAtSize> data_at_size;
@@ -168,6 +179,10 @@ class DynamicFont : public Font {
int size;
bool valid;
+ int spacing_top;
+ int spacing_bottom;
+ int spacing_char;
+ int spacing_space;
bool use_mipmaps;
bool use_filter;
uint32_t texture_flags;
@@ -196,6 +211,9 @@ public:
bool get_use_filter() const;
void set_use_filter(bool p_enable);
+ int get_spacing(int p_type) const;
+ void set_spacing(int p_type, int p_value);
+
void add_fallback(const Ref<DynamicFontData>& p_data);
void set_fallback(int p_idx,const Ref<DynamicFontData>& p_data);
int get_fallback_count() const;