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

useFont/addFont with PDFontSupplier (FSSupplier<PDFont>) #384

Merged
merged 3 commits into from
Sep 16, 2019

Conversation

DSW-PS
Copy link
Contributor

@DSW-PS DSW-PS commented Sep 9, 2019

Hi @danfickle
this is the pr I offered in issue #383 .

As per your suggestion I also added the functionality as useFont methods to the PdfRendererBuilder.

I moved the already existing PDFontSupplier to a normal class so we can extend it - I would have prefered a useFont / addFont with direct FSSupplier but I wasn't too keen on reordering parameters just to clear the type-earasure error as it would clash with the useFont/addFont(FSSupplier ...) methods.

DSW-PS and others added 3 commits September 6, 2019 10:56
This method allows to specify a FSSupplier<PDFont> that can either load
a PDFont or serve an already loaded one to cut down on duplicate fonts/
subsets if the user is also writing directly to the PDDocument with some
of the fonts used in the html.
Made PDFontSupplier (private static class in PdfBoxFontResolver) to
actual class that can be subclassed if needed.

Would have prefered to have a FSSupplier<PDFont> method in
PdfBoxFontResolver but due to type-erasure error that is not possible.

Added useFont(PDFontSupplier, ...) method to PdfRendererBuilder
@danfickle
Copy link
Owner

Thanks a lot @DSW-PS. All looks good.

@danfickle danfickle merged commit 5d4b37e into danfickle:open-dev-v1 Sep 16, 2019
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.

2 participants