code: public static float parseLength(String string) {
  		// TODO: Evaluate the effect of this.
  		// It may change the default behavour of the methd if this is changed.
  		// return parseLength(string, Markup.DEFAULT_FONT_SIZE);
  		int pos = 0;
  		int length = string.length();
  		boolean ok = true;
  		while (ok && pos < length) {
  			switch (string.charAt(pos)) {
  			case '+':
  			case '-':
  			case '0':
  			case '1':
  			case '2':
  			case '3':
  			case '4':
  			case '5':
  			case '6':
  			case '7':
  			case '8':
  			case '9':
  			case '.':
  				pos++;
  				break;
  			default:
  				ok = false;
  			}
  		}
  		if (pos == 0)
  			return 0f;
  		if (pos == length)
  			return Float.parseFloat(string + "f");
  		float f = Float.parseFloat(string.substring(0, pos) + "f");
  		string = string.substring(pos);
  		// inches
  		if (string.startsWith("in")) {
  			return f * 72f;
  		}
  		// centimeters
  		if (string.startsWith("cm")) {
  			return (f / 2.54f) * 72f;
  		}
  		// millimeters
  		if (string.startsWith("mm")) {
  			return (f / 25.4f) * 72f;
  		}
  		// picas
  		if (string.startsWith("pc")) {
  			return f * 12f;
  		}
  		// default: we assume the length was measured in points
  		return f;
  	}
docs: Parses a length.
  
  @param string
  a length in the form of an optional + or -, followed by a
  number and a unit.
  @return a float