* @param string the string that needs measuring
* @param tj text adjustment
* @return the width of a String
*/
public float getStringWidth(String string, float tj){
DocumentFont font = gs().font;
char[] chars = string.toCharArray();
float totalWidth = 0;
for (int i = 0; i < chars.length; i++) {
float w = font.getWidth(chars[i]) / 1000.0f;
float wordSpacing = chars[i] == 32 ? gs().wordSpacing : 0f;
totalWidth += ((w - tj/1000f) * gs().fontSize + gs().characterSpacing + wordSpacing) * gs().horizontalScaling;
}
return totalWidth;