package org.apache.fop.fonts.truetype;
import java.io.IOException;
+import java.util.List;
import org.apache.fontbox.cff.CFFDataInput;
import org.apache.fontbox.cff.CFFFont;
@Override
protected void updateBBoxAndOffset() throws IOException {
+ Object bbox = fileFont.getTopDict().get("FontBBox");
+ if (bbox != null) {
+ List bboxList = (List) bbox;
+ int[] bboxInt = new int[4];
+ for (int i = 0; i < bboxInt.length; i++) {
+ bboxInt[i] = (Integer) bboxList.get(i);
+ }
+ for (OFMtxEntry o : mtxTab) {
+ o.setBoundingBox(bboxInt);
+ }
+ }
}
private static class Mapping {
package org.apache.fop.fonts.truetype;
+import java.awt.Rectangle;
import java.io.FileInputStream;
import java.io.InputStream;
assertEquals(carolynaWidths[i], alexBrush.getWidths()[gids[i]]);
}
}
+
+ @Test
+ public void testBoundingBoxes() {
+ assertEquals(sourceSansProBold.getBoundingBoxes()[0], new Rectangle(-231, -384, 1454, 1358));
+ }
}