1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:38:10 +00:00

LibWeb: Port FontCache to new Strings

This commit is contained in:
Sam Atkins 2023-02-17 14:06:55 +00:00 committed by Linus Groh
parent faab2fe101
commit 1c77867c78
4 changed files with 18 additions and 21 deletions

View file

@ -515,7 +515,7 @@ static void paint_text_fragment(PaintContext& context, Layout::TextNode const& t
auto& font = fragment.layout_node().font();
auto scaled_font = [&]() -> RefPtr<Gfx::Font> {
auto device_font_pt_size = context.enclosing_device_pixels(font.presentation_size());
FontSelector font_selector = { font.family(), static_cast<float>(device_font_pt_size.value()), font.weight(), font.width(), font.slope() };
FontSelector font_selector = { FlyString::from_utf8(font.family()).release_value_but_fixme_should_propagate_errors(), static_cast<float>(device_font_pt_size.value()), font.weight(), font.width(), font.slope() };
if (auto cached_font = FontCache::the().get(font_selector)) {
return cached_font;
}