1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:27:35 +00:00

LibGfx: Make FontDatabase lookups case insensitive

This seems mostly harmless and matches what CSS expects from us at the
moment. Eventually our CSS font selection will become more sophisticated
and stop relying on Gfx::FontDatabase for things like this, but for now
it's a simple stopgap that lets websites do "font-family: arial" :^)
This commit is contained in:
Andreas Kling 2023-05-15 16:49:10 +02:00
parent 9a6a635e51
commit 9bd4add734

View file

@ -116,8 +116,8 @@ Font& FontDatabase::default_fixed_width_font()
}
struct FontDatabase::Private {
HashMap<DeprecatedString, NonnullRefPtr<Gfx::Font>> full_name_to_font_map;
HashMap<DeprecatedFlyString, Vector<NonnullRefPtr<Typeface>>> typefaces;
HashMap<DeprecatedString, NonnullRefPtr<Gfx::Font>, CaseInsensitiveStringTraits> full_name_to_font_map;
HashMap<DeprecatedFlyString, Vector<NonnullRefPtr<Typeface>>, CaseInsensitiveStringTraits> typefaces;
};
void FontDatabase::load_all_fonts_from_path(DeprecatedString const& root)