public void setDefaultFont( FontData fd ) { if ( fd != null ) { properties.setProperty( STRING_FONT_DEFAULT_NAME, fd.getName() ); properties.setProperty( STRING_FONT_DEFAULT_SIZE, "" + fd.getHeight() ); properties.setProperty( STRING_FONT_DEFAULT_STYLE, "" + fd.getStyle() ); } }
public void setGraphFont( FontData fd ) { properties.setProperty( STRING_FONT_GRAPH_NAME, fd.getName() ); properties.setProperty( STRING_FONT_GRAPH_SIZE, "" + fd.getHeight() ); properties.setProperty( STRING_FONT_GRAPH_STYLE, "" + fd.getStyle() ); }
public void setNoteFont( FontData fd ) { properties.setProperty( STRING_FONT_NOTE_NAME, fd.getName() ); properties.setProperty( STRING_FONT_NOTE_SIZE, "" + fd.getHeight() ); properties.setProperty( STRING_FONT_NOTE_STYLE, "" + fd.getStyle() ); }
public void setFixedFont( FontData fd ) { properties.setProperty( STRING_FONT_FIXED_NAME, fd.getName() ); properties.setProperty( STRING_FONT_FIXED_SIZE, "" + fd.getHeight() ); properties.setProperty( STRING_FONT_FIXED_STYLE, "" + fd.getStyle() ); }
public void setGridFont( FontData fd ) { properties.setProperty( STRING_FONT_GRID_NAME, fd.getName() ); properties.setProperty( STRING_FONT_GRID_SIZE, "" + fd.getHeight() ); properties.setProperty( STRING_FONT_GRID_STYLE, "" + fd.getStyle() ); }
public FontData getFixedFont() { FontData def = getDefaultFontData(); String name = properties.getProperty( STRING_FONT_FIXED_NAME ); int size = Const.toInt( properties.getProperty( STRING_FONT_FIXED_SIZE ), def.getHeight() ); int style = Const.toInt( properties.getProperty( STRING_FONT_FIXED_STYLE ), def.getStyle() ); return new FontData( name, size, style ); }
public FontData getGraphFont() { FontData def = getDefaultFontData(); String name = properties.getProperty( STRING_FONT_GRAPH_NAME, def.getName() ); int size = Const.toInt( properties.getProperty( STRING_FONT_GRAPH_SIZE ), def.getHeight() ); int style = Const.toInt( properties.getProperty( STRING_FONT_GRAPH_STYLE ), def.getStyle() ); return new FontData( name, size, style ); }
public FontData getNoteFont() { FontData def = getDefaultFontData(); String name = properties.getProperty( STRING_FONT_NOTE_NAME, def.getName() ); String ssize = properties.getProperty( STRING_FONT_NOTE_SIZE ); String sstyle = properties.getProperty( STRING_FONT_NOTE_STYLE ); int size = Const.toInt( ssize, def.getHeight() ); int style = Const.toInt( sstyle, def.getStyle() ); return new FontData( name, size, style ); }
public FontData getGridFont() { FontData def = getDefaultFontData(); String name = properties.getProperty( STRING_FONT_GRID_NAME, def.getName() ); String ssize = properties.getProperty( STRING_FONT_GRID_SIZE ); String sstyle = properties.getProperty( STRING_FONT_GRID_STYLE ); int size = Const.toInt( ssize, def.getHeight() ); int style = Const.toInt( sstyle, def.getStyle() ); return new FontData( name, size, style ); }
public FontData getDefaultFont() { FontData def = getDefaultFontData(); if ( isOSLookShown() ) { return def; } String name = properties.getProperty( STRING_FONT_DEFAULT_NAME, def.getName() ); int size = Const.toInt( properties.getProperty( STRING_FONT_DEFAULT_SIZE ), def.getHeight() ); int style = Const.toInt( properties.getProperty( STRING_FONT_DEFAULT_STYLE ), def.getStyle() ); return new FontData( name, size, style ); }
properties.setProperty( STRING_FONT_FIXED_NAME, fd.getName() ); properties.setProperty( STRING_FONT_FIXED_SIZE, "" + fd.getHeight() ); properties.setProperty( STRING_FONT_FIXED_STYLE, "" + fd.getStyle() ); properties.setProperty( STRING_FONT_DEFAULT_STYLE, "" + fd.getStyle() ); properties.setProperty( STRING_FONT_GRAPH_STYLE, "" + fd.getStyle() ); properties.setProperty( STRING_FONT_GRID_STYLE, "" + fd.getStyle() ); properties.setProperty( STRING_FONT_NOTE_STYLE, "" + fd.getStyle() );
.getGraphFont().getStyle() ); fontMedium = new ManagedFont( display, mediumFontData ); .getGraphFont().getStyle() | SWT.BOLD ); fontMediumBold = new ManagedFont( display, mediumFontBoldData ); .getStyle() ); fontLarge = new ManagedFont( display, largeFontData ); .getStyle() ); fontTiny = new ManagedFont( display, tinyFontData ); .getStyle() ); fontSmall = new ManagedFont( display, smallFontData ); .getDefaultFontData().getStyle() | SWT.BOLD ); fontBold = new ManagedFont( display, boldFontData );
public void widgetSelected( SelectionEvent arg0 ) { fixedFontData = new FontData( PropsUI.getInstance().getFixedFont().getName(), PropsUI.getInstance().getFixedFont().getHeight(), PropsUI.getInstance().getFixedFont().getStyle() ); fixedFont.dispose(); fixedFont = new Font( display, fixedFontData ); wFFont.redraw(); } } );
FontData data = array[i]; String style = "NORMAL"; int bits = data.getStyle(); if ( bits != 0 ) { if ( ( bits & SWT.BOLD ) != 0 ) {
private boolean isItalic( FontData[] fontDatas ) { boolean italic = false; for ( FontData fontData : fontDatas ) { if ( ( fontData.getStyle() & SWT.ITALIC ) != SWT.NORMAL ) { italic = true; } } return italic; }
private static FontData[] getModifiedFontData(FontData[] originalData, int additionalStyle) { FontData[] styleData = new FontData[originalData.length]; for (int i = 0; i < styleData.length; i++) { FontData base = originalData[i]; styleData[i] = new FontData(base.getName(), base.getHeight(), base.getStyle() | additionalStyle); } return styleData; }
private Font createBoldFont(Font original) { FontData[] font_data = original.getFontData(); for (int i=0; i<font_data.length; i++) { font_data[i].setStyle(font_data[i].getStyle() | SWT.BOLD); } return new Font(original.getDevice(), font_data); }
private void changeFont(Control control, boolean italic) { Display.getCurrent().asyncExec(() -> { FontData fd= control.getFont().getFontData()[0]; int style= italic ? (fd.getStyle() | SWT.ITALIC) : (fd.getStyle() & ~SWT.ITALIC); control.setFont(new Font(control.getDisplay(), new FontData(fd.getName(), fd.getHeight(), style))); if (control instanceof Composite) ((Composite) control).layout(); }); }
/** * Returns a copy of the original FontData * * @param next FontData to copy * @return a copy of the given FontData */ public static FontData copy(FontData next) { FontData result = new FontData(next.getName(), next.getHeight(), next.getStyle()); result.setLocale(next.getLocale()); return result; }
private FontData[] createFontData(FontState fontState, Font baseFont) { FontData[] fontData = new FontData[baseFont.getFontData().length]; int index = -1; for (FontData fd : baseFont.getFontData()) { fontData[++index] = new FontData(fd.getName(), fd.getHeight(), fd.getStyle()); } return applyFontState(fontState, fontData); }