You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Guillem Saint-Germes <gu...@ultimatesoftware.com> on 2019/12/20 16:58:46 UTC

Single directory as source of all available fonts

Hello there,

In order to be system agnostic when deploying a service which use PDFBox
2.0.16, I would like to use a single specific directory as the source of
all available fonts (regardless of the system fonts).

Looking at the code it seems that the only way to do that would be to use
FontMappers.set(FontMapper fontMapper) and implement a custom mapper.
However this would force me to reimplement all the nice things already
handled in FontMapperImpl, FileSystemFontProvider and FontFileFinder.

So I thought we could overload FileSystemFontProvider constructor to
provide a (custom) FontFileFinder, and use this FontProvider
in FontMapperImpl.
But all those classes are package protected and thus not accessible from
the library users.

Would you have any ideas or pointers on how to do this? It might require a
pull request on the library code to allow it.

Disclaimer I am not sure if this is the right place to ask those questions,
but any feedback is welcome.

Best Regards,
Guillem

-- 




This e-mail message and any attachments to it are intended only for the 
named recipients and may contain legally privileged and/or confidential 
information. If you are not one of the intended recipients, do not 
duplicate or forward this e-mail message.

Re: Single directory as source of all available fonts

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 20.12.2019 um 17:58 schrieb Guillem Saint-Germes:
> Hello there,
>
> In order to be system agnostic when deploying a service which use PDFBox
> 2.0.16, I would like to use a single specific directory as the source of
> all available fonts (regardless of the system fonts).
>
> Looking at the code it seems that the only way to do that would be to use
> FontMappers.set(FontMapper fontMapper) and implement a custom mapper.
> However this would force me to reimplement all the nice things already
> handled in FontMapperImpl, FileSystemFontProvider and FontFileFinder.
>
> So I thought we could overload FileSystemFontProvider constructor to
> provide a (custom) FontFileFinder, and use this FontProvider
> in FontMapperImpl.
> But all those classes are package protected and thus not accessible from
> the library users.
>
> Would you have any ideas or pointers on how to do this? It might require a
> pull request on the library code to allow it.
>
> Disclaimer I am not sure if this is the right place to ask those questions,
> but any feedback is welcome.

It is the right place... but why not just copy the code? We're usually 
reluctant to make stuff more available because this sometiimes results 
in new usages that nobody ever thought about, and it also locks the API.

Tilman


>
> Best Regards,
> Guillem
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org