code: public String clipString(String str, int width, FontOptions options, boolean appendPeriods)
  	{
  		str = processString(str, options);
  		if (appendPeriods)
  			width -= 4;
  
  		int pos = (int) getCharPosition(str, options, width, 0);
  		return str.substring(0, pos) + (pos < str.length() && appendPeriods ? "..." : "");
  	}
docs: Clips a string to fit in the specified width.
  
  @param str the str
  @param width the width
  @param options the options
  @param appendPeriods the append periods
  @return the string