Search in sources :

Example 1 with FontManager

use of de.jaret.util.swt.FontManager in project translationstudio8 by heartsome.

the class CellRendererBase method getFont.

/**
     * Retrieve the font accrding to the cell style.
     * 
     * @param style cell style
     * @param printing true for printing
     * @param defaultFont a default font used if no font can be retrieved
     * @return font according to style or default font
     */
protected Font getFont(ICellStyle style, boolean printing, Font defaultFont) {
    Device device = printing ? _printer : Display.getCurrent();
    FontManager fm = FontManager.getFontManager(device);
    Font f = style.getFont() != null ? fm.getFont(style.getFont()) : defaultFont;
    return f;
}
Also used : Device(org.eclipse.swt.graphics.Device) FontManager(de.jaret.util.swt.FontManager) Font(org.eclipse.swt.graphics.Font)

Aggregations

FontManager (de.jaret.util.swt.FontManager)1 Device (org.eclipse.swt.graphics.Device)1 Font (org.eclipse.swt.graphics.Font)1