Files
ladybird/Libraries/LibWeb/Platform/FontPlugin.h
Tim Ledbetter 3e704e0fd6 LibGfx+LibWeb: Fall back to system fonts for missing glyphs
When rendering text, if none of the fonts in the cascade list contain a
glyph for a given code point, we now query Skia's font manager to find
a system font that can render it.
2026-01-21 14:01:35 +01:00

45 lines
828 B
C++

/*
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Forward.h>
#include <LibGfx/Forward.h>
#include <LibWeb/Export.h>
namespace Web::Platform {
enum class GenericFont {
Cursive,
Fantasy,
Monospace,
SansSerif,
Serif,
UiMonospace,
UiRounded,
UiSansSerif,
UiSerif,
__Count,
};
class WEB_API FontPlugin {
public:
static FontPlugin& the();
static void install(FontPlugin&);
virtual ~FontPlugin();
virtual RefPtr<Gfx::Font> default_font(float point_size) = 0;
virtual Gfx::Font& default_fixed_width_font() = 0;
virtual FlyString generic_font_name(GenericFont) = 0;
virtual Vector<FlyString> symbol_font_names() = 0;
virtual bool is_layout_test_mode() const = 0;
};
}