Hi,
I am using ABD.ttf, arial.ttf, ariblk.ttf to add text with each of the fonts mentioned. ABD.ttf (Agenda Bold is a PC font) and the other two arial.ttf,ariblk.ttf are MAC fonts. While adding the text I am getting the following error:


java.lang.ArithmeticException: / by zero at com.lowagie.text.pdf.TrueTypeFont.readGlyphWidths at com.lowagie.text.pdf.TrueTypeFont.process at
com.lowagie.text.pdf.TrueTypeFont. at com.lowagie.text.p


I looking into the source code of TrueTypeFont class and found that the following line is the cause for error because head.unitsPerEm is being assigned to zero:
GlyphWidths[k] = (rf.readUnsignedShort() * 1000) / head.unitsPerEm;


ie., when the font file is read to retrieve unitsPerEm in FontHeader protected class it is reading the two required bytes as 0 in the following assignment:
head.unitsPerEm = rf.readUnsignedShort();


Can you please suggest me what might be the cause for this error and how can we correct it? Is this because the font file is corrupted?

Thanks,
Raj.

_________________________________________________________________
Get FREE unlimited Citibank ATM transactions! http://go.msnserver.com/IN/52040.asp Discover real-value banking here.




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to