mirror of https://github.com/OpenTTD/OpenTTD
How missing glyphs were detected was changed, but the sprite font still substituted `?`, which to missing glyph looked like all characters are present.pull/12824/head
parent
da4b3bebee
commit
a288644e20
|
@ -115,6 +115,14 @@ uint SpriteFontCache::GetGlyphWidth(GlyphID key)
|
||||||
return SpriteExists(sprite) ? GetSprite(sprite, SpriteType::Font)->width + ScaleFontTrad(this->fs != FS_NORMAL ? 1 : 0) : 0;
|
return SpriteExists(sprite) ? GetSprite(sprite, SpriteType::Font)->width + ScaleFontTrad(this->fs != FS_NORMAL ? 1 : 0) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GlyphID SpriteFontCache::MapCharToGlyph(char32_t key, [[maybe_unused]] bool allow_fallback)
|
||||||
|
{
|
||||||
|
assert(IsPrintable(key));
|
||||||
|
SpriteID sprite = this->GetUnicodeGlyph(key);
|
||||||
|
if (sprite == 0) return 0;
|
||||||
|
return SPRITE_GLYPH | key;
|
||||||
|
}
|
||||||
|
|
||||||
bool SpriteFontCache::GetDrawGlyphShadow()
|
bool SpriteFontCache::GetDrawGlyphShadow()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -23,7 +23,7 @@ public:
|
||||||
const Sprite *GetGlyph(GlyphID key) override;
|
const Sprite *GetGlyph(GlyphID key) override;
|
||||||
uint GetGlyphWidth(GlyphID key) override;
|
uint GetGlyphWidth(GlyphID key) override;
|
||||||
bool GetDrawGlyphShadow() override;
|
bool GetDrawGlyphShadow() override;
|
||||||
GlyphID MapCharToGlyph(char32_t key, [[maybe_unused]] bool allow_fallback = true) override { assert(IsPrintable(key)); return SPRITE_GLYPH | key; }
|
GlyphID MapCharToGlyph(char32_t key, bool allow_fallback = true) override;
|
||||||
std::string GetFontName() override { return "sprite"; }
|
std::string GetFontName() override { return "sprite"; }
|
||||||
bool IsBuiltInFont() override { return true; }
|
bool IsBuiltInFont() override { return true; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue