| 
									
										
										
										
											2019-02-12 14:35:33 +01: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 16:50:08 +02:00
										 |  |  |     GFontDatabase(); | 
					
						
							| 
									
										
										
										
											2019-02-12 14:35:33 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     RetainPtr<Font> get_by_name(const String&); | 
					
						
							|  |  |  |     void for_each_font(Function<void(const String&)>); | 
					
						
							| 
									
										
										
										
											2019-03-06 14:06:40 +01:00
										 |  |  |     void for_each_fixed_width_font(Function<void(const String&)>); | 
					
						
							| 
									
										
										
										
											2019-02-12 14:35:33 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     ~GFontDatabase(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-06 14:06:40 +01:00
										 |  |  |     struct Metadata { | 
					
						
							|  |  |  |         String path; | 
					
						
							|  |  |  |         bool is_fixed_width; | 
					
						
							|  |  |  |         int glyph_height; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     HashMap<String, Metadata> m_name_to_metadata; | 
					
						
							| 
									
										
										
										
											2019-02-12 14:35:33 +01:00
										 |  |  | }; |