Project: SWT
Bug 89367 String is not rendered inside stringExtent
Reported: 2005-03-29 11:15:42 | Status: resolved fixed

public class FontScaling { static float value = 1; public static void main(String[] args) { final Display display = new Display(); final Shell shell = new Shell(display); shell.setText("Shell"); shell.setFont(new Font(display, "Arial", 12, 0)); shell.addPaintListener(new PaintListener() { public void paintControl(PaintEvent e) { GC gc = e.gc; Transform t = new Transform(display); //t.translate(60, 60); t. scale(value, value); gc.setTransform(t); String s = "Test string XYZ"; Point d = gc.stringExtent(s); gc.drawRectangle(0, 0, d.x, d.y); gc.drawString(s, 0, 0, true); value += 0.003; } }); shell.setSize(200, 200); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java