Community
Participate
Working Groups
Auto-sizing a table column by double-clicking on its border in the table header does not take font styles into account - bold text, if present in a cell of the column, may get clipped.
snippet follows that shows this: public class Main { public static void main (String [] args) { String[] itemText = new String[] {"abcdefghijklmnop","a"}; final Display display = new Display (); Shell shell = new Shell (display); shell.setBounds(10,10,300,300); final Table table = new Table(shell, SWT.NONE); table.setBounds(10,10,200,200); table.setHeaderVisible(true); new TableColumn(table, SWT.NONE).setWidth(50); new TableColumn(table, SWT.NONE).setWidth(150); TableItem item = new TableItem(table, SWT.NONE); item.setText(itemText); FontData data = table.getFont().getFontData()[0]; data.setStyle(data.getStyle() | SWT.BOLD); Font font = new Font(display, data); item.setFont(font); shell.open (); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } font.dispose(); display.dispose (); } }
This is a bug in Windows that we cannot work around. The support for fonts in table and tree items in Windows simply allows you to draw them. The stupid % $^&$^%& control doesn't really know you are using them so it's measurements are all wrong. Thanks Microsoft. Assigning to VI. We could consider closing this as WONTFIX or marking it as a dup of another "item font is bad on Windows" bug report.
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.