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

LibGfx: Generalize glyph placement in Painter

This commit is contained in:
Stephan Unverwerth 2021-01-03 17:31:18 +01:00 committed by Andreas Kling
parent 972c7cf9f4
commit 79dfe9846d
3 changed files with 14 additions and 6 deletions

View file

@ -223,7 +223,12 @@ bool BitmapFont::write_to_file(const StringView& path)
Glyph BitmapFont::glyph(u32 code_point) const
{
return Glyph(GlyphBitmap(&m_rows[code_point * m_glyph_height], { glyph_width(code_point), m_glyph_height }));
auto width = glyph_width(code_point);
return Glyph(
GlyphBitmap(&m_rows[code_point * m_glyph_height], { width, m_glyph_height }),
0,
width,
m_glyph_height);
}
int BitmapFont::glyph_or_emoji_width(u32 code_point) const