wrap icon indicating copy to clipboard operation
wrap copied to clipboard

Specify actual font name in PDF

Open austinbutler opened this issue 3 years ago • 0 comments

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.

austinbutler avatar Nov 30 '21 02:11 austinbutler