mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
LibGUI: Add a GFontDatabase class that lets you enumerate fonts and more.
"More" in this case being also giving you the ability to load a font by name. Use this as backend for Terminal's font menu. :^)
This commit is contained in:
parent
7df7e5e2a6
commit
d6326d6c2e
4 changed files with 79 additions and 8 deletions
21
LibGUI/GFontDatabase.h
Normal file
21
LibGUI/GFontDatabase.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/Function.h>
|
||||
|
||||
class Font;
|
||||
|
||||
class GFontDatabase {
|
||||
public:
|
||||
static GFontDatabase& the();
|
||||
|
||||
RetainPtr<Font> get_by_name(const String&);
|
||||
void for_each_font(Function<void(const String&)>);
|
||||
|
||||
private:
|
||||
GFontDatabase();
|
||||
~GFontDatabase();
|
||||
|
||||
HashMap<String, String> m_name_to_path;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue