diff --git a/Userland/Libraries/LibPDF/Fonts/Type0Font.cpp b/Userland/Libraries/LibPDF/Fonts/Type0Font.cpp index d7921a74d6..dbebb02610 100644 --- a/Userland/Libraries/LibPDF/Fonts/Type0Font.cpp +++ b/Userland/Libraries/LibPDF/Fonts/Type0Font.cpp @@ -29,7 +29,7 @@ PDFErrorOr> Type0Font::create(Document* document, Nonnu u16 default_width = 1000; if (descendant_font->contains(CommonNames::DW)) - default_width = descendant_font->get_value(CommonNames::DW).get(); + default_width = descendant_font->get_value(CommonNames::DW).to_int(); HashMap widths; @@ -40,16 +40,16 @@ PDFErrorOr> Type0Font::create(Document* document, Nonnu for (size_t i = 0; i < widths_array->size(); i++) { auto& value = widths_array->at(i); if (!pending_code.has_value()) { - pending_code = value.get(); + pending_code = value.to_int(); } else if (value.has>()) { auto array = value.get>()->cast(); auto code = pending_code.release_value(); for (auto& width : *array) - widths.set(code++, width.get()); + widths.set(code++, width.to_int()); } else { auto first_code = pending_code.release_value(); - auto last_code = value.get(); - auto width = widths_array->at(i + 1).get(); + auto last_code = value.to_int(); + auto width = widths_array->at(i + 1).to_int(); for (u16 code = first_code; code <= last_code; code++) widths.set(code, width); diff --git a/Userland/Libraries/LibPDF/Fonts/Type1Font.cpp b/Userland/Libraries/LibPDF/Fonts/Type1Font.cpp index d44de2f968..cd95238182 100644 --- a/Userland/Libraries/LibPDF/Fonts/Type1Font.cpp +++ b/Userland/Libraries/LibPDF/Fonts/Type1Font.cpp @@ -61,12 +61,12 @@ PDFErrorOr Type1Font::parse_data(Document* document, NonnullRef HashMap widths; for (size_t i = 0; i < widths_array->size(); i++) - widths.set(first_char + i, widths_array->at(i).get()); + widths.set(first_char + i, widths_array->at(i).to_int()); u16 missing_width = 0; auto descriptor = MUST(dict->get_dict(document, CommonNames::FontDescriptor)); if (descriptor->contains(CommonNames::MissingWidth)) - missing_width = descriptor->get_value(CommonNames::MissingWidth).get(); + missing_width = descriptor->get_value(CommonNames::MissingWidth).to_int(); return Type1Font::Data { to_unicode, encoding.release_nonnull(), move(widths), missing_width }; }