congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Font.getFontData
Code IndexAdd Tabnine 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
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.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.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.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

  • Making http post requests using okhttp
  • onCreateOptionsMenu (Activity)
  • compareTo (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • JFileChooser (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now