Community
Participate
Working Groups
Build ID: M20060629-1905 Steps To Reproduce: 1.Create a shell. 2.Create a TextLayout instance and set some gb18030 characters as its text. 3.Run the application and find that these characters cannot display correctly. More information: The code snippet used to reproduce this problem: /** * @param args */ public static void main(String[] args) { final Display display = new Display(); final Shell shell = new Shell(display, SWT.SHELL_TRIM); shell.setSize(358, 217); shell.addListener(SWT.Paint, new Listener() { public void handleEvent(Event event) { TextLayout layout = new TextLayout(display); event.gc.setForeground(display.getSystemColor(SWT.COLOR_BLUE)); String text = "sss \u1820, \u1821, \ua000, \ua001"; // event.gc.drawText(text, 0, 0); layout.setText(text); layout.setWidth(shell.getBounds().width); layout.draw(event.gc, 0, 0); layout.dispose(); } }); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
Eclipse 3.2.x is finished, I'm testing with HEAD, please do the same when you report futher results. A regular English XP doesn't have any font that supports mongolian and yi. If you install GB18030 support package you can set the TextLayout font to SimSun-18030 and then it will work. Note that the fontlinking used by TextLayout doesn't work for 100% of the scripts in the world. When using a rare script you need to set the font. In Vista, I have the same problem, font linking doesn't work. The problem is that I couldn't find one font that supports both scripts. In Vista, "Mongolian Baiti" support Mongolian and "Microsoft Yi Baiti" supports Yi. For this to work on vista I had to set the right font for each segment of text you gave. In this platform
Can this be handled for 3.3.1?
(In reply to comment #2) > Can this be handled for 3.3.1? Sorry, we are not changing this part of the code in the 3.3.maintenance stream. Note: the application can workaround this problem by setting the right font.
What Felipe is saying is that there are too many changes to put in a 3.3.x release. The risk is too high that something will break.
Any plans to fix this in 3.4?
I don't have a fix for this. TextLayout uses MLang for font substition and this technology fails for mongolian and yi. GDI font substituion works here.
Is this a platform limitation then?
Fixed in HEAD > 20080404