| 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, |