Bug 35335 - README: [Fonts] DBCS: customized font won't be saved
Summary: README: [Fonts] DBCS: customized font won't be saved
Status: CLOSED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: PC Linux-Motif
: P2 major (vote)
Target Milestone: 2.1.1   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 35915
Blocks:
  Show dependency tree
 
Reported: 2003-03-20 01:23 EST by Masayuki Fuse CLA
Modified: 2003-05-23 03:36 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Masayuki Fuse CLA 2003-03-20 01:23:26 EST
Driver : RC2 and I20030319
Platform: RedHat 8.0 Professional ja_JP.eucjp locale

Steps
1. at Preferences - font, select Text Font, click change button
2. select "jisx0208.1983" for char set, "fixed (kochi)", "12" for size, then
click OK button. make sure "kochi-fixed-regular-12" is displayed.
3. click OK
4. get back to the font preference menu, "misc-fixed-regular-12" is shown.
Comment 1 Tod Creasey CLA 2003-03-21 09:58:02 EST
The problem here is not getting the wrong font but with the way we display it
abd with the way SWT loads it in.

If you export your font preferences after the selection you get

org.eclipse.ui.workbench/org.eclipse.jface.bannerfont=1|fixed|14|0|MOTIF|1|-misc-fixed-medium-r-normal-old
style-*-140-75-75-c-*-jisx0208.1997-0;

When we display this font we don't show the encoding information - the dialog
formats it in a different way so this makes you look like you get the wrong
font. The preference store has it the same way.

Likewise it appears that SWT is dropping the encoding when we load it back in.

Here is a test I wrote (that I am currently having trouble running). Fuse-san if
you could post the result of this it would be a big help

public class FontTest {

	public static void main(String[] args) {

		FontData data =
			new FontData("1|fixed|14|0|MOTIF|1|-misc-fixed-medium-r-normal-old
style-*-140-75-75-c-*-jisx0208.1997-0");
		
		Font font = new Font(Display.getDefault(),data);
		FontData[] newData = font.getFontData();
		System.out.println(newData[0].toString());
	}

}
Comment 2 Tod Creasey CLA 2003-03-21 10:12:26 EST
Logged Bug 35469 for the encoding loss (this is the more serious issue). UI does
not lose any information as we store the FontData as the full definition rather
than in the humean readable form. We should revisit how we display for 2.2 however.
Comment 3 Nick Edgar CLA 2003-03-21 12:19:38 EST
Lowering severity for the display problem.
I've bumped up the severity on bug 35469.
Comment 4 Masayuki Fuse CLA 2003-03-23 23:23:28 EST
Tod, I gotthe return below.

1|fixed|14|0|MOTIF|1|-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-1
Comment 5 Masayuki Fuse CLA 2003-03-25 02:05:16 EST
Tod, 
If a font not supported on Motif is selected, the font name at preferences will 
be changed later when the preferences is opened. My understanding is right?

BTW, only one font is displayed at the preference but the return is 3 fonts 
this case. Which one will be displayed at the preferences?

Please write these behaviors in readme.
Comment 6 Tod Creasey CLA 2003-03-25 07:59:50 EST
Yes you are right. The Font Dialog only returns one FontData and motif will 
try and match as best it can when it creates a Font based on it. We are 
showing you what the dialog shows you but this should be readmed by SWT. 
Moving to SWT to include in thier readmes.
Comment 7 Tod Creasey CLA 2003-03-31 14:51:27 EST
We should also show encoding the the font preference page
Comment 8 Tod Creasey CLA 2003-04-01 10:40:03 EST
Wrong dependency
Comment 9 Veronika Irvine CLA 2003-05-07 15:47:26 EDT
SWT must return the array of FontData from the FontDialog.

The UI will then have to be modified to show the full list of FontData values 
and use this array of FontData when setting the Font.

Assigning to Grant to patch the FontDialog in 2.1.1.  Grant must then reassign 
this bug to Platform UI (owner Tod) when the API has been patched.

Grant - the API set/getFontDatas needs to be renamed to get/setFontList.
Comment 10 Felipe Heidrich CLA 2003-05-07 16:47:35 EDT
Adding KH.
Comment 11 Grant Gayed CLA 2003-05-09 11:37:54 EDT
Added the get/setFontList api and extended motif font dialog to the 2.1.1 
stream (and did the corresponding api rename in the 3.0 stream).  Now moving to 
Tod.
Comment 12 Tod Creasey CLA 2003-05-20 16:14:54 EDT
Integrated with the new Font support and released in both the 2.1.1 stream and 
HEAD.
Comment 13 Masayuki Fuse CLA 2003-05-23 03:36:52 EDT
verified in M20030521