C++ SDK - bad /BBox for any TT fonts in appearance stream even though they display fine
I am using teh STAMPR sample to create a custom annotation type. It works as far as displaying it goes, but the first time it displays a True Type character, i get the pop up that says the font has a bad /BBox. I have tried diffrent fonts and they all getit. i use the font elsewhere in a textrun and it doesn't get the error.
I modified the Cos generation in teh sample as shown below the commented out parts were where I tried a couple of things - one that I found suggested as it culd force a defaut and the other just being a large BBox that no character should ever exceed. Currently not adding the entry at all as the doc say it will be determined by using information in the font.
After I get the message box once, it doesn't show again until I close and reopen the file.
And finally, there is one symptom that concerns me the most and makes me wonder if it might be a problem with Acrobat. If I use two different fonts, it will only complain about teh first charcter of the first font. It will not report a problem with the second font. This is true in either order; whichever font I use first will get an error reported once only and teh other font will not get an error reported.
Creating the font entry:
// Add Font resource to Resources dictionary.
fontResObj = CosNewDict(cdoc, true, 1L);
fontResObj2 = CosNewDict(cdoc, true, 5L);
cObj = CosNewNameFromString(cdoc, false, "Font");
CosDictPutKeyString(fontResObj2, "Type", cObj);
cObj = CosNewNameFromString(cdoc, false, "TrueType");
CosDictPutKeyString(fontResObj2, "Subtype", cObj);
//cObj = CosNewNameFromString(cdoc, false, CurrentTickItem->FontName.c_str());
//CosDictPutKeyString(fontResObj2, "Name", cObj);
cObj = CosNewNameFromString(cdoc, false, sFontName);
CosDictPutKeyString(fontResObj2, "BaseFont", cObj);
//cBBoxObj = CosNewArray(cdoc, false, 4L);
//CosArrayInsert(cBBoxObj, 0L, CosNewInteger(cdoc, false, 0L)); // left
//CosArrayInsert(cBBoxObj, 1L, CosNewInteger(cdoc, false, 0L)); // top
//CosArrayInsert(cBBoxObj, 2L, CosNewInteger(cdoc, false, 0L)); // right
//CosArrayInsert(cBBoxObj, 3L, CosNewInteger(cdoc, false, 0L)); // bottom
//CosDictPutKeyString(fontResObj2, "FontBBox", cBBoxObj);
//cObj = CosNewNameFromString(cdoc, false, "[-8 -280 995 855]");
//CosDictPutKeyString(fontResObj2, "FontBBox", cObj);
CosDictPutKeyString(fontResObj, sFontName, fontResObj2);
CosDictPutKeyString(cResObj, "Font", fontResObj);
