2022-09-08 10:44:17 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-09-17 19:25:15 +00:00
|
|
|
#include <AK/RefPtr.h>
|
2022-09-08 10:44:17 +00:00
|
|
|
#include <AK/Vector.h>
|
|
|
|
#include <LibWeb/Platform/FontPlugin.h>
|
|
|
|
|
|
|
|
namespace Ladybird {
|
|
|
|
|
2023-08-02 18:01:17 +00:00
|
|
|
class FontPlugin final : public Web::Platform::FontPlugin {
|
2022-09-08 10:44:17 +00:00
|
|
|
public:
|
2023-08-02 18:01:17 +00:00
|
|
|
FontPlugin(bool is_layout_test_mode);
|
|
|
|
virtual ~FontPlugin();
|
2022-09-08 10:44:17 +00:00
|
|
|
|
2022-09-17 19:25:15 +00:00
|
|
|
virtual Gfx::Font& default_font() override;
|
|
|
|
virtual Gfx::Font& default_fixed_width_font() override;
|
2024-09-05 20:35:01 +00:00
|
|
|
virtual RefPtr<Gfx::Font> default_emoji_font(float point_size) override;
|
2023-09-06 05:45:47 +00:00
|
|
|
virtual FlyString generic_font_name(Web::Platform::GenericFont) override;
|
2022-09-08 10:44:17 +00:00
|
|
|
|
|
|
|
void update_generic_fonts();
|
|
|
|
|
|
|
|
private:
|
2023-09-06 05:45:47 +00:00
|
|
|
Vector<FlyString> m_generic_font_names;
|
2022-09-17 19:25:15 +00:00
|
|
|
RefPtr<Gfx::Font> m_default_font;
|
|
|
|
RefPtr<Gfx::Font> m_default_fixed_width_font;
|
2023-05-06 10:46:14 +00:00
|
|
|
bool m_is_layout_test_mode { false };
|
2022-09-08 10:44:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|