mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 17:40:27 +00:00
c719a542c5
The `layout-test-mode` flag changes the font to be SerenitySans as this is the font used for layout tests for cross-platform compatibility of tests.
33 lines
803 B
C++
33 lines
803 B
C++
/*
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/RefPtr.h>
|
|
#include <AK/Vector.h>
|
|
#include <LibWeb/Platform/FontPlugin.h>
|
|
|
|
namespace Ladybird {
|
|
|
|
class FontPluginQt final : public Web::Platform::FontPlugin {
|
|
public:
|
|
FontPluginQt(bool is_layout_test_mode);
|
|
virtual ~FontPluginQt();
|
|
|
|
virtual Gfx::Font& default_font() override;
|
|
virtual Gfx::Font& default_fixed_width_font() override;
|
|
virtual DeprecatedString generic_font_name(Web::Platform::GenericFont) override;
|
|
|
|
void update_generic_fonts();
|
|
|
|
private:
|
|
Vector<DeprecatedString> m_generic_font_names;
|
|
RefPtr<Gfx::Font> m_default_font;
|
|
RefPtr<Gfx::Font> m_default_fixed_width_font;
|
|
bool m_is_layout_test_mode { false };
|
|
};
|
|
|
|
}
|