Hi,

I use the pdfbox with the embedded font DejaVuSansCondensed.ttf as a
PDType0Font
type. I get in trouble when I try to position some text in the document.
The functions getAscent(),getCapHeight(),getXHeight(),getDescent() provided
by PDFont.getFontDescriptor() delivers values, I do not expect. Also the
function PDFont.getHeight(*int* code) returns for any code '1.0'. If I use
a standard PDType1Font everything is fine.

Is this a bug or do I use this functions in the right way?

Thank you very much for your help.

Uwe

PDDocument document = new PDDocument();

PDFont fontTTF = PDType0Font.*load*(document, *new* File("/home/xxxx/temp/
DejaVuSansCondensed.ttf"));

System.out.println( fontTTF.getFontDescriptor().getAscent());

System.out.println( fontTTF.getFontDescriptor().getCapHeight());

System.out.println( fontTTF.getFontDescriptor().getXHeight());

System.out.println( fontTTF.getFontDescriptor().getDescent());

System.out.println( fontTTF.getHeight('X'));

System.out.println( fontTTF.getHeight('x'));

Reply via email to