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

Function getFontMetrics

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

Source from the content-addressed store, hash-verified

193}
194
195bool getFontMetrics(FontMetrics &metrics, FontHandle *font, FontCoordinateScaling coordinateScaling) {
196 double scale = getFontCoordinateScale(font->face, coordinateScaling);
197 metrics.emSize = scale*font->face->units_per_EM;
198 metrics.ascenderY = scale*font->face->ascender;
199 metrics.descenderY = scale*font->face->descender;
200 metrics.lineHeight = scale*font->face->height;
201 metrics.underlineY = scale*font->face->underline_position;
202 metrics.underlineThickness = scale*font->face->underline_thickness;
203 return true;
204}
205
206bool getFontWhitespaceWidth(double &spaceAdvance, double &tabAdvance, FontHandle *font, FontCoordinateScaling coordinateScaling) {
207 double scale = getFontCoordinateScale(font->face, coordinateScaling);

Callers

nothing calls this directly

Calls 1

getFontCoordinateScaleFunction · 0.85

Tested by

no test coverage detected