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;
|
2022-12-04 18:43:54 +00:00
|
|
|
virtual DeprecatedString generic_font_name(Web::Platform::GenericFont) override;
|
2022-09-08 10:44:17 +00:00
|
|
|
|
|
|
|
void update_generic_fonts();
|
|
|
|
|
|
|
|
private:
|
2022-12-04 18:43:54 +00:00
|
|
|
Vector<DeprecatedString> 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
|
|
|
};
|
|
|
|
|
|
|
|
}
|