[Complex Text Layouts] Add variable fonts support.
This commit is contained in:
parent
bbf7bb3838
commit
c1d261fdb0
16 changed files with 279 additions and 4 deletions
|
|
@ -82,6 +82,9 @@ typedef struct {
|
|||
void (*font_set_antialiased)(void *, godot_rid *, bool);
|
||||
bool (*font_get_antialiased)(void *, godot_rid *);
|
||||
godot_dictionary (*font_get_feature_list)(void *, godot_rid *);
|
||||
godot_dictionary (*font_get_variation_list)(void *, godot_rid *);
|
||||
void (*font_set_variation)(void *, godot_rid *, const godot_string *, double);
|
||||
double (*font_get_variation)(void *, godot_rid *, const godot_string *);
|
||||
void (*font_set_distance_field_hint)(void *, godot_rid *, bool);
|
||||
bool (*font_get_distance_field_hint)(void *, godot_rid *);
|
||||
void (*font_set_hinting)(void *, godot_rid *, godot_int);
|
||||
|
|
|
|||
|
|
@ -148,6 +148,24 @@ bool TextServerGDNative::font_get_antialiased(RID p_font) const {
|
|||
return interface->font_get_antialiased(data, (godot_rid *)&p_font);
|
||||
}
|
||||
|
||||
Dictionary TextServerGDNative::font_get_variation_list(RID p_font) const {
|
||||
ERR_FAIL_COND_V(interface == nullptr, Dictionary());
|
||||
godot_dictionary result = interface->font_get_variation_list(data, (godot_rid *)&p_font);
|
||||
Dictionary info = *(Dictionary *)&result;
|
||||
godot_dictionary_destroy(&result);
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
void TextServerGDNative::font_set_variation(RID p_font, const String &p_name, double p_value) {
|
||||
ERR_FAIL_COND(interface == nullptr);
|
||||
interface->font_set_variation(data, (godot_rid *)&p_font, (godot_string *)&p_name, p_value);
|
||||
}
|
||||
|
||||
double TextServerGDNative::font_get_variation(RID p_font, const String &p_name) const {
|
||||
return interface->font_get_variation(data, (godot_rid *)&p_font, (godot_string *)&p_name);
|
||||
}
|
||||
|
||||
void TextServerGDNative::font_set_hinting(RID p_font, TextServer::Hinting p_hinting) {
|
||||
ERR_FAIL_COND(interface == nullptr);
|
||||
interface->font_set_hinting(data, (godot_rid *)&p_font, (godot_int)p_hinting);
|
||||
|
|
|
|||
|
|
@ -76,6 +76,10 @@ public:
|
|||
virtual bool font_get_antialiased(RID p_font) const override;
|
||||
|
||||
virtual Dictionary font_get_feature_list(RID p_font) const override;
|
||||
virtual Dictionary font_get_variation_list(RID p_font) const override;
|
||||
|
||||
virtual void font_set_variation(RID p_font, const String &p_name, double p_value) override;
|
||||
virtual double font_get_variation(RID p_font, const String &p_name) const override;
|
||||
|
||||
virtual void font_set_hinting(RID p_font, Hinting p_hinting) override;
|
||||
virtual Hinting font_get_hinting(RID p_font) const override;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue