mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
LibWebView+Services+UI: Move the Web plugins to LibWebView
This commit is contained in:
parent
9e1f001ffe
commit
a14937c45e
Notes:
github-actions[bot]
2024-11-11 12:36:47 +00:00
Author: https://github.com/trflynn89
Commit: a14937c45e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2269
9 changed files with 22 additions and 34 deletions
35
Libraries/LibWebView/Plugins/FontPlugin.h
Normal file
35
Libraries/LibWebView/Plugins/FontPlugin.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/RefPtr.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibGfx/Font/FontDatabase.h>
|
||||
#include <LibWeb/Platform/FontPlugin.h>
|
||||
|
||||
namespace WebView {
|
||||
|
||||
class FontPlugin final : public Web::Platform::FontPlugin {
|
||||
public:
|
||||
FontPlugin(bool is_layout_test_mode, Gfx::SystemFontProvider* = nullptr);
|
||||
virtual ~FontPlugin();
|
||||
|
||||
virtual Gfx::Font& default_font() override;
|
||||
virtual Gfx::Font& default_fixed_width_font() override;
|
||||
virtual RefPtr<Gfx::Font> default_emoji_font(float point_size) override;
|
||||
virtual FlyString generic_font_name(Web::Platform::GenericFont) override;
|
||||
|
||||
void update_generic_fonts();
|
||||
|
||||
private:
|
||||
Vector<FlyString> 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 };
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue