Well, liz.otf is not really a very good font, just one that I got in the
net. You can try it with a good font using one of the CJK fonts that Acrobat
uses. Only for testing, of course, the license doesn't allow their use
outside of Acrobat.

----- Original Message ----- 
From: "Martin Lackner" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, August 23, 2005 4:41 PM
Subject: [iText-questions] OpenTypeFont-Example with BaseFont.IDENTITY_H


> Hi,
>
> I try to use otf-fonts with unicode.
>
> If I replace in the example OpenTypeFont of the itext-tutorial in step 4
BaseFont.CP1252 with BaseFont.IDENTITY_H
> ( ... BaseFont bf = BaseFont.createFont("liz.otf", BaseFont.IDENTITY_H,
true); ... )
> I get the following exception
>
> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
>          at
com.lowagie.text.pdf.RandomAccessFileOrArray.read(RandomAccessFileOrArray.ja
va:160)
>          at
com.lowagie.text.pdf.RandomAccessFileOrArray.readChar(RandomAccessFileOrArra
y.java:401)
>          at com.lowagie.text.pdf.CFFFont.getCard16(CFFFont.java:202)
>          at
com.lowagie.text.pdf.CFFFontSubset.<init>(CFFFontSubset.java:178)
>          at
com.lowagie.text.pdf.TrueTypeFontUnicode.writeFont(TrueTypeFontUnicode.java:
334)
>          at
com.lowagie.text.pdf.FontDetails.writeFont(FontDetails.java:258)
>          at
com.lowagie.text.pdf.PdfWriter.addSharedObjectsToBody(PdfWriter.java:1159)
>          at com.lowagie.text.pdf.PdfWriter.close(PdfWriter.java:1232)
>          at com.lowagie.text.pdf.PdfDocument.close(PdfDocument.java:947)
>          at com.lowagie.text.Document.close(Document.java:520)
>          at
com.lowagie.examples.fonts.getting.OpenTypeFont.main(OpenTypeFont.java:35)
>
> with itext 1.3 and itext 1.3.2
>
> If I use "UTF-8" or "UTF-16" instead of BaseFont.CP1252 I get no
exception, but the characters are not printed as expected.
>
> Is there a way to use otf (like ttf) with a Unicode-Encoding?
>
> Martin
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to