Refine search
public Point2D getPoint2D(Point2D srcPt, Point2D dstPt) { if (dstPt == null) { dstPt = new Point2D.Float(); } dstPt.setLocation(srcPt.getX(), srcPt.getY()); return dstPt; }
@Override public float getWidthFromFont(int code) throws IOException { String name = codeToName(code); // width of .notdef is ignored for substitutes, see PDFBOX-1900 if (!isEmbedded && name.equals(".notdef")) { return 250; } float width = genericFont.getWidth(name); Point2D p = new Point2D.Float(width, 0); fontMatrixTransform.transform(p, p); return (float)p.getX(); }
/** * Returns the baseline that would be used with the given {@link AffineTransform} (or, more * strictly, the y coordinate of point (0,0) transformed through the current matrices). * * @param at * the {@link AffineTransform} that will be used to position glyphs on the page. * @return the baseline that would be used with the given {@link AffineTransform} * @see <a href= * "https://www.freetype.org/freetype2/docs/glyphs/glyphs-3.html">https://www.freetype.org/freetype2/docs/glyphs/glyphs-3.html</a> */ private static float calculateBaseline(AffineTransform at) { return (float) at.transform(new Point2D.Float(0, 0), new Point2D.Float()).getY(); }
public Point2D getPoint2D(Point2D srcPt, Point2D dstPt) { if (dstPt == null) { dstPt = new Point2D.Float(); } dstPt.setLocation(srcPt.getX(), srcPt.getY()); return dstPt; }
@Override public float getWidthFromFont(int code) throws IOException { String name = codeToName(code); float width = genericFont.getWidth(name); Point2D p = new Point2D.Float(width, 0); fontMatrixTransform.transform(p, p); return (float)p.getX(); }
/** * Placeholder interface to preserve parameter references in client code. * * @deprecated Please use {@link WarpTransform2DProvider} */ static interface Provider { ParameterDescriptor<Integer> DEGREE = WarpTransform2DProvider.DEGREE; ParameterDescriptorGroup PARAMETERS = WarpTransform2DProvider.PARAMETERS; ParameterDescriptor<Float> POST_SCALE_X = WarpTransform2DProvider.POST_SCALE_X; ParameterDescriptor<Float> POST_SCALE_Y = WarpTransform2DProvider.POST_SCALE_Y; ParameterDescriptor<Float> PRE_SCALE_X = WarpTransform2DProvider.PRE_SCALE_X; ParameterDescriptor<Float> PRE_SCALE_Y = WarpTransform2DProvider.PRE_SCALE_Y; ParameterDescriptor<?> X_COEFFS = WarpTransform2DProvider.X_COEFFS; ParameterDescriptor<?> Y_COEFFS = WarpTransform2DProvider.Y_COEFFS; }
@Override public float getWidthFromFont(int code) throws IOException { int cid = codeToCID(code); float width; if (cidFont != null) { width = getType2CharString(cid).getWidth(); } else if (isEmbedded && t1Font instanceof CFFType1Font) { width = ((CFFType1Font)t1Font).getType2CharString(cid).getWidth(); } else { width = t1Font.getWidth(getGlyphName(code)); } Point2D p = new Point2D.Float(width, 0); fontMatrixTransform.transform(p, p); return (float)p.getX(); }
/** * Returns the location of the destination point given a * point in the source. If {@code dstPt} is not * {@code null}, it will be used to hold the return value. * Since this is not a geometric operation, the {@code srcPt} * will equal the {@code dstPt}. * @param pSrcPt a {@code Point2D} that represents a point * in the source image * @param pDstPt a {@code Point2D}that represents the location * in the destination * @return the {@code Point2D} in the destination that * corresponds to the specified point in the source. */ public final Point2D getPoint2D(Point2D pSrcPt, Point2D pDstPt) { // Create new Point, if needed if (pDstPt == null) { pDstPt = new Point2D.Float(); } // Copy location pDstPt.setLocation(pSrcPt.getX(), pSrcPt.getY()); // Return dest return pDstPt; }
@Override public float getWidthFromFont(int code) throws IOException { String name = codeToName(code); // width of .notdef is ignored for substitutes, see PDFBOX-1900 if (!isEmbedded && ".notdef".equals(name)) { return 250; } float width = genericFont.getWidth(name); Point2D p = new Point2D.Float(width, 0); fontMatrixTransform.transform(p, p); return (float)p.getX(); }
/** * Returns the location of the destination point given a * point in the source. If {@code dstPt} is not * {@code null}, it will be used to hold the return value. * Since this is not a geometric operation, the {@code srcPt} * will equal the {@code dstPt}. * @param pSrcPt a {@code Point2D} that represents a point * in the source image * @param pDstPt a {@code Point2D}that represents the location * in the destination * @return the {@code Point2D} in the destination that * corresponds to the specified point in the source. */ public final Point2D getPoint2D(Point2D pSrcPt, Point2D pDstPt) { // Create new Point, if needed if (pDstPt == null) { pDstPt = new Point2D.Float(); } // Copy location pDstPt.setLocation(pSrcPt.getX(), pSrcPt.getY()); // Return dest return pDstPt; }
@Override public float getWidthFromFont(int code) throws IOException { String name = codeToName(code); // width of .notdef is ignored for substitutes, see PDFBOX-1900 if (!isEmbedded && name.equals(".notdef")) { return 250; } float width = genericFont.getWidth(name); Point2D p = new Point2D.Float(width, 0); fontMatrixTransform.transform(p, p); return (float)p.getX(); }
if (p.getX() == topLeft.getX() && p.getY() > topLeft.getY()) { xPoints.add(p); if (p.getY() == topLeft.getY() && p.getX() > topLeft.getX()) { yPoints.add(p); continue; Point2D btmRight = new Point2D.Float((float) yPoint.getX(), (float) xPoint.getY()); if (intersectionPoints.containsKey(btmRight) && intersectionPoints.get(btmRight)[0].equals(intersectionPoints.get(xPoint)[0])
@Override public float getWidthFromFont(int code) throws IOException { String name = codeToName(code); float width = genericFont.getWidth(name); Point2D p = new Point2D.Float(width, 0); fontMatrixTransform.transform(p, p); return (float)p.getX(); }
/** * Returns the point after it has been transformed by the transformation. */ private Point2D transform(float x, float y) { Point2D result = new Point2D.Float(x, y); result = _transform.transform(result, result); result.setLocation(result.getX(), -result.getY()); return result; }
@Override public float getWidthFromFont(int code) throws IOException { String name = codeToName(code); float width = genericFont.getWidth(name); Point2D p = new Point2D.Float(width, 0); fontMatrixTransform.transform(p, p); return (float)p.getX(); }
public Point2D getPoint2D( Point2D srcPt, Point2D dstPt ) { if ( dstPt == null ) dstPt = new Point2D.Float(); float x = (float)srcPt.getX(); float y = (float)srcPt.getY(); float f = 1.0f/(x*a13 + y*a23 + a33); dstPt.setLocation( (x*a11 + y*a21 + a31)*f, (x*a12 + y*a22 + a32)*f ); return dstPt; }
@Override public float getWidthFromFont(int code) throws IOException { int cid = codeToCID(code); float width; if (cidFont != null) { width = getType2CharString(cid).getWidth(); } else if (isEmbedded && t1Font instanceof CFFType1Font) { width = ((CFFType1Font)t1Font).getType2CharString(cid).getWidth(); } else { width = t1Font.getWidth(getGlyphName(code)); } Point2D p = new Point2D.Float(width, 0); fontMatrixTransform.transform(p, p); return (float)p.getX(); }
public Point2D getPoint2D(Point2D srcPt, Point2D destPt){ // This operation does not affect pixel location if(destPt==null) destPt = new Point2D.Float(); destPt.setLocation(srcPt.getX(), srcPt.getY()); return destPt; }
@Override public float getWidthFromFont(int code) throws IOException { int cid = codeToCID(code); float width; if (cidFont != null) { width = getType2CharString(cid).getWidth(); } else if (isEmbedded && t1Font instanceof CFFType1Font) { width = ((CFFType1Font)t1Font).getType2CharString(cid).getWidth(); } else { width = t1Font.getWidth(getGlyphName(code)); } Point2D p = new Point2D.Float(width, 0); fontMatrixTransform.transform(p, p); return (float)p.getX(); }
public Point2D getPoint2D(Point2D srcPt, Point2D dstPt) { if (dstPt == null) { dstPt = new Point2D.Float(); } dstPt.setLocation(srcPt.getX(), srcPt.getY()); return dstPt; }