2019-02-12 16:35:33 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/AKString.h>
|
|
|
|
#include <AK/HashMap.h>
|
|
|
|
#include <AK/Function.h>
|
|
|
|
|
|
|
|
class Font;
|
|
|
|
|
|
|
|
class GFontDatabase {
|
|
|
|
public:
|
|
|
|
static GFontDatabase& the();
|
2019-04-03 17:50:08 +03:00
|
|
|
GFontDatabase();
|
2019-02-12 16:35:33 +03:00
|
|
|
|
|
|
|
RetainPtr<Font> get_by_name(const String&);
|
|
|
|
void for_each_font(Function<void(const String&)>);
|
2019-03-06 16:06:40 +03:00
|
|
|
void for_each_fixed_width_font(Function<void(const String&)>);
|
2019-02-12 16:35:33 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
~GFontDatabase();
|
|
|
|
|
2019-03-06 16:06:40 +03:00
|
|
|
struct Metadata {
|
|
|
|
String path;
|
|
|
|
bool is_fixed_width;
|
|
|
|
int glyph_height;
|
|
|
|
};
|
|
|
|
|
|
|
|
HashMap<String, Metadata> m_name_to_metadata;
|
2019-02-12 16:35:33 +03:00
|
|
|
};
|