MCPcopy Create free account
hub / github.com/defold/defold / FontDebugGlyph

Function FontDebugGlyph

engine/font/src/font.cpp:190–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190void FontDebugGlyph(FontGlyph* glyph, int indent)
191{
192 char utf8[16];
193 uint32_t len = dmUtf8::ToUtf8(glyph->m_Codepoint, utf8);
194 utf8[len] = 0;
195
196 Indent(indent); printf("glyph: '%s' 0x%0X\n", utf8, glyph->m_Codepoint);
197 Indent(indent+1); printf("width: %.3f\n", glyph->m_Width);
198 Indent(indent+1); printf("height: %.3f\n", glyph->m_Height);
199 Indent(indent+1); printf("advance: %.3f\n", glyph->m_Advance);
200 Indent(indent+1); printf("lbearing: %.3f\n", glyph->m_LeftBearing);
201 Indent(indent+1); printf("ascent: %.3f\n", glyph->m_Ascent);
202 Indent(indent+1); printf("descent: %.3f\n", glyph->m_Descent);
203}
204
205void FontDebug(HFont hfont, float scale, float padding, const char* text)
206{

Callers 1

FontDebugFunction · 0.85

Calls 2

ToUtf8Function · 0.85
IndentFunction · 0.85

Tested by

no test coverage detected