MCPcopy Create free account
hub / github.com/MyGUI/mygui / getFontWhitespaceWidth

Function getFontWhitespaceWidth

MyGUIEngine/src/msdfgen/ext/import-font.cpp:206–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206bool getFontWhitespaceWidth(double &spaceAdvance, double &tabAdvance, FontHandle *font, FontCoordinateScaling coordinateScaling) {
207 double scale = getFontCoordinateScale(font->face, coordinateScaling);
208 FT_Error error = FT_Load_Char(font->face, ' ', FT_LOAD_NO_SCALE);
209 if (error)
210 return false;
211 spaceAdvance = scale*font->face->glyph->advance.x;
212 error = FT_Load_Char(font->face, '\t', FT_LOAD_NO_SCALE);
213 if (error)
214 return false;
215 tabAdvance = scale*font->face->glyph->advance.x;
216 return true;
217}
218
219bool getGlyphCount(unsigned &output, FontHandle *font) {
220 output = (unsigned) font->face->num_glyphs;

Callers

nothing calls this directly

Calls 1

getFontCoordinateScaleFunction · 0.85

Tested by

no test coverage detected