Community
Participate
Working Groups
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.
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()); } }
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.
Lowering severity for the display problem. I've bumped up the severity on bug 35469.
Tod, I gotthe return below. 1|fixed|14|0|MOTIF|1|-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-1
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.
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.
We should also show encoding the the font preference page
Wrong dependency
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.
Adding KH.
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.
Integrated with the new Font support and released in both the 2.1.1 stream and HEAD.
verified in M20030521