Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom font name on embed #543

Merged
merged 5 commits into from Aug 6, 2020
Merged

Conversation

ztoben
Copy link
Contributor

@ztoben ztoben commented Jul 28, 2020

As discussed in #537 this allows the use of a custom font name so that we can have a predictive binary output when embedding fonts into the pdf. Happy to make any changes you deem necessary.

Copy link
Owner

@Hopding Hopding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ztoben This looks great! Thanks for working on this. I've just requested a few small changes.

In addition to the review comments, I would like the customName functionality to be supported by all font embedders, including StandardFontEmbedder. This keeps things predictable and consistent, even if it isn't strictly necessary. So, if you don't mind, please take a look at adding this as well.

src/api/PDFDocument.ts Outdated Show resolved Hide resolved
@ztoben
Copy link
Contributor Author

ztoben commented Aug 3, 2020

@Hopding I think I addressed all of your comments. Let me know if there's any other changes to be made.

Copy link
Owner

@Hopding Hopding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ztoben Just a couple more small changes, then we should be good to go 👍

src/core/embedders/StandardFontEmbedder.ts Outdated Show resolved Hide resolved
tests/api/PDFDocument.spec.ts Show resolved Hide resolved
@ztoben
Copy link
Contributor Author

ztoben commented Aug 6, 2020

@Hopding okay, let's try this again 😄

Copy link
Owner

@Hopding Hopding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks again @ztoben 👍

@Hopding Hopding merged commit 9090b9c into Hopding:master Aug 6, 2020
@Hopding
Copy link
Owner

Hopding commented Aug 6, 2020

This feature will be available in the next release. I'm planning to cut it this weekend.

@Hopding
Copy link
Owner

Hopding commented Aug 8, 2020

Version 1.10.0 is now published with this feature. The full release notes are available here.

You can install this new version with npm:

npm install pdf-lib@1.10.0

It's also available on unpkg:

As well as jsDelivr:

divinehawk pushed a commit to divinehawk/pdf-lib that referenced this pull request Aug 31, 2020
* allow custom font name on embed

* linting

* customFontName -> customName, additional testing around font embedding

* address additional comments

* remove console log
Hopding pushed a commit that referenced this pull request Aug 30, 2021
* allow custom font name on embed

* linting

* customFontName -> customName, additional testing around font embedding

* address additional comments

* remove console log
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.

None yet

2 participants