mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03:00
5c2e3d1637
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.
28 lines
411 B
C++
28 lines
411 B
C++
/*
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/Platform/FontPlugin.h>
|
|
|
|
namespace Web::Platform {
|
|
|
|
static FontPlugin* s_the;
|
|
|
|
FontPlugin& FontPlugin::the()
|
|
{
|
|
VERIFY(s_the);
|
|
return *s_the;
|
|
}
|
|
|
|
void FontPlugin::install(FontPlugin& plugin)
|
|
{
|
|
VERIFY(!s_the);
|
|
s_the = &plugin;
|
|
}
|
|
|
|
FontPlugin::~FontPlugin() = default;
|
|
|
|
}
|