mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:07:36 +00:00
Ladybird: Add a FontPlugin and try much harder to find suitable fonts
Instead of only looking at the SerenityOS default fonts, we now also look recursively in /usr/share/fonts for suitable fonts that we can load and use.
This commit is contained in:
parent
37d844fd66
commit
8a657eaa34
5 changed files with 129 additions and 6 deletions
27
Ladybird/FontPluginQt.h
Normal file
27
Ladybird/FontPluginQt.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Vector.h>
|
||||
#include <LibWeb/Platform/FontPlugin.h>
|
||||
|
||||
namespace Ladybird {
|
||||
|
||||
class FontPluginQt final : public Web::Platform::FontPlugin {
|
||||
public:
|
||||
FontPluginQt();
|
||||
virtual ~FontPluginQt();
|
||||
|
||||
virtual String generic_font_name(Web::Platform::GenericFont) override;
|
||||
|
||||
void update_generic_fonts();
|
||||
|
||||
private:
|
||||
Vector<String> m_generic_font_names;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue