BaseFont.createFont("Tec-Medium.afm", ...

Paulo

----- Original Message ----- 
From: "Torgeir Veimo" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, September 06, 2007 6:15 PM
Subject: [iText-questions] loading fonts from byte[]


> I'm trying to load fonts from some proprietary repository (day jcr repo)
> and thus I need to load the fonts from byte arrays. I've tried doing 
> 
> BaseFont tecMedium = BaseFont.createFont("Tec-Medium", 
>  BaseFont.WINANSI, true, true,
>  getBinaryContent(request,"/path/.../Tec-Medium.afm"),
>  getBinaryContent(request, "/path/.../Tec-Medium.pfb"), true);
> 
> where getBinaryContent is a method that returns a byte[] with the data
> given the path in the repository. 
> 
> However, I get encoding exceptions;
> 
> 
> *ERROR*: unable to load font; 
> com.lowagie.text.DocumentException: Font 'Tec-Regular' with 'Cp1252' is
> not recognized.
>        at com.lowagie.text.pdf.BaseFont.createFont(BaseFont.java:529)
> 
> Looking into the afm file I see among other things
> 
> ..
> FontName Tec-Medium
> FullName Tec-Medium
> FamilyName Tec-Medium
> ...
> EncodingScheme FontSpecific
> ..
> 
> Is any of this relevant? any clues why I cannot get my fonts loaded?


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to