mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 20:42:21 +00:00
LibWeb: Parse ascent-, descent-, and line-gap-override descriptors
This commit is contained in:
parent
3a5e78780e
commit
2f7d18865d
Notes:
github-actions[bot]
2024-09-28 12:44:05 +00:00
Author: https://github.com/AtkinsSJ
Commit: 2f7d18865d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1554
5 changed files with 100 additions and 16 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2022-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2022-2024, Sam Atkins <sam@ladybird.org>
|
||||
* Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
|
@ -10,6 +10,7 @@
|
|||
#include <AK/FlyString.h>
|
||||
#include <LibGfx/Font/UnicodeRange.h>
|
||||
#include <LibURL/URL.h>
|
||||
#include <LibWeb/CSS/Percentage.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
|
@ -21,15 +22,17 @@ public:
|
|||
Optional<FlyString> format;
|
||||
};
|
||||
|
||||
ParsedFontFace(FlyString font_family, Optional<int> weight, Optional<int> slope, Vector<Source> sources, Vector<Gfx::UnicodeRange> unicode_ranges);
|
||||
ParsedFontFace(FlyString font_family, Optional<int> weight, Optional<int> slope, Vector<Source> sources, Vector<Gfx::UnicodeRange> unicode_ranges, Optional<Percentage> ascent_override, Optional<Percentage> descent_override, Optional<Percentage> line_gap_override);
|
||||
~ParsedFontFace() = default;
|
||||
|
||||
Optional<Percentage> ascent_override() const { return m_ascent_override; }
|
||||
Optional<Percentage> descent_override() const { return m_descent_override; }
|
||||
FlyString font_family() const { return m_font_family; }
|
||||
Optional<int> weight() const { return m_weight; }
|
||||
Optional<int> slope() const { return m_slope; }
|
||||
Optional<int> weight() const { return m_weight; }
|
||||
Optional<Percentage> line_gap_override() const { return m_line_gap_override; }
|
||||
Vector<Source> const& sources() const { return m_sources; }
|
||||
Vector<Gfx::UnicodeRange> const& unicode_ranges() const { return m_unicode_ranges; }
|
||||
// FIXME: font-stretch, font-feature-settings
|
||||
|
||||
private:
|
||||
FlyString m_font_family;
|
||||
|
@ -37,6 +40,9 @@ private:
|
|||
Optional<int> m_slope { 0 };
|
||||
Vector<Source> m_sources;
|
||||
Vector<Gfx::UnicodeRange> m_unicode_ranges;
|
||||
Optional<Percentage> m_ascent_override;
|
||||
Optional<Percentage> m_descent_override;
|
||||
Optional<Percentage> m_line_gap_override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue