LibWeb: Understand the format() part of a @font-face's src

This is used to skip downloading fonts in formats that we don't support.
Currently we only support TTF as far as I am aware.

The parts of a `src` are in a fixed order, unusually, which makes the
parsing more nesty instead of loopy.
This commit is contained in:
Sam Atkins 2022-03-31 21:18:54 +01:00 committed by Andreas Kling
commit 12b8570ce3
Notes: sideshowbarker 2024-07-17 14:17:17 +09:00
4 changed files with 91 additions and 28 deletions

View file

@ -16,6 +16,8 @@ class FontFace {
public:
struct Source {
AK::URL url;
// FIXME: Do we need to keep this around, or is it only needed to discard unwanted formats during parsing?
Optional<FlyString> format;
};
FontFace(FlyString font_family, Vector<Source> sources, Vector<UnicodeRange> unicode_ranges);