GFontDatabase.h 549 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include <AK/AKString.h>
  3. #include <AK/HashMap.h>
  4. #include <AK/Function.h>
  5. class Font;
  6. class GFontDatabase {
  7. public:
  8. static GFontDatabase& the();
  9. RetainPtr<Font> get_by_name(const String&);
  10. void for_each_font(Function<void(const String&)>);
  11. void for_each_fixed_width_font(Function<void(const String&)>);
  12. private:
  13. GFontDatabase();
  14. ~GFontDatabase();
  15. struct Metadata {
  16. String path;
  17. bool is_fixed_width;
  18. int glyph_height;
  19. };
  20. HashMap<String, Metadata> m_name_to_metadata;
  21. };