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

Function loadGlyph

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

Source from the content-addressed store, hash-verified

227}
228
229bool loadGlyph(Shape &output, FontHandle *font, GlyphIndex glyphIndex, FontCoordinateScaling coordinateScaling, double *outAdvance) {
230 if (!font)
231 return false;
232 FT_Error error = FT_Load_Glyph(font->face, glyphIndex.getIndex(), FT_LOAD_DEFAULT/*FT_LOAD_NO_SCALE MyGUI modification*/);
233 if (error)
234 return false;
235 double scale = getFontCoordinateScale(font->face, coordinateScaling);
236 if (outAdvance)
237 *outAdvance = scale*font->face->glyph->advance.x;
238 return !readFreetypeOutline(output, &font->face->glyph->outline, scale);
239}
240
241bool loadGlyph(Shape &output, FontHandle *font, unicode_t unicode, FontCoordinateScaling coordinateScaling, double *outAdvance) {
242 return loadGlyph(output, font, GlyphIndex(FT_Get_Char_Index(font->face, unicode)), coordinateScaling, outAdvance);

Callers 3

createMsdfFaceGlyphMethod · 0.85
renderMsdfGlyphsMethod · 0.85
mainFunction · 0.85

Calls 4

getFontCoordinateScaleFunction · 0.85
readFreetypeOutlineFunction · 0.85
GlyphIndexClass · 0.85
getIndexMethod · 0.80

Tested by

no test coverage detected