[Font Import] Detect pixel fonts and disable subpixel positioning.
This commit is contained in:
@ -88,6 +88,7 @@ public:
|
||||
virtual int64_t font_get_char_from_glyph_index(const RID &p_font_rid, int64_t p_size, int64_t p_glyph_index) const override { return 0; }
|
||||
virtual bool font_has_char(const RID &p_font_rid, int64_t p_char) const override { return false; }
|
||||
virtual String font_get_supported_chars(const RID &p_font_rid) const override { return String(); }
|
||||
virtual PackedInt32Array font_get_supported_glyphs(const RID &p_font_rid) const override { return PackedInt32Array(); };
|
||||
virtual void font_draw_glyph(const RID &p_font_rid, const RID &p_canvas, int64_t p_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color) const override {}
|
||||
virtual void font_draw_glyph_outline(const RID &p_font_rid, const RID &p_canvas, int64_t p_size, int64_t p_outline_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color) const override {}
|
||||
|
||||
|
||||
@ -196,6 +196,7 @@ void TextServerExtension::_bind_methods() {
|
||||
|
||||
GDVIRTUAL_BIND(_font_has_char, "font_rid", "char");
|
||||
GDVIRTUAL_BIND(_font_get_supported_chars, "font_rid");
|
||||
GDVIRTUAL_BIND(_font_get_supported_glyphs, "font_rid");
|
||||
|
||||
GDVIRTUAL_BIND(_font_render_range, "font_rid", "size", "start", "end");
|
||||
GDVIRTUAL_BIND(_font_render_glyph, "font_rid", "size", "index");
|
||||
@ -927,6 +928,12 @@ String TextServerExtension::font_get_supported_chars(const RID &p_font_rid) cons
|
||||
return ret;
|
||||
}
|
||||
|
||||
PackedInt32Array TextServerExtension::font_get_supported_glyphs(const RID &p_font_rid) const {
|
||||
PackedInt32Array ret;
|
||||
GDVIRTUAL_REQUIRED_CALL(_font_get_supported_glyphs, p_font_rid, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void TextServerExtension::font_render_range(const RID &p_font_rid, const Vector2i &p_size, int64_t p_start, int64_t p_end) {
|
||||
GDVIRTUAL_CALL(_font_render_range, p_font_rid, p_size, p_start, p_end);
|
||||
}
|
||||
|
||||
@ -323,8 +323,10 @@ public:
|
||||
|
||||
virtual bool font_has_char(const RID &p_font_rid, int64_t p_char) const override;
|
||||
virtual String font_get_supported_chars(const RID &p_font_rid) const override;
|
||||
virtual PackedInt32Array font_get_supported_glyphs(const RID &p_font_rid) const override;
|
||||
GDVIRTUAL2RC(bool, _font_has_char, RID, int64_t);
|
||||
GDVIRTUAL1RC(String, _font_get_supported_chars, RID);
|
||||
GDVIRTUAL1RC(PackedInt32Array, _font_get_supported_glyphs, RID);
|
||||
|
||||
virtual void font_render_range(const RID &p_font, const Vector2i &p_size, int64_t p_start, int64_t p_end) override;
|
||||
virtual void font_render_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_index) override;
|
||||
|
||||
Reference in New Issue
Block a user