/** * Delegates to the enclosed <code>GeneralPath</code>. */ public Rectangle2D getBounds2D() { return path.getBounds2D(); }
public Rectangle2D getBounds2D() { return polygonPath.getBounds2D(); }
/** * Returns the bounds of the renderer path. * @return the bounds as Rectangle2D */ public Rectangle2D getBounds() { synchronized(LOG) { if (path == null) { render(); } } return path.getBounds2D(); }
/** * Calculate vertical bounds common to all rendered glyphs. * * @param tableData * @param glyphIndex the table index that has glyphs. * @return an array with two elements: min lower bound (but max 0), and max upper bound (but min * 0). */ double[] getYBounds(Object[][] tableData, int glyphIndex) { double minY = 0; double maxY = 0; for (Object[] aTableData : tableData) { GeneralPath path = (GeneralPath) aTableData[glyphIndex]; Rectangle2D bounds2D = path.getBounds2D(); if (bounds2D.isEmpty()) { continue; } minY = Math.min(minY, bounds2D.getMinY()); maxY = Math.max(maxY, bounds2D.getMaxY()); } return new double[]{minY, maxY}; } }
Rectangle2D bounds2D = path.getBounds2D(); if (bounds2D.isEmpty())
/** * Filled path bounding boxes. */ @Override public void fillPath(int windingRule) throws IOException { // bbox in user units Shape bbox = getLinePath().getBounds2D(); // draw path (note that getLinePath() is now reset) super.fillPath(windingRule); // save Graphics2D graphics = getGraphics(); Color color = graphics.getColor(); Stroke stroke = graphics.getStroke(); Shape clip = graphics.getClip(); // draw graphics.setClip(graphics.getDeviceConfiguration().getBounds()); graphics.setColor(Color.GREEN); graphics.setStroke(new BasicStroke(.5f)); graphics.draw(bbox); // restore graphics.setStroke(stroke); graphics.setColor(color); graphics.setClip(clip); }
Rectangle2D bounds = linePath.getBounds2D(); boolean noAntiAlias = isRectangular(linePath) && bounds.getWidth() > 1 && bounds.getHeight() > 1;
@Override public final Rectangle2D getBounds2D() { return (this.path.getBounds2D()); }
GeneralPath path = descendantFont.getPath(code); tab[index][4] = path; if (!path.getBounds2D().isEmpty())
return at.createTransformedShape(path.getBounds2D());
private Object[][] getGlyphs(PDType3Font font) throws IOException { Object[][] glyphs = new Object[256][4]; for (int index = 0; index <= 255; index++) { glyphs[index][0] = index; if (font.getEncoding().contains(index)) { glyphs[index][1] = font.getEncoding().getName(index); glyphs[index][2] = font.toUnicode(index); if (fontBBox.toGeneralPath().getBounds2D().isEmpty()) { glyphs[index][3] = NO_GLYPH; } else { glyphs[index][3] = renderType3Glyph(font, index); } totalAvailableGlyph++; } else { glyphs[index][1] = NO_GLYPH; glyphs[index][2] = NO_GLYPH; glyphs[index][3] = NO_GLYPH; } } return glyphs; }
Rectangle2D bbox = tilingPattern.getBBox().transform(patternMatrix).getBounds2D(); PDRectangle rect = new PDRectangle((float)bbox.getX(), (float)bbox.getY(), (float)bbox.getWidth(), (float)bbox.getHeight());
if (!path.getBounds2D().isEmpty())
Rectangle2D transformedBox = bbox.transform(matrix).getBounds2D();
private void calculatePath() { path = new GeneralPath(); path.moveTo(xpoints[0], ypoints[0]); for (int i = 1; i < npoints; i++) { path.lineTo(xpoints[i], ypoints[i]); } bounds = path.getBounds2D(); closedPath = null; }
private void calculatePath() { path = new GeneralPath(); path.moveTo(xpoints[0], ypoints[0]); for (int i = 1; i < npoints; i++) { path.lineTo(xpoints[i], ypoints[i]); } bounds = path.getBounds2D(); closedPath = null; }
private void calculatePath() { path = new GeneralPath(); path.moveTo(xpoints[0], ypoints[0]); for (int i = 1; i < npoints; i++) { path.lineTo(xpoints[i], ypoints[i]); } bounds = path.getBounds2D(); closedPath = null; }
@Override public final Rectangle getBounds() { return (this.path.getBounds2D().getBounds()); }
Rectangle2D bounds = PDType1Font.ZAPF_DINGBATS.getPath(name).getBounds2D(); float size = (float) Math.min(bounds.getWidth(), bounds.getHeight()) / 1000;
if (capHPath != null) fd.setCapHeight(Math.round(capHPath.getBounds2D().getMaxY()) * scaling); if (xPath != null) fd.setXHeight(Math.round(xPath.getBounds2D().getMaxY()) * scaling);