[Font] Implement get_char_from_glyph_index function.
This commit is contained in:
parent
2f34a35722
commit
8459aeaab0
13 changed files with 83 additions and 1 deletions
|
|
@ -2160,6 +2160,10 @@ int64_t TextServerFallback::_font_get_glyph_index(const RID &p_font_rid, int64_t
|
|||
return (int64_t)p_char;
|
||||
}
|
||||
|
||||
int64_t TextServerFallback::_font_get_char_from_glyph_index(const RID &p_font_rid, int64_t p_size, int64_t p_glyph_index) const {
|
||||
return p_glyph_index;
|
||||
}
|
||||
|
||||
bool TextServerFallback::_font_has_char(const RID &p_font_rid, int64_t p_char) const {
|
||||
FontFallback *fd = font_owner.get_or_null(p_font_rid);
|
||||
ERR_FAIL_COND_V_MSG((p_char >= 0xd800 && p_char <= 0xdfff) || (p_char > 0x10ffff), false, "Unicode parsing error: Invalid unicode codepoint " + String::num_int64(p_char, 16) + ".");
|
||||
|
|
|
|||
|
|
@ -685,6 +685,7 @@ public:
|
|||
MODBIND3RC(Vector2, font_get_kerning, const RID &, int64_t, const Vector2i &);
|
||||
|
||||
MODBIND4RC(int64_t, font_get_glyph_index, const RID &, int64_t, int64_t, int64_t);
|
||||
MODBIND3RC(int64_t, font_get_char_from_glyph_index, const RID &, int64_t, int64_t);
|
||||
|
||||
MODBIND2RC(bool, font_has_char, const RID &, int64_t);
|
||||
MODBIND1RC(String, font_get_supported_chars, const RID &);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue