public String wordWrap(String s, int width, double scale) {
		if (!(s.indexOf(' ') > -1) && !(s.indexOf('\r') > -1))
			return s;
		ArrayList<String> lines = new ArrayList<String>();
		String[] currentLines = s.split("\r");
		for (String l : currentLines)
			lines.add(l);

		String result = "";
		for (int i = 0; i < lines.size(); i++) {
			String[] words = lines.get(i).split(" ");
			String line = "";
			for (int w = 0; w < words.length; w++) {
				int id = line.lastIndexOf("\r");
				if (getWidth(line.substring(id > -1 ? id : 0, line.length()) + words[w], scale) > width) {
					line += "\r " + words[w];
				} else
					line += " " + words[w];
			}
			result += line + "\r";
		}
		return result;
	}