Bug 4832 - German: Fonts cannot handle German characters (1GKMHHY)
Summary: German: Fonts cannot handle German characters (1GKMHHY)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: All Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Mike Wilson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-11 14:23 EDT by Tod Creasey CLA
Modified: 2001-11-01 10:49 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tod Creasey CLA 2001-10-11 14:23:47 EDT
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.
Comment 1 DJ Houghton CLA 2001-10-29 16:42:02 EST
PRODUCT VERSION: 136a


Comment 2 Silenio Quarti CLA 2001-11-01 10:49:47 EST
This has been fixed in the R2.0 stream.