1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:17:46 +00:00

LibPDF: Add Type0 and TrueType fonts

This commit is contained in:
Matthew Olsson 2022-03-25 08:19:34 -07:00 committed by Andreas Kling
parent e831c374f4
commit 4d0f74a15c
9 changed files with 252 additions and 0 deletions

View file

@ -6,6 +6,8 @@
#include <LibPDF/CommonNames.h>
#include <LibPDF/Fonts/PDFFont.h>
#include <LibPDF/Fonts/TrueTypeFont.h>
#include <LibPDF/Fonts/Type0Font.h>
#include <LibPDF/Fonts/Type1Font.h>
namespace PDF {
@ -14,8 +16,12 @@ PDFErrorOr<NonnullRefPtr<PDFFont>> PDFFont::create(Document* document, NonnullRe
{
auto subtype = TRY(dict->get_name(document, CommonNames::Subtype))->name();
if (subtype == "Type0")
return TRY(Type0Font::create(document, dict));
if (subtype == "Type1")
return TRY(Type1Font::create(document, dict));
if (subtype == "TrueType")
return TRY(TrueTypeFont::create(document, dict));
dbgln("Unknown font subtype: {}", subtype);
TODO();