mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-25 05:55:13 +00:00
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
33 lines
648 B
C++
33 lines
648 B
C++
#pragma once
|
|
|
|
#include <AK/AKString.h>
|
|
#include <AK/Function.h>
|
|
#include <AK/HashMap.h>
|
|
|
|
class Font;
|
|
|
|
struct Metadata {
|
|
String path;
|
|
bool is_fixed_width;
|
|
int glyph_height;
|
|
};
|
|
|
|
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&)>);
|
|
|
|
Metadata get_metadata_by_name(const String& name) const
|
|
{
|
|
return m_name_to_metadata.get(name);
|
|
};
|
|
|
|
private:
|
|
GFontDatabase();
|
|
~GFontDatabase();
|
|
|
|
HashMap<String, Metadata> m_name_to_metadata;
|
|
};
|