MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / get_char_size

Method get_char_size

modules/gui/gui/src/backend/text_server/font.cpp:467–482  ·  view source on GitHub ↗

Drawing char.

Source from the content-addressed store, hash-verified

465
466// Drawing char.
467Size2 Font::get_char_size(char32_t p_char, int p_font_size) const
468{
469 if (dirty_rids)
470 {
471 _update_rids();
472 }
473 for (int i = 0; i < rids.size(); i++)
474 {
475 if (TS->font_has_char(rids[i], p_char))
476 {
477 int32_t glyph = (int32_t)TS->font_get_glyph_index(rids[i], p_font_size, p_char, 0);
478 return Size2(TS->font_get_glyph_advance(rids[i], p_font_size, glyph).x, get_height(p_font_size));
479 }
480 }
481 return Size2();
482}
483
484real_t Font::draw_char(RID p_canvas_item, const Point2& p_pos, char32_t p_char, int p_font_size, const Color& p_modulate) const
485{

Callers

nothing calls this directly

Calls 2

get_heightFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected