com.aelitis.azureus.ui.swt.utils
Class FontUtils

java.lang.Object
  extended by com.aelitis.azureus.ui.swt.utils.FontUtils

public class FontUtils
extends java.lang.Object

Author:
TuxPaper

Constructor Summary
FontUtils()
           
 
Method Summary
static org.eclipse.swt.graphics.Font findFontByFloat(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Font font, org.eclipse.swt.graphics.FontData[] fontData, float[] returnSize, int heightInPixels, int style)
           
static org.eclipse.swt.graphics.Font findFontByInt(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Font font, org.eclipse.swt.graphics.FontData[] fontData, float[] returnSize, int heightInPixels, int style)
           
static org.eclipse.swt.graphics.Font getAnyFontBold(org.eclipse.swt.graphics.GC gc)
           
static float getFontHeightFromPX(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.FontData[] fontData, org.eclipse.swt.graphics.GC gc, int heightInPixels)
           
static float getFontHeightFromPX(org.eclipse.swt.graphics.Font baseFont, org.eclipse.swt.graphics.GC gc, int heightInPixels)
           
static int getFontHeightInPX(org.eclipse.swt.graphics.Font font)
           
static int getFontHeightInPX(org.eclipse.swt.graphics.FontData[] fd)
           
static org.eclipse.swt.graphics.Font getFontPercentOf(org.eclipse.swt.graphics.Font baseFont, float pct)
           
static org.eclipse.swt.graphics.Font getFontWithHeight(org.eclipse.swt.graphics.Font baseFont, org.eclipse.swt.graphics.GC gc, int heightInPixels)
           
static org.eclipse.swt.graphics.Font getFontWithHeight(org.eclipse.swt.graphics.Font baseFont, org.eclipse.swt.graphics.GC gc, int heightInPixels, int style)
           
static float getHeight(org.eclipse.swt.graphics.FontData[] fd)
           
static void setFontDataHeight(org.eclipse.swt.graphics.FontData[] fd, float fontSize)
           
static void setFontHeight(org.eclipse.swt.widgets.Control control, int height, int style)
          Change the height of the installed Font and takes care of disposing the new font when the control is disposed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FontUtils

public FontUtils()
Method Detail

getFontHeightFromPX

public static float getFontHeightFromPX(org.eclipse.swt.graphics.Font baseFont,
                                        org.eclipse.swt.graphics.GC gc,
                                        int heightInPixels)
Parameters:
baseFont -
gc - Can be null
heightInPixels -
Returns:
Since:
3.0.0.7

getFontHeightFromPX

public static float getFontHeightFromPX(org.eclipse.swt.graphics.Device device,
                                        org.eclipse.swt.graphics.FontData[] fontData,
                                        org.eclipse.swt.graphics.GC gc,
                                        int heightInPixels)

getFontWithHeight

public static org.eclipse.swt.graphics.Font getFontWithHeight(org.eclipse.swt.graphics.Font baseFont,
                                                              org.eclipse.swt.graphics.GC gc,
                                                              int heightInPixels)

getFontWithHeight

public static org.eclipse.swt.graphics.Font getFontWithHeight(org.eclipse.swt.graphics.Font baseFont,
                                                              org.eclipse.swt.graphics.GC gc,
                                                              int heightInPixels,
                                                              int style)

setFontDataHeight

public static void setFontDataHeight(org.eclipse.swt.graphics.FontData[] fd,
                                     float fontSize)

findFontByInt

public static org.eclipse.swt.graphics.Font findFontByInt(org.eclipse.swt.graphics.GC gc,
                                                          org.eclipse.swt.graphics.Font font,
                                                          org.eclipse.swt.graphics.FontData[] fontData,
                                                          float[] returnSize,
                                                          int heightInPixels,
                                                          int style)

findFontByFloat

public static org.eclipse.swt.graphics.Font findFontByFloat(org.eclipse.swt.graphics.GC gc,
                                                            org.eclipse.swt.graphics.Font font,
                                                            org.eclipse.swt.graphics.FontData[] fontData,
                                                            float[] returnSize,
                                                            int heightInPixels,
                                                            int style)

getFontHeightInPX

public static int getFontHeightInPX(org.eclipse.swt.graphics.FontData[] fd)

getFontHeightInPX

public static int getFontHeightInPX(org.eclipse.swt.graphics.Font font)

setFontHeight

public static void setFontHeight(org.eclipse.swt.widgets.Control control,
                                 int height,
                                 int style)
Change the height of the installed Font and takes care of disposing the new font when the control is disposed

Parameters:
control -
height -
style - one or both of SWT.BOLD, SWT.ITALIC, or SWT.NORMAL

getHeight

public static float getHeight(org.eclipse.swt.graphics.FontData[] fd)

getFontPercentOf

public static org.eclipse.swt.graphics.Font getFontPercentOf(org.eclipse.swt.graphics.Font baseFont,
                                                             float pct)

getAnyFontBold

public static org.eclipse.swt.graphics.Font getAnyFontBold(org.eclipse.swt.graphics.GC gc)