1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:57:45 +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:
Stephan Unverwerth 2021-01-02 14:49:20 +01:00 committed by Andreas Kling
parent 2c4e13f14a
commit 179dba652e
13 changed files with 248 additions and 32 deletions

View file

@ -30,6 +30,7 @@
#include <AK/HashMap.h>
#include <AK/String.h>
#include <LibGfx/Forward.h>
#include <LibGfx/Typeface.h>
namespace Gfx {
@ -48,6 +49,8 @@ public:
void for_each_font(Function<void(const Gfx::Font&)>);
void for_each_fixed_width_font(Function<void(const Gfx::Font&)>);
RefPtr<Typeface> get_or_create_typeface(const String& family, const String& variant);
private:
FontDatabase();
~FontDatabase();