Community
Participate
Working Groups
Created attachment 175785 [details] Class for reproducing bug I have a problem with drawing some UTF symbols (for example 'ߐ') using draw2d when I am using antialias or alpha . I am attaching class that can reproduce it is behaviour. For reproducing you must uncomment one of lines in the method BadTest::paintFigure
Table with characters that not displayed - http://en.wikipedia.org/wiki/N%27Ko
Does the problem happen with this snippet: public static void main(String args[]) { Display d = new Display(); Shell shell = new Shell(d); shell.setSize(500, 500); shell.addListener(SWT.Paint, new Listener() { public void handleEvent(Event e) { TextLayout layout = new TextLayout(e.display); //U+07C0 to U+07FA layout.setText("Magic Symbol - \u07d0"); layout.draw(e.gc, 10, 10); e.gc.setAlpha(127); layout.draw(e.gc, 10, 50); layout.dispose(); } }); shell.open(); while (!shell.isDisposed()) { if (!d.readAndDispatch()) d.sleep(); } d.dispose(); } setAlpha/setTextAntialias/etc causes the TextLayout to draw text using GPI+, it is possible that your system does not have a font compatible with GDI+ that supports N'Ko script.
I see the problem happens on GC#drawText() (TextLayout is fine) public static void main335 (String[] args) { Display d = new Display(); Shell shell = new Shell(d); shell.setSize(500, 500); shell.addListener(SWT.Paint, new Listener() { public void handleEvent(Event e) { TextLayout layout = new TextLayout(e.display); //U+07C0 to U+07FA layout.setText("Magic Symbol - \u07d0"); layout.draw(e.gc, 10, 10); e.gc.drawText("Magic Symbol - \u07d0", 160, 10); e.gc.setAlpha(127); layout.draw(e.gc, 10, 50); e.gc.drawText("Magic Symbol - \u07d0", 160, 50); layout.dispose(); } }); shell.open(); while (!shell.isDisposed()) { if (!d.readAndDispatch()) d.sleep(); } d.dispose(); } When Advance is true, TextLayout draws with Graphics_DrawDriverString (the glyphs are get using ScriptShape()) and GC draw with Graphics_DrawString
I don't understand - what solution for fixing this bug? I posted this sample because in my real code I can modify only paintFigure method. I can't add listener to the Shell because I don't have access to it object.
Sorry Alexandr, I was justing trying to narrow down your example to a SWT only example (no draw2d). This information is no use for you, unless you know draw2d internals and find a way to make it draw text using SWT TextLayout instead of SWT GC (i.e. maybe there are different ways to draw text in draw2d and one uses TextLayout).
In MacOS it works perfectly.
But I need this behaviour on Windows 7
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.