Stefan Pantke wrote:

I tried to load a front called CorsivaBold.ttf using BaseFont aBF = BaseFont.createFont("/Library/Fonts/CorsivaBold.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
Font font = new Font( aBF, 12);

As soon as my app runs, I get an exception explaining:
Document problem: /Library/Fonts/CorsivaBold.ttf is not a valid TTF or OTF file. Document problem: /Library/Fonts/CorsivaBold.ttf is not a valid TTF or OTF file.

Since I'm new to font handling at this level, I probably made some substantial
error. But what error?

A little history:
Adobe started as a company selling fonts: PostScript fonts (Type 1).
Apple and MicroSoft developed a competing font format: TrueType (ttf).
Unfortunately the standard according to Apple and the standard according
to MicroSoft diverged. The font was platform dependent. A font for
Macintosh didn't necessarily work on Windows and vice versa.
Then MicroSoft and Adobe came up with a new platform independent
font format: OpenType.
There are two flavors: OpenType with PS outlines (otf files)
and OpenType with TrueType outlines (ttf or otf files).
My guess is that your ttf is a TrueType font for Macintosh,
not an OpenType font with TrueType outlines.
br,
Bruno


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to