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