Community
Participate
Working Groups
On NT fonts can only handle English characters unless the locale is set explicitly. Do the following text in German NT and both the label and the text will have content. Remove the call to setLocale and both will come up blank import org.eclipse.swt.widgets.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.*; public class FontDataTest { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); Text text = new Text(shell, SWT.MULTI); FontData fd = new FontData("MS Sans Serif", 10, 0); Font font = new Font(display,fd); text.setFont(font); text.setBounds(0,0,200,200); shell.open(); while (!shell.isDisposed()) { display.readAndDispatch(); } font.dispose(); display.dispose(); } } NOTES: McQ (10/1/2001 10:58:04 AM) - There are several odd things about this. First off, it's only *some* fonts which come up with the wrong locale. In particular, fonts which are specific to the locale you are in do work. In addition, the widget allows you to *type* the characters in, just not set them in with setText. It is important to fix this for R2.0. If no better strategy presents itself, then we will implicitely set the locale of the font (on NT only) if the user does not set it explicitely. Note that this will have the effect of *preventing* some fonts which would have otherwise been available from being used by us. McQ (10/1/2001 11:04:07 AM) - Note: The example code provided above does not appear to be complete. It's missing the setLocale and setText lines.
PRODUCT VERSION: 136a
This has been fixed in the R2.0 stream.