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

Method createMsdfFaceGlyph

MyGUIEngine/src/MyGUI_ResourceTrueTypeFont.cpp:1179–1203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1177 }
1178
1179 int ResourceTrueTypeFont::createMsdfFaceGlyph(
1180 Char _codePoint,
1181 int _fontAscent,
1182 msdfgen::FontHandle* _fontHandle,
1183 GlyphHeightMap& _glyphHeightMap)
1184 {
1185 if (mGlyphMap.find(_codePoint) == mGlyphMap.end())
1186 {
1187 msdfgen::Shape shape;
1188 double advance;
1189 if (msdfgen::loadGlyph(shape, _fontHandle, _codePoint, &advance))
1190 createMsdfGlyph(createMsdfFaceGlyphInfo(_codePoint, shape, advance, _fontAscent), _glyphHeightMap);
1191 else
1192 MYGUI_LOG(
1193 Warning,
1194 "ResourceTrueTypeFont: Cannot load msdf glyph for character "
1195 << _codePoint << " in font '" << getResourceName() << "'.");
1196 }
1197 else
1198 {
1199 mCharMap[_codePoint] = _codePoint;
1200 }
1201
1202 return 0;
1203 }
1204
1205 void ResourceTrueTypeFont::renderMsdfGlyphs(
1206 const GlyphHeightMap& _glyphHeightMap,

Callers

nothing calls this directly

Calls 3

loadGlyphFunction · 0.85
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected