summaryrefslogtreecommitdiff
path: root/LibGUI/GFontDatabase.h
blob: 5cc37cc2436e74beda82ed7e79eef6c1629828fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#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&)>);
    void for_each_fixed_width_font(Function<void(const String&)>);

private:
    GFontDatabase();
    ~GFontDatabase();

    struct Metadata {
        String path;
        bool is_fixed_width;
        int glyph_height;
    };

    HashMap<String, Metadata> m_name_to_metadata;
};