pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Mulder <ammul...@gmail.com>
Subject Character widths
Date Sun, 31 Jul 2016 21:01:55 GMT
I was poking around the code for string widths in PDFont.getStringWidth and etc.

It looks like to compute the width of a string it just adds up the
widths of each individual character in the string:

https://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java?revision=1750576&view=markup#l339

But the AFM files for the standard 14 fonts defines pairwise kerning
adjustments, so e.g. "AV" takes less width than the normal width of
"A" plus the normal width of "V":

https://wwwimages2.adobe.com/content/dam/Adobe/en/devnet/font/pdfs/Core14_AFMs.zip

Is there something I'm missing?  Or does this just mean PDFont
occasionally overestimates the width of text in those fonts?

Thanks,
      Aaron

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message