/** * Returns the font descriptor for the JFace default font. * * @return the font descriptor for the JFace default font * @since 3.3 */ public FontDescriptor defaultFontDescriptor() { return FontDescriptor.createFrom(defaultFontData()); } }
private FontDescriptor createFontDescriptor(FontData[] initialFontData) { int destFontSize= initialFontData[0].getHeight() + fFontSizeOffset; if (destFontSize <= 0) { return FontDescriptor.createFrom(initialFontData); } return FontDescriptor.createFrom(initialFontData).setHeight(destFontSize); }
/** * Returns the font descriptor for the JFace default font. * * @return the font descriptor for the JFace default font * @since 3.3 */ public FontDescriptor defaultFontDescriptor() { return FontDescriptor.createFrom(defaultFontData()); } }
private FontDescriptor createFontDescriptor(FontData[] initialFontData) { int destFontSize= initialFontData[0].getHeight() + fFontSizeOffset; if (destFontSize <= 0) { return FontDescriptor.createFrom(initialFontData); } return FontDescriptor.createFrom(initialFontData).setHeight(destFontSize); }
/** * Returns the font descriptor for the JFace default font. * * @return the font descriptor for the JFace default font * @since 1.0 */ public FontDescriptor defaultFontDescriptor() { return FontDescriptor.createFrom(defaultFontData()); } }
/** * Returns the font descriptor for the font with the given symbolic * font name. Returns the default font if there is no special value * associated with that name * * @param symbolicName symbolic font name * @return the font descriptor (never null) * * @since 3.3 */ public FontDescriptor getDescriptor(String symbolicName) { Assert.isNotNull(symbolicName); return FontDescriptor.createFrom(getFontData(symbolicName)); }
/** * Creates a new FontDescriptor given an OS-specific font name, height, and style. * * @see Font#Font(org.eclipse.swt.graphics.Device, java.lang.String, int, int) * * @param name os-specific font name * @param height height (pixels) * @param style a bitwise combination of NORMAL, BOLD, ITALIC * @return a new FontDescriptor */ public static FontDescriptor createFrom(String name, int height, int style) { return createFrom(new FontData(name, height, style)); }
/** * Creates a new FontDescriptor given an OS-specific font name, height, and style. * * @see Font#Font(org.eclipse.swt.graphics.Device, java.lang.String, int, int) * * @param name os-specific font name * @param height height (pixels) * @param style a bitwise combination of NORMAL, BOLD, ITALIC * @return a new FontDescriptor */ public static FontDescriptor createFrom(String name, int height, int style) { return createFrom(new FontData(name, height, style)); }
/** * Creates a new FontDescriptor given an OS-specific font name, height, and style. * * @see Font#Font(org.eclipse.swt.graphics.Device, java.lang.String, int, int) * * @param name os-specific font name * @param height height (pixels) * @param style a bitwise combination of NORMAL, BOLD, ITALIC * @return a new FontDescriptor */ public static FontDescriptor createFrom(String name, int height, int style) { return createFrom(new FontData(name, height, style)); }
/** * Returns the font descriptor for the font with the given symbolic * font name. Returns the default font if there is no special value * associated with that name * * @param symbolicName symbolic font name * @return the font descriptor (never null) * * @since 1.0 */ public FontDescriptor getDescriptor(String symbolicName) { Assert.isNotNull(symbolicName); return FontDescriptor.createFrom(getFontData(symbolicName)); }
/** * Returns the font descriptor for the font with the given symbolic * font name. Returns the default font if there is no special value * associated with that name * * @param symbolicName symbolic font name * @return the font descriptor (never null) * * @since 3.3 */ public FontDescriptor getDescriptor(String symbolicName) { Assert.isNotNull(symbolicName); return FontDescriptor.createFrom(getFontData(symbolicName)); }
@Override public Font getFont(Object element) { IWorkbenchAdapter2 adapter = getAdapter2(element); if (adapter == null) { return null; } FontData descriptor = adapter.getFont(element); if (descriptor == null) { return null; } return (Font) getResourceManager().get( FontDescriptor.createFrom(descriptor)); }
private Font createFont ( final ResourceManager resourceManager ) { final Font defaultFont = resourceManager.getDevice ().getSystemFont (); if ( defaultFont == null ) { return null; } final FontData fd[] = FontDescriptor.copy ( defaultFont.getFontData () ); if ( fd == null ) { return null; } for ( final FontData f : fd ) { if ( this.fontSize > 0 ) { f.setHeight ( this.fontSize ); } } return resourceManager.createFont ( FontDescriptor.createFrom ( fd ) ); } }
private Font createFont ( final ResourceManager resourceManager ) { final Font defaultFont = resourceManager.getDevice ().getSystemFont (); if ( defaultFont == null ) { return null; } final FontData fd[] = FontDescriptor.copy ( defaultFont.getFontData () ); if ( fd == null ) { return null; } for ( final FontData f : fd ) { if ( this.fontSize > 0 ) { f.setHeight ( this.fontSize ); } } return resourceManager.createFont ( FontDescriptor.createFrom ( fd ) ); } }
fontData = FontDescriptor.createFrom ( fontName, fontSize, SWT.NORMAL ).getFontData (); fontData = FontDescriptor.createFrom ( fontName, origFontSize, SWT.NORMAL ).getFontData (); return this.manager.createFont ( FontDescriptor.createFrom ( fontData ) );
fontData = FontDescriptor.createFrom ( fontName, fontSize, SWT.NORMAL ).getFontData (); fontData = FontDescriptor.createFrom ( fontName, origFontSize, SWT.NORMAL ).getFontData (); return this.manager.createFont ( FontDescriptor.createFrom ( fontData ) );
textLayout = new TextLayout(table.getDisplay()); textLayout.setOrientation(defaultOrientation); Font boldFont = resourceManager.createFont(FontDescriptor.createFrom( table.getFont()).setStyle(SWT.BOLD)); textLayout.setFont(table.getFont());