summaryrefslogtreecommitdiff
path: root/Ladybird/FontPluginQt.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-09-08 12:44:17 +0200
committerAndrew Kaster <andrewdkaster@gmail.com>2022-12-25 07:58:58 -0700
commit8a657eaa341424a2b4484342c755b3ac64cd5ca2 (patch)
tree9e5bf18fe437313c21ed1788976ca73783c7ebae /Ladybird/FontPluginQt.h
parent37d844fd664d7d22ac9626ff3d566a4ec52d857c (diff)
downloadserenity-8a657eaa341424a2b4484342c755b3ac64cd5ca2.zip
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.
Diffstat (limited to 'Ladybird/FontPluginQt.h')
-rw-r--r--Ladybird/FontPluginQt.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/Ladybird/FontPluginQt.h b/Ladybird/FontPluginQt.h
new file mode 100644
index 0000000000..ef1677b701
--- /dev/null
+++ b/Ladybird/FontPluginQt.h
@@ -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;
+};
+
+}