Creating Fonts : Font « SWT 2D Graphics « Java Tutorial






ConstructorDescription
public Font(Device device, FontData fd)Creates a font using the specified device and font data.
public Font(Device device, FontData[] fds)Creates a font using the specified device and array of font data.
public Font(Device device, String name, int height, int style)Creates a font using the specified device, name, height (in points), and style. Style constants are SWT.NORMAL, SWT.BOLD, and SWT.ITALIC.


Font Styles

StyleDescription
SWT.NORMALCreates a normal font
SWT.BOLDCreates a bold font
SWT.ITALICCreates an italic font


18.13.Font
18.13.1.Creating Fonts
18.13.2.Font TerminologyFont Terminology
18.13.3.Changing FontsChanging Fonts
18.13.4.Using FontMetrics to get char width
18.13.5.Get system default fontGet system default font