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

Bug 146095

Summary: Setting an italic font for a Label() does not change label appearance
Product: [Tools] GEF Reporter: Alexander Wise <wise>
Component: GEF-Legacy Draw2dAssignee: gef-inbox <gef-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard: Bugzilla 3.4 Migration

Description Alexander Wise CLA 2006-06-08 15:30:39 EDT
I am creating an italic font and setting the label to use that font -- but the label appearance does not change.

Setting the font with the style bit SWT.BOLD correctly displays a bolded font, and SWT.BOLD | SWT.ITALIC correctly displays a bolded obliqued font.
Comment 1 Randy Hudson CLA 2006-06-08 15:46:53 EDT
It might be specific to the font. please provide a snippet.
Comment 2 Alexander Wise CLA 2006-06-08 16:03:29 EDT
In a subclass of Figure...

	private static Font italic;
	
	private Font getReferenceFont() {
		if (italic == null) {
			Font basefont = stepName.getFont();
			FontData[] fontdata = basefont.getFontData();
			for (int i=0; i  < fontdata.length; i++) {
				fontdata[i].setStyle(SWT.ITALIC);
			}
			italic = new Font(basefont.getDevice(), fontdata);
		}
		return italic;
	}

        ...

        label.setFont(getReferenceFont());

Note that if I change the setStyle() line to fontdata[i]setStyle(SWT.BOLD|SWT.ITALIC) it renders as bold and oblique.

Here is the FontData object returned by getFont(): 1|Lucida Grande|13|0|CARBON|1|

Font Book doesn't show any italic or oblique forms of Lucida Grande -- so the bold oblique font must be computed...
Comment 3 Randy Hudson CLA 2006-06-08 16:47:43 EDT
This has nothing to do with GEF or draw2d. Please create an SWT snippet, attach it, and re-assign this bug to Eclipse/SWT component.
Comment 4 Alexander Wise CLA 2006-06-09 11:05:55 EDT
Unfortunately, I am not so sure it has nothing to do with draw2d. The same code when used with an org.eclipse.swt.widgets.Label instead of an org.eclipse.draw2d.Label works as expected.
Comment 5 Randy Hudson CLA 2006-06-09 11:31:28 EDT
Please attach a running example showing the problem. You should try this in SWT, but not using a Label. Just create a Shell and paint directly on the shell using the font, the same way GEF does.
Comment 6 Eclipse Webmaster CLA 2007-07-29 09:20:16 EDT
Changing OS from Mac OS to Mac OS X as per bug 185991
Comment 7 Anthony Hunter CLA 2009-08-24 12:01:44 EDT
LATER and REMIND resolutions will be going away with the upgrade of Bugzilla to the latest Bugzilla 3.4.  They are no longer part of the default Bugzilla installation. See http://dev.eclipse.org/mhonarc/lists/eclipse.org-committers/msg00778.html for the announcement.

As a result 
RESOLVED + REMIND OR LATER 
will be changed to
RESOLVED + WONTFIX

This unfortunately also means I need to REOPEN and then RESOLVE as WONTFIX

Sorry for the inconvenience.
Comment 8 Anthony Hunter CLA 2009-08-24 12:14:48 EDT
LATER and REMIND resolutions will be going away with the upgrade of Bugzilla to the latest Bugzilla 3.4.  They are no longer part of the default Bugzilla installation. See http://dev.eclipse.org/mhonarc/lists/eclipse.org-committers/msg00778.html for the announcement.

As a result 
RESOLVED + REMIND OR LATER 
will be changed to
RESOLVED + WONTFIX

This unfortunately also means I need to REOPEN and then RESOLVE as WONTFIX

Sorry for the inconvenience.