pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Self <matt...@mself.com>
Subject How can I add to the list of font substitutions in pdfbox 2.0.7?
Date Thu, 16 Nov 2017 19:21:27 GMT
I'm new here, so I posted this question to stack overflow
But perhaps this mailing list is a better way to ask this question:

I'm using FontMapper.getTrueTypeFont() to find available fonts by name in
pdfbox 2.0.7. This has a feature to map fonts (by name) so that if I ask
for Symbol and my system only has SymbolMT it will return that as a

But the default implementation doesn't map the other way. My system has
Symbol installed, but if I try to get SymbolMT it returns Helvetica as the
best match (which doesn't work very well).

The underlying FontMapperImpl class has an addSubstitute() method that lets
you add mappings, but the class is private to the package so I can't call
that (even though the method is marked public). The FontMapper interface
that FontMapperImpl implements does not include the addSubstitute() method.

In the Cookbook for pdfbox 1.8
<https://pdfbox.apache.org/1.8/cookbook/workingwithfonts.html> there is a
reference to using Resources/PDFBox_External_Fonts.properties to add
mappings, but this does not seem to be present in pdfbox 2.0.7.

Is there a way to add additional font mappings (by name) in pdfbox 2.0.7,
or do I need to build my own mapping layer outside of it? Thanks!

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message