Project: SWT
Bug 136472 GC#drawText doesn't work with arabic text when advance is on
Reported: 2006-04-12 16:54:20 | Status: resolved fixed

build Eclipse 3.2 M6 tested on gtk 2.4.4 and 2.8.2, same result. To reproduce the problem you need: use GC#drawString, have advance graphics on, use a arabic text sample (didn't last cjk or he). Here a snippet: public static void main(String[] args) { final Display display = new Display(); Shell shell = new Shell(display); shell.addListener(SWT.Paint, new Listener() { public void handleEvent(Event event) { GC gc = event.gc; gc.setAdvanced(true); if (!gc.getAdvanced()) { System.out.println("Advance graphics off"); } gc.setAntialias(SWT.ON); String string = "\u0627\u0644\u0627\u0634\u0643\u0627\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628"; Font font = new Font(display, "Tahoma", 16, SWT.NORMAL); TextLayout layout = new TextLayout(event.display); layout.setFont(font); layout.setText(string); layout.draw(gc, 10, 10); layout.dispose(); gc.setFont(font); gc.drawString(string, 10, 70); font.dispose(); } }); shell.setSize(280, 240); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose (); }

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java