mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:27:45 +00:00
LibWeb: Implement initial CSSFontFaceRule and FontFace classes
For now, this is the bare minimum that's needed: font-family and src.
This commit is contained in:
parent
1dcde57922
commit
804b8c85e8
13 changed files with 173 additions and 6 deletions
32
Userland/Libraries/LibWeb/CSS/FontFace.h
Normal file
32
Userland/Libraries/LibWeb/CSS/FontFace.h
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/URL.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
class FontFace {
|
||||
public:
|
||||
struct Source {
|
||||
AK::URL url;
|
||||
};
|
||||
|
||||
FontFace(FlyString font_family, Vector<Source> sources);
|
||||
~FontFace() = default;
|
||||
|
||||
FlyString font_family() const { return m_font_family; }
|
||||
Vector<Source> const& sources() const { return m_sources; }
|
||||
// FIXME: font-style, font-weight, font-stretch, unicode-range, font-feature-settings
|
||||
|
||||
private:
|
||||
FlyString m_font_family;
|
||||
Vector<Source> m_sources;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue