LibWeb: Skip font if it doesn't contain needed glyph in FontCascadeList

Before this change, we were only checking for actual glyph containment
in a font if unicode ranges were specified. However that is not
sufficient for emoji support, where we want to continue searching for
a font until one containing emojis is found.
This commit is contained in:
Aliaksandr Kalenik 2024-09-05 22:33:36 +02:00 committed by Tim Flynn
commit 67fe8d66b2
Notes: github-actions[bot] 2024-09-06 12:31:52 +00:00
3 changed files with 13 additions and 10 deletions

View file

@ -2326,7 +2326,7 @@ RefPtr<Gfx::FontCascadeList const> StyleComputer::compute_font_for_style_values(
}
auto found_font = StyleProperties::font_fallback(monospace, bold);
font_list->add(found_font->with_size(font_size_in_pt));
font_list->set_last_resort_font(found_font->with_size(font_size_in_pt));
return font_list;
}