mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:47:34 +00:00
LibWeb: Parse font-weight and font-style inside @font-face rules
This commit is contained in:
parent
be10360350
commit
74bdbdf43f
3 changed files with 28 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2022-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -20,16 +21,20 @@ public:
|
|||
Optional<FlyString> format;
|
||||
};
|
||||
|
||||
FontFace(FlyString font_family, Vector<Source> sources, Vector<UnicodeRange> unicode_ranges);
|
||||
FontFace(FlyString font_family, Optional<int> weight, Optional<int> slope, Vector<Source> sources, Vector<UnicodeRange> unicode_ranges);
|
||||
~FontFace() = default;
|
||||
|
||||
FlyString font_family() const { return m_font_family; }
|
||||
Optional<int> weight() const { return m_weight; }
|
||||
Optional<int> slope() const { return m_slope; }
|
||||
Vector<Source> const& sources() const { return m_sources; }
|
||||
Vector<UnicodeRange> const& unicode_ranges() const { return m_unicode_ranges; }
|
||||
// FIXME: font-style, font-weight, font-stretch, font-feature-settings
|
||||
// FIXME: font-stretch, font-feature-settings
|
||||
|
||||
private:
|
||||
FlyString m_font_family;
|
||||
Optional<int> m_weight { 0 };
|
||||
Optional<int> m_slope { 0 };
|
||||
Vector<Source> m_sources;
|
||||
Vector<UnicodeRange> m_unicode_ranges;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue