Hi,

> [email protected] hat am 24. September 2013 um 10:42 
>geschrieben:
> 
> 
> Hi,
> 
> I'm having a problem loading Courier New as a true type font.  I'm using 
>version 1.8.2.  I've noticed there are a lot of bugs regarding true type 
>fonts, but one fix managed to fix loading Arial as a true type font 
>(https://issues.apache.org/jira/browse/PDFBOX-1663).  I'm just wondering if 
>there is any fix for Courier New?  If not, is there any work around?  The 
>think the problem exists with the widths in Courier as:
> PDType1Font.COURIER.getWidths(); returns null - would this be the same for 
>the Courier New font I'm loading?
> 
> My code that works with Arial:
> 
> File fontfile = new File("C:\\WINDOWS\\Fonts\\ARIAL.ttf");
> PDFont font = org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(doc, 
>fontfile);
> 
> My code that doesn't work with Courier New:
> 
> File fontfile = new File("C:\\WINDOWS\\Fonts\\COUR.ttf");
> PDFont font = org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(doc, 
>fontfile);
> 
> Thanks in advance,
> David
Hmm, I somehow didn't get the point. If you are using true type fonts the class
PDType1Font isn't involved,
consequently there can't be a problem with getWidths().
What exactly are you trying to do? Do you get a stacktrace?

> David Petrie
> Java Developer | Registration Systems Project Team : Registration IT | 
>National Records of Scotland |
> South Search Room, New Register House, 3 West Register Street, Edinburgh, EH1 
>3YT |
> Telephone: (0131 3144) 587

BR
Andreas Lehmkühler

Reply via email to