mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00:00
LibGfx: Insert pixel and ttf fonts into Typeface structure
This adds a new structure 'Typeface' to the FontDatabase that represents all fonts of the same family and variant. It can contain a list of BitmapFonts with varying size but of the same family and weight or a pointer to a single TTF font for all sizes of this Typeface.
This commit is contained in:
parent
2c4e13f14a
commit
179dba652e
Notes:
sideshowbarker
2024-07-18 22:18:12 +09:00
Author: https://github.com/sunverwerth
Commit: 179dba652e
Pull-request: https://github.com/SerenityOS/serenity/pull/4712
13 changed files with 248 additions and 32 deletions
|
@ -221,9 +221,9 @@ bool BitmapFont::write_to_file(const StringView& path)
|
|||
return true;
|
||||
}
|
||||
|
||||
GlyphBitmap BitmapFont::glyph_bitmap(u32 code_point) const
|
||||
Glyph BitmapFont::glyph(u32 code_point) const
|
||||
{
|
||||
return GlyphBitmap(&m_rows[code_point * m_glyph_height], { glyph_width(code_point), m_glyph_height });
|
||||
return Glyph(GlyphBitmap(&m_rows[code_point * m_glyph_height], { glyph_width(code_point), m_glyph_height }));
|
||||
}
|
||||
|
||||
int BitmapFont::glyph_or_emoji_width(u32 code_point) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue