Text text = new Text(parent, SWT.NONE);
text.setText("This");
GC gc = new GC(text);
int currentPixelsX = text.getBounds().x;
int currentPixelsY = text.getBounds().y;
for (int i = 0; i < text.getText().length(); i++) {
System.out.println("X co-ordinate of " + text.getText().charAt(i) + ":" + currentPixelsX);
System.out.println("Y co-ordinate of " + text.getText().charAt(i) + ":" + currentPixelsY);
currentPixelsX = currentPixelsX + gc.getCharWidth(text.getText().charAt(i));
}
Это дает координаты пикселя относительно родителя текстового поля.