Skip to content

Specify actual font name in PDF#56

Open
austinbutler wants to merge 1 commit intoeprovst:developfrom
austinbutler:dynamic-embedded-font-name
Open

Specify actual font name in PDF#56
austinbutler wants to merge 1 commit intoeprovst:developfrom
austinbutler:dynamic-embedded-font-name

Conversation

@austinbutler
Copy link
Contributor

Description of the change

Uses the font's name as the name of the embedded font instead of the currently hard-coded courier.

Benefits

More clear what font is actually embedded in the PDF. Visually I was pretty sure it was Courier Prime, but the name of the font in the PDF data was just "courier" so I thought maybe it was not finding the right font.

Before:

❯ pdffonts ~/scripts/test.pdf
name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
courier                              CID TrueType      Identity-H       yes no  yes      9  0
courier                              CID TrueType      Identity-H       yes no  yes     14  0
courier                              CID TrueType      Identity-H       yes no  yes     19  0
courier                              CID TrueType      Identity-H       yes no  yes     24  0

After:

❯ pdffonts ~/scripts/test.pdf
name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
Courier+Prime                        CID TrueType      Identity-H       yes no  yes      9  0
Courier+Prime                        CID TrueType      Identity-H       yes no  yes     14  0
Courier+Prime                        CID TrueType      Identity-H       yes no  yes     19  0
Courier+Prime                        CID TrueType      Identity-H       yes no  yes     24  0

Possible drawbacks

Only thing I could think of is if there's some weird character issue with the name of some fonts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant