Image image = new Image(Display.getCurrent(), textWidth, textHeight);
GC tmpGc = new GC(image);
tmpGc.setForeground(getForeground());
tmpGc.setBackground(gc.getBackground());
tmpGc.setFont(getFont());
tmpGc.drawText(text, 0, 0);
// set transform to rotate
Transform transform = new Transform(gc.getDevice());
transform.translate(x, y);
transform.rotate(360 - angle);