Codota Logo
Font.getFontData
Code IndexAdd Codota to your IDE (free)

How to use
getFontData
method
in
org.eclipse.swt.graphics.Font

Best Java code snippets using org.eclipse.swt.graphics.Font.getFontData (Showing top 20 results out of 756)

  • Common ways to obtain Font
private void myMethod () {
Font f =
  • Codota IconComposite parent;parent.getFont()
  • Codota IconJFaceResources.getDialogFont()
  • Codota IconGC gc;gc.getFont()
  • Smart code suggestions by Codota
}
origin: pentaho/pentaho-kettle

public FontData getDefaultFontData() {
 return display.getSystemFont().getFontData()[0];
}
origin: caoxinyu/RedisClient

/**
 * Returns a bold version of the given {@link Font}.
 * 
 * @param baseFont
 *            the {@link Font} for which a bold version is desired
 * @return the bold version of the given {@link Font}
 */
public static Font getBoldFont(Font baseFont) {
  Font font = m_fontToBoldFontMap.get(baseFont);
  if (font == null) {
    FontData fontDatas[] = baseFont.getFontData();
    FontData data = fontDatas[0];
    font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD);
    m_fontToBoldFontMap.put(baseFont, font);
  }
  return font;
}
/**
origin: pentaho/pentaho-kettle

private void setHelpLink( Display display, String helpLink, int maxTextWidth, EnvironmentCase environment ) {
 link = new Link( shell, SWT.SINGLE | SWT.WRAP );
 link.setText( helpLink );
 if ( environment == EnvironmentCase.MAC_OS_X || environment == EnvironmentCase.MAC_OS_X_THIN ) {
  FontData[] fD = link.getFont().getFontData();
  fD[0].setHeight( 13 );
  link.setFont( new Font( display, fD[0] ) );
 }
 FormData fdlink = new FormData();
 fdlink.left = new FormAttachment( warningIcon, margin ); // Link should be below description right of icon
 fdlink.top = new FormAttachment( description, margin );
 fdlink.width = maxTextWidth;
 link.setLayoutData( fdlink );
 props.setLook( link );
 link.addListener( SWT.Selection, new Listener() {
  public void handleEvent( Event event ) {
   if ( Desktop.isDesktopSupported() ) {
    try {
     Desktop.getDesktop().browse( new URI( Const.getDocUrl( URI_PATH ) ) );
    } catch ( Exception e ) {
     log.logError( "Error opening external browser", e );
    }
   }
  }
 } );
}
origin: pentaho/pentaho-kettle

FontData[] array = gc.getFont().getFontData();
String string = "";
String lf = text.getLineDelimiter();
origin: org.eclipse.platform/org.eclipse.jface

/**
 * Creates a font descriptor that describes the given font.
 *
 * @param originalFont font to be described
 *
 * @see FontDescriptor#createFrom(org.eclipse.swt.graphics.Font)
 * @since 3.1
 */
public ArrayFontDescriptor(Font originalFont) {
  this(originalFont.getFontData());
  this.originalFont = originalFont;
}
origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

FontData[] getFontData(int style) {
  FontData[] fontDatas = regularFont.getFontData();
  for (int i = 0; i < fontDatas.length; i++) {
    fontDatas[i].setStyle(style);
  }
  return fontDatas;
}
int getHeight () {
origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

FontData[] getFontData(int style) {
  FontData[] fontDatas = regularFont.getFontData();
  for (int i = 0; i < fontDatas.length; i++) {
    fontDatas[i].setStyle(style);
  }
  return fontDatas;
}
int getHeight () {
origin: org.eclipse.recommenders.extdoc/rcp

public static Font bold(Font src, Display d) {
  FontData[] fD = src.getFontData();
  fD[0].setStyle(SWT.BOLD);
  return new Font(d, fD[0]);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
 * Get the system default font data.
 * @return FontData[]
 */
private FontData[] getDefaultFontData() {
  return valueControl.getDisplay().getSystemFont().getFontData();
}
origin: org.eclipse.mylyn.wikitext/ui

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);
}
origin: org.eclipse.platform/org.eclipse.debug.ui

@Override
public FontData getFont(Object element) {
  if (isDefault()) {
    FontData[] fontData = JFaceResources.getDefaultFont().getFontData();
    if (fontData != null && fontData.length > 0) {
      FontData data = fontData[0];
      data.setStyle(SWT.BOLD);
      return data;
    }
  }
  return null;
}
origin: org.eclipse.rap/org.eclipse.rap.jface

/**
 * Calculates the default font and returns the result.
 * This method creates a font that must be disposed.
 */
Font calculateDefaultFont() {
  Display current = Display.getCurrent();
  if (current == null) // can't do much without Display
    SWT.error(SWT.ERROR_THREAD_INVALID_ACCESS);
  return new Font(current, current.getSystemFont().getFontData());
}
origin: org.eclipse/org.eclipse.ui.editors

private boolean useHeightHint(Composite parent) {
  int fontHeight= (parent.getFont().getFontData())[0].getHeight();
  int displayHeight= parent.getDisplay().getClientArea().height;
  return (displayHeight / fontHeight) > 50;
}
origin: org.eclipse.platform/org.eclipse.jface

/**
 * Calculates the default font and returns the result.
 * This method creates a font that must be disposed.
 */
Font calculateDefaultFont() {
  Display current = Display.getCurrent();
  if (current == null) // can't do much without Display
    SWT.error(SWT.ERROR_THREAD_INVALID_ACCESS);
  return new Font(current, current.getSystemFont().getFontData());
}
origin: com.diffplug.durian/durian-swt

/** Returns a largish system font appropriate for dialog headers. */
public static Font systemLarge() {
  FontData font = SwtMisc.assertUI().getSystemFont().getFontData()[0];
  return get(font.getName(), 12, SWT.NORMAL);
}
origin: BiglySoftware/BiglyBT

public static Font getAnyFontBoldItalic(GC gc) {
  if (fontBoldItalic == null || fontBoldItalic.isDisposed()) {
    FontData[] fontData = gc.getFont().getFontData();
    for (FontData fd : fontData) {
      fd.setStyle(SWT.BOLD | SWT.ITALIC);
    }
    fontBoldItalic = new Font(gc.getDevice(), fontData);
  }
  return fontBoldItalic;
}

origin: BiglySoftware/BiglyBT

public static Font getFontWithStyle(Font baseFont, int style,
    float sizeByPct) {
  FontData[] fontData = baseFont.getFontData();
  for (FontData fd : fontData) {
    fd.setStyle(style);
  }
  if (sizeByPct != 1.0f) {
    float height = getHeight(fontData) * sizeByPct;
    setFontDataHeight(fontData, height);
  }
  return new Font(baseFont.getDevice(), fontData);
}
origin: BiglySoftware/BiglyBT

public static Font getAnyFontItalic(GC gc) {
  if (fontItalic == null || fontItalic.isDisposed()) {
    FontData[] fontData = gc.getFont().getFontData();
    for (FontData fd : fontData) {
      fd.setStyle(SWT.ITALIC);
    }
    fontItalic = new Font(gc.getDevice(), fontData);
  }
  return fontItalic;
}

origin: org.eclipse/org.eclipse.team.ui

  private Font getCurrentRevisionFont() {
    if (currentRevisionFont == null) {
      Font defaultFont = JFaceResources.getDefaultFont();
      FontData[] data = defaultFont.getFontData();
      for (int i = 0; i < data.length; i++) {
        data[i].setStyle(SWT.BOLD);
      }
      currentRevisionFont = new Font(viewer.getTree().getDisplay(), data);
    }
    return currentRevisionFont;
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

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();
  });
}
org.eclipse.swt.graphicsFontgetFontData

Javadoc

Returns an array of FontDatas representing the receiver. On Windows, only one FontData will be returned per font. On X however, a Font object may be composed of multiple X fonts. To support this case, we return an array of font data objects.

Popular methods of Font

  • <init>
  • dispose
  • isDisposed
    Returns true if the font has been disposed, and false otherwise. This method gets the dispose state
  • equals
    Compares the argument to the receiver, and returns true if they represent the same object using a c
  • getDevice
  • hashCode
    Returns an integer hash code for the receiver. Any two objects that return true when passed toequal
  • init
  • gtk_new
    Invokes platform specific functionality to allocate a new font.IMPORTANT: This method is not part of
  • addTraits
  • checkDevice
  • cocoa_new
    Invokes platform specific functionality to allocate a new font.IMPORTANT: This method is not part of
  • findFontData
  • cocoa_new,
  • findFontData,
  • win32_new

Popular in Java

  • Reactive rest calls using spring rest template
  • notifyDataSetChanged (ArrayAdapter)
  • addToBackStack (FragmentTransaction)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • JTextField (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now