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

LibGfx: Add initial font family matching

Fonts following the TypefaceWeightSize naming scheme now associate
with bold weights of the same name and glyph size on construction.
This commit is contained in:
thankyouverycool 2020-08-15 12:41:35 -04:00 committed by Andreas Kling
parent a5fefbf840
commit 126a03f087
2 changed files with 43 additions and 0 deletions

View file

@ -110,6 +110,10 @@ public:
bool is_fixed_width() const { return m_fixed_width; }
void set_fixed_width(bool b) { m_fixed_width = b; }
const Font& bold_family_font() const { return *m_bold_family_font; }
bool has_boldface() const { return m_boldface; }
void set_boldface(bool b) { m_boldface = b; }
u8 glyph_spacing() const { return m_glyph_spacing; }
void set_glyph_spacing(u8 spacing) { m_glyph_spacing = spacing; }
@ -130,6 +134,9 @@ private:
static RefPtr<Font> load_from_memory(const u8*);
static size_t glyph_count_by_type(FontTypes type);
void set_family_fonts();
RefPtr<Font> m_bold_family_font;
String m_name;
FontTypes m_type;
size_t m_glyph_count { 256 };
@ -146,6 +153,7 @@ private:
u8 m_glyph_spacing { 0 };
bool m_fixed_width { false };
bool m_boldface { false };
};
}