1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-15 19:42:10 +00:00

Replace fallback font nonsense with automatic per-glyph fallback (#11084)

This commit is contained in:
sfan5 2021-03-29 19:55:24 +02:00 committed by GitHub
parent 5f4c78a77d
commit 8d89f5f0cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 119 additions and 88 deletions

View file

@ -269,7 +269,7 @@ namespace gui
video::SColor color, bool hcenter=false, bool vcenter=false,
const core::rect<s32>* clip=0);
virtual void draw(const EnrichedString& text, const core::rect<s32>& position,
void draw(const EnrichedString& text, const core::rect<s32>& position,
video::SColor color, bool hcenter=false, bool vcenter=false,
const core::rect<s32>* clip=0);
@ -313,6 +313,9 @@ namespace gui
//! Get the last glyph page's index.
u32 getLastGlyphPageIndex() const { return Glyph_Pages.size() - 1; }
//! Set font that should be used for glyphs not present in ours
void setFallback(gui::IGUIFont* font) { fallback = font; }
//! Create corresponding character's software image copy from the font,
//! so you can use this data just like any ordinary video::IImage.
//! \param ch The character you need
@ -387,6 +390,8 @@ namespace gui
core::ustring Invisible;
u32 shadow_offset;
u32 shadow_alpha;
gui::IGUIFont* fallback;
};
} // end namespace gui