1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:47:35 +00:00

LibGfx: draw_glyph_or_emoji fix check for available glyph

This would cause question marks to be rendered when a ttf with fewer
glyphs than the value of the code_point was used.
This commit is contained in:
Stephan Unverwerth 2021-01-03 19:24:59 +01:00 committed by Andreas Kling
parent 6948f9ca55
commit 3b67b55c84
4 changed files with 5 additions and 3 deletions

View file

@ -140,6 +140,7 @@ public:
virtual u8 presentation_size() const override { return m_point_height; }
virtual u16 weight() const override { return m_font->weight(); }
virtual Gfx::Glyph glyph(u32 code_point) const override;
virtual bool contains_glyph(u32 code_point) const override { return m_font->glyph_id_for_codepoint(code_point) > 0; }
virtual u8 glyph_width(size_t ch) const override;
virtual int glyph_or_emoji_width(u32 code_point) const override;
virtual u8 glyph_height() const override { return m_point_height; } /* TODO */