| 71 | } |
| 72 | |
| 73 | sp<PaletteImage> BitmapFont::getGlyph(char32_t codepoint) |
| 74 | { |
| 75 | if (fontbitmaps.find(codepoint) == fontbitmaps.end()) |
| 76 | { |
| 77 | // FIXME: Hack - assume all missing glyphs are spaces |
| 78 | // TODO: Fallback fonts? |
| 79 | LogWarning("Font %s missing glyph for character \"%s\" (codepoint %u)", this->getName(), |
| 80 | to_ustring(std::u32string(1, codepoint)), static_cast<uint32_t>(codepoint)); |
| 81 | auto missingGlyph = this->getGlyph(to_char32(' ')); |
| 82 | fontbitmaps.emplace(codepoint, missingGlyph); |
| 83 | } |
| 84 | return fontbitmaps[codepoint]; |
| 85 | } |
| 86 | |
| 87 | sp<Palette> BitmapFont::getPalette() const { return this->palette; } |
| 88 |
no test coverage detected