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:
parent
e831c374f4
commit
4d0f74a15c
9 changed files with 252 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue