protected int findColumn(String textString, int x) {
		int startPos = 0;
		int col;
		for (col = 0; col < textString.length(); col++) {
			startPos += metrics.charWidth(textString.charAt(col));
			if (x < startPos) {
				break;
			}
		}
		return col;
	}
Finds the column position for the given pixel x coordinate in the indicated text string.
Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/field/SimpleTextField.java