| Code with Finding: |
class PdfContentByte {
/**
* Changes the text matrix.
* <P>
* Remark: this operation also initializes the current point position.</P>
*
* @param a operand 1,1 in the matrix
* @param b operand 1,2 in the matrix
* @param c operand 2,1 in the matrix
* @param d operand 2,2 in the matrix
* @param x operand 3,1 in the matrix
* @param y operand 3,2 in the matrix
*/
public void setTextMatrix(final float a, final float b, final float c, final float d, final float x, final float y) {
state.xTLM = x;
state.yTLM = y;
content.append(a).append(' ').append(b).append_i(' ')
.append(c).append_i(' ').append(d).append_i(' ')
.append(x).append_i(' ').append(y).append(" Tm").append_i(separator);
}
}
class PdfContentByte {
public float getEffectiveStringWidth(final String text, final boolean kerned) {
BaseFont bf = state.fontDetails.getBaseFont();
float w;
if (kerned)
w = bf.getWidthPointKerned(text, state.size);
else
w = bf.getWidthPoint(text, state.size);
if (state.charSpace != 0.0f && text.length() > 1) {
w += state.charSpace * (text.length() -1);
}
int ft = bf.getFontType();
if (state.wordSpace != 0.0f && (ft == BaseFont.FONT_TYPE_T1 || ft == BaseFont.FONT_TYPE_TT || ft == BaseFont.FONT_TYPE_T3)) {
for (int i = 0; i < text.length() -1; i++) {
if (text.charAt(i) == ' ')
w += state.wordSpace;
}
}
if (state.scale != 100.0)
w = w * state.scale / 100.0f;
//System.out.println("String width = " + Float.toString(w));
return w;
}
}
|