mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:18:11 +00:00

Instead of hard-coding the names of system fonts to use for the CSS generic fonts (like "sans-serif", "monospace", etc.) we now call out to a Platform::FontPlugin and ask for the generic names.
36 lines
534 B
C++
36 lines
534 B
C++
/*
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Forward.h>
|
|
|
|
namespace Web::Platform {
|
|
|
|
enum class GenericFont {
|
|
Cursive,
|
|
Fantasy,
|
|
Monospace,
|
|
SansSerif,
|
|
Serif,
|
|
UiMonospace,
|
|
UiRounded,
|
|
UiSansSerif,
|
|
UiSerif,
|
|
__Count,
|
|
};
|
|
|
|
class FontPlugin {
|
|
public:
|
|
static FontPlugin& the();
|
|
static void install(FontPlugin&);
|
|
|
|
virtual ~FontPlugin();
|
|
|
|
virtual String generic_font_name(GenericFont) = 0;
|
|
};
|
|
|
|
}
|