/** * Transforms the given point by this matrix. * * @param vector 2D vector */ public Vector transform(Vector vector) { float a = single[0]; float b = single[1]; float c = single[3]; float d = single[4]; float e = single[6]; float f = single[7]; float x = vector.getX(); float y = vector.getY(); return new Vector(x * a + y * c + e, x * b + y * d + f); }
@Override public Vector getPositionVector(int code) { // units are always 1/1000 text space, font matrix is not used, see FOP-2252 return descendantFont.getPositionVector(code).scale(-1 / 1000f); }
/** * Returns a new vector scaled by both x and y. * * @param sxy x and y scale */ public Vector scale(float sxy) { return new Vector(x * sxy, y * sxy); }
/** * Returns the default position vector (v). * * @param cid CID */ private Vector getDefaultPositionVector(int cid) { return new Vector(getWidthForCID(cid) / 2, dw2[0]); }
/** * Transforms the given point by this matrix. * * @param vector 2D vector */ public Vector transform(Vector vector) { float a = single[0]; float b = single[1]; float c = single[3]; float d = single[4]; float e = single[6]; float f = single[7]; float x = vector.getX(); float y = vector.getY(); return new Vector(x * a + y * c + e, x * b + y * d + f); }
/** * Returns the displacement vector (w0, w1) in text space, for the given character. * For horizontal text only the x component is used, for vertical text only the y component. * * @param code character code * @return displacement vector * @throws IOException */ public Vector getDisplacement(int code) throws IOException { return new Vector(getWidth(code) / 1000, 0); }
@Override public Vector getPositionVector(int code) { // units are always 1/1000 text space, font matrix is not used, see FOP-2252 return descendantFont.getPositionVector(code).scale(-1 / 1000f); }
/** * Transforms the given point by this matrix. * * @param vector 2D vector */ public Vector transform(Vector vector) { float a = single[0]; float b = single[1]; float c = single[3]; float d = single[4]; float e = single[6]; float f = single[7]; float x = vector.getX(); float y = vector.getY(); return new Vector(x * a + y * c + e, x * b + y * d + f); }
@Override public Vector getDisplacement(int code) throws IOException { return getFontMatrix().transform(new Vector(getWidth(code), 0)); }
@Override public Vector getPositionVector(int code) { // units are always 1/1000 text space, font matrix is not used, see FOP-2252 return descendantFont.getPositionVector(code).scale(-1 / 1000f); }
@Override public Vector getDisplacement(int code) throws IOException { if (isVertical()) { return new Vector(0, descendantFont.getVerticalDisplacementVectorY(code) / 1000f); } else { return super.getDisplacement(code); } }