Community
Participate
Working Groups
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 Build Identifier: 20090619-0625 Notice that the buttons and dialogs in the attached screenshots are all very wide. On Japanese Vista, the font used in dialogs is called "メイリオ" (I know, that comes out displayed in the bugbase as a bunch of HTML entities -- oh well). That font reports its average character width as 12 pixels, which is twice as wide as the font used in English Vista. Eclipse relies heavily on the average character width as an important metric in deciding how to lay out all dialogs. See http://support.microsoft.com/kb/145994 for the description of how to calculate the size of "Dialog Units", which is what Microsoft recommends as the unit to use in setting the size of dialogs and controls. Of course, I realize that switching entirely to dialog units would be an enormous and unacceptable change for Eclipse; but perhaps you could, instead of relying on average character width, rely on something that is somehow related to dialog units. Also see bug 284205, which is related but is not the same issue. Reproducible: Always Steps to Reproduce: 1. Install Eclipse on Japanese Vista 2. Bring up any dialog
Created attachment 147013 [details] screenshot 1
Created attachment 147014 [details] screenshot 2
Created attachment 147015 [details] screenshot 3
Created attachment 147016 [details] screenshot 4
Does this happen on simple SWT snippets as well?(http://www.eclipse.org/swt/snippets/) Or only in Eclipse IDE?
It doesn't reproduce with bare SWT snippets, but it should reproduce with bare SWT+JFace apps, because the actual problematic code is in JFace -- e.g. this code in org.eclipse.jface.dialogs.Dialog: public static int convertHorizontalDLUsToPixels(FontMetrics fontMetrics, int dlus) { // round to the nearest pixel return (fontMetrics.getAverageCharWidth() * dlus + HORIZONTAL_DIALOG_UNIT_PER_CHAR / 2) / HORIZONTAL_DIALOG_UNIT_PER_CHAR; } That code looks good, and is consistent with the first part of the "More Information" section of http://support.microsoft.com/kb/145994 . I am not quite sure what's going on here -- not sure if perhaps Eclipse is not using the default system font (I bring that up because the Microsoft page goes on to say, "However, if you aren't using the system font, you need to do some additional calculations to get the right coordinates. Here are two methods..."). Bottom line, I'm not really sure what the solution is here. Eclipse is the only app I've seen on Japanese Vista that has this problem, so that leads me to think that Eclipse needs to change somehow, but like I said, the above code appears to be correct to me, so I don't know.
> Notice that the buttons and dialogs in the attached screenshots are all very > wide. On Japanese Vista, the font used in dialogs is called > "メイリオ" (I know, that comes out displayed in the > bugbase as a bunch of HTML entities -- oh well). That font reports its average > character width as 12 pixels, which is twice as wide as the font used in > English Vista. I think the wide font is the crux of the problem. Eclipse uses dialog units/character widths extensively for layout. (The only difference between the two is that dialog units are a fraction of character widths). The net effect is the same...if the font is extremely wide, and character widths are used to compute dialog sizes, then you get wide dialogs. So a "30 character wide" wizard in English with a small font looks good, in a very wide font, it looks wide. SWT snippets may or may not exhibit the problem, depending on the nature of the layout used. Any snippet that uses dialog units or character widths to compute sizes would exhibit the problem. Using pixels or platform default sizes would get different results. However, using pixels leads to the opposite problem: truncation. Bottom line is that the font is simply too wide. Can you try changing the JFace dialog font in the preferences to something smaller and see if you get better results? We use properties files to manage the default font for various NL platforms, it may be that we need to ensure a smaller font is used.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.