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

LibGfx: Pass font width to FontDatabase::get()

Width need to be passed to `FontDatabase::get()` to resolve font name
unambiguously.
This commit is contained in:
Aliaksandr Kalenik 2023-02-04 23:00:34 +03:00 committed by Sam Atkins
parent 79006c03b4
commit 1f4106842d
21 changed files with 71 additions and 21 deletions

View file

@ -127,6 +127,19 @@ struct FontPixelMetrics {
float line_spacing() const { return ascent + descent + line_gap; }
};
// https://learn.microsoft.com/en-us/typography/opentype/spec/os2#uswidthclass
enum FontWidth {
UltraCondensed = 1,
ExtraCondensed = 2,
Condensed = 3,
SemiCondensed = 4,
Normal = 5,
SemiExpanded = 6,
Expanded = 7,
ExtraExpanded = 8,
UltraExpanded = 9
};
class Font : public RefCounted<Font> {
public:
enum class AllowInexactSizeMatch {
@ -144,6 +157,8 @@ public:
virtual float pixel_size() const = 0;
virtual u8 slope() const = 0;
virtual u16 width() const = 0;
virtual u16 weight() const = 0;
virtual Glyph glyph(u32 code_point) const = 0;
virtual Glyph glyph(u32 code_point, GlyphSubpixelOffset) const = 0;