Hi,

Am 15.07.2013 14:47, schrieb [email protected]:
Hi,

The small example "Hello World using a TrueType font" on the pdfbox website does not work 
when selecting the Windows font "cour.ttf" (Courier New). It works with the non-fixed 
width fonts that I have tried (Arial, Albertus, Bookman Old Style, Garamond, Palatino, Segoe UI) 
and it works with Lucida Console, a fixed width font, but not Courier New.

This is the error:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5
         at 
org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadDescriptorDictionary(PDTrueTypeFont.java:418)
         at 
org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:201)
         at 
org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:177)
         at 
org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:158)
         at 
org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:145)
         at 
org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:132)
         at pdfbox_ttf_test.Main.main(Main.java:31)

To me this is the same error as PDFBOX-1335, except maybe it is still not fixed 
for all fonts.
It's the same method but not the same line. There is an issue with the width of
each glyph. PDFBox assumes a single value for each glyph, but the monospaced
don't have to provide such values. It's sufficient to deliver one for all
glyphs.
Please file an issue on JIRA [1] with the description from your mail.

I am using Windows 7 SP1 32-bit, pdfbox 1.8.2., NetBeans IDE 6.9.1

This is my source:
SNIP


Thanks in advance
Andreas Lehmkühler

[1] https://issues.apache.org/jira/browse/PDFBOX

Reply via email to