LibPDF: Actually return an error when failing to load replacement fonts

This commit is contained in:
Julian Offenhäuser 2023-03-24 22:16:50 +01:00 committed by Andrew Kaster
parent fec7ccf020
commit 5deac3a7f5
Notes: sideshowbarker 2024-07-16 22:19:44 +09:00

View File

@ -85,7 +85,7 @@ PDFErrorOr<NonnullRefPtr<Gfx::Font>> PDFFont::replacement_for(StringView name, f
float point_size = (font_size * POINTS_PER_INCH) / DEFAULT_DPI;
auto font = Gfx::FontDatabase::the().get(font_family, font_variant, point_size);
if (!font)
Error::internal_error("Failed to load {} {} at {}pt", font_family, font_variant, point_size);
return Error::internal_error("Failed to load {} {} at {}pt", font_family, font_variant, point_size);
return font.release_nonnull();
}