pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Hewson <j...@jahewson.com>
Subject Re: pdfbox warnings
Date Wed, 08 Apr 2015 20:56:22 GMT

> On 8 Apr 2015, at 13:17, Eric Douglas <edouglas@blockhouse.com> wrote:
> On Wed, Apr 8, 2015 at 3:59 PM, John Hewson <john@jahewson.com> wrote:
>>> On 8 Apr 2015, at 10:59, Eric Douglas <edouglas@blockhouse.com> wrote:
>>> Where are you getting the Arial Unicode MS?  It doesn't come with
>> Windows,
>>> that is, it's not installed on my Windows 8.1 Pro.
>>> Previously when I referenced a unicode font I used Lucida Sans Unicode.
>>> My Windows Arial includes Arial Black, Arial Bold, Arial Bold Italic,
>> Arial
>>> Italic, and Arial Regular.
>> As you’ve spotted, Arial Unicode MS doesn’t ship with Windows, but with
>> Office, which
>> kind of ruins my whole idea. We’ll need to take a closer look at the fonts
>> which really
>> are shipped with Windows. I’m on a Mac, so it’s a little tricky for me.
>> See: https://www.microsoft.com/typography/fonts/font.aspx?FMID=1081
>>> Windows likes to change their fonts, which is annoying when you have
>>> programs that run on different operating systems and you want consistent
>>> output.
>>> We used to reference fonts by name but even when it found the same font
>>> sometimes there were different versions.  We once had 2 machines running
>>> the same OS, Windows 98 SE, which produced different output from the same
>>> Courier font file name.
>>> I started writing Java with Windows XP Pro and copied the Lucida font
>> files
>>> from the Windows Fonts folder to embed in my jar to make sure my program
>>> output wouldn't look different when we changed OS.
>>> It is best if there's a free, redistributable font file you can embed in
>> a
>>> jar. (as long as they can't guarantee we can find the same font installed
>>> on every OS)
>> The problem here is that platform-specific behaviour is actually
>> desirable: a PDF
>> opened in Acrobat on Windows will render Arial instead of Helvetica, if
>> PDFBox
>> were to bundle its own Helvetica font, we’d be using the wrong font for
>> the platform,
>> despite it being a perfectly acceptable font. We’ve had users complain
>> that PDFBox
>> makes different substitutions from Evince and so the same PDF render with
>> different
>> fonts on the same system when opened in different viewers - we’ve tried to
>> fix these
>> kinds of issues, but the result is that fonts substitution really should
>> be platform-specific.
>> Having said that, you can always bundle your own fonts and use a custom
>> FontProvider
>> and PDFBox will give you consistent cross-platfrom rendering, if that’s
>> what your
>> project’s requirements call for, but out-of-the-box we have to provide
>> platform-specific
>> behaviour.
>> — John
> I don't know about regular text substitutions, as you describe using an
> installed Arial in place of Helvetica.  I was specifically looking for a
> custom replacement font to be included for symbols.  If I create a PDF with
> iText with an editable check box object, it puts in a reference to
> Zapfdingbats without giving me an option to embed the font.  As Windows
> doesn't have this font installed by default, when I tried to read that PDF
> back in and render it to the screen with pdfbox, it didn't draw the check
> marks.  If you view that same PDF in Adobe Reader on Windows without
> Zapfdingbats installed, it says it's using it's actual font Adobe Pi Std.
> Assuming you can't package the Adobe font with pdfbox for that
> substitution, the free redistributable Noto Sans Symbols font looks like a
> fine replacement.
> Font replacement can also be an option, if a program wants to tell pdfbox
> to use font x in place of font y.

Yes, in fact, we substitute all fonts except for the “fallback” font. My point is that
It’s better to substitute with platform fonts rather than bundling an otherwise
alien font with PDFBox.

It now looks like MS Gothic is a suitable substitute, as it’s shipped with Windows
itself, rather than with Office.

— John

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

View raw message