Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 89378

Summary: Combo default size too small with certain fonts
Product: [Eclipse Project] Platform Reporter: Curtis d'Entremont <curtispd>
Component: SWTAssignee: Steve Northover <snorthov>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe, fuse, harish.nanjundappa, hollisc, hoy
Version: 3.0.1   
Target Milestone: 3.1 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
screenshot none

Description Curtis d'Entremont CLA 2005-03-29 12:34:21 EST
I'm using some non-editable Combos with a list of pre-set strings to select 
from, and I want it to stretch to accomodate the longest string inside the 
list. This works fine except when I switch to a certain font in Japanese - MS 
UI Gothic. And it doesn't seem to be a Japanese thing, if I use another font, 
it works. It seems to be computing the size incorrectly. I've noticed this in 
our UI, and I can also find some instances in some preference pages where they 
do the same thing. See screenshots to follow.
Comment 1 Curtis d'Entremont CLA 2005-03-29 12:39:55 EST
Created attachment 19280 [details]
screenshot
Comment 2 Steve Northover CLA 2005-03-29 20:21:40 EST
Can you confirm that this is still failing in the 3.1 stream?  I seem to 
remember fixing something in this area.
Comment 3 Steve Northover CLA 2005-03-29 20:22:23 EST
Better, can you provide a snippet that fails under 3.0.1?  Thanks.
Comment 4 Curtis d'Entremont CLA 2005-03-29 22:17:25 EST
Try the following, it will work fine, but switch to MS UI Gothic font (you 
might have to install some asian language packs), and the last a is partially 
truncated. I also tried using m5a, and got the same result.

---------

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class Test {

public static void main (String [] args) {
	Display display = new Display ();
	Shell shell = new Shell(display);
	shell.setLayout(new GridLayout());
	
	Combo c = new Combo(shell, SWT.READ_ONLY);
	c.add("aaa");
	c.select(0);
	
	shell.open ();
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	display.dispose ();
}
}
Comment 5 Steve Northover CLA 2005-04-07 21:14:34 EDT
FH, can you try this on your machine?
Comment 6 Felipe Heidrich CLA 2005-04-08 15:27:26 EDT
*** Bug 63646 has been marked as a duplicate of this bug. ***
Comment 7 Felipe Heidrich CLA 2005-04-08 16:14:06 EDT
fixed in head > 20050408
Comment 8 Felipe Heidrich CLA 2005-04-08 17:23:29 EDT
*** Bug 75003 has been marked as a duplicate of this bug. ***
Comment 9 Curtis d'Entremont CLA 2005-04-25 16:49:30 EDT
Verified in I20050420-1200. Closing bug.
Comment 10 Felipe Heidrich CLA 2005-05-20 14:03:37 EDT
*** Bug 96091 has been marked as a duplicate of this bug. ***
Comment 11 Felipe Heidrich CLA 2005-06-14 12:39:31 EDT
*** Bug 39463 has been marked as a duplicate of this bug. ***
Comment 12 Steve Northover CLA 2006-03-20 12:00:07 EST
*** Bug 131263 has been marked as a duplicate of this bug. ***