Alexandar, on a completely different note:
It may be interesting to also look into fontbox (part of pdfbox), which is now also an apache project, and therefore we could use source synergy. http://incubator.apache.org/pdfbox/ For the issue you've mentioned: This may be due so some issues with CID fonts not properly defining ascent and descent, but I don't have a reference for it. We would probably need some fonts to test and check. Max 2009/9/21 Alexander Kiel <[email protected]>: > Hi, > > as I'm currently on the way to redesign the TrueType/OpenType file > reading, from time to time I stumble over some odd things. > > But instead of blindly refactoring, I think its better to ask you > before. > > Fonts have among other things the properties ascent, descent and > fontBBox which are defined in the PDF spec chapter 5.7 Font Descriptors. > > If I look into PDFFactory rev. 800217 line 1445 - 1483 method > makeFontDescriptor, I see two constructor calls, one for CID fonts and > one for the other fonts. For CID fonts the constructor of > PDFCIDFontDescriptor is called and for the others the constructor of > PDFFontDescriptor is called. PDFCIDFontDescriptor is a subclass of > PDFFontDescriptor. > > The odd thing here is, that the call of PDFCIDFontDescriptor doesn't use > the ascent nor the descent of the font descriptor. Instead it uses some > quantities out of the fontBBox to feed the PDFFontDescriptor. This can > be seen inside PDFCIDFontDescriptor rev. 679326. > > So as fontBBox, ascent and descent don't be the same thing, I would > recommend to change this. But this would properly break some things, > because we would get other values for ascent and descent in CID fonts. > > > Best Regards > Alex > > - > e-mail: [email protected] > web: www.alexanderkiel.net > >
