logo

const class

fwt::Font

sys::Obj
  fwt::Font

Font models the rendering of text.

Slots

bold

const Bool bold

Is this font bold.

Source

dispose

native Void dispose()

Free any operating system resources used by this instance.

Source

equals

override Bool equals(Obj that)

Equality is based on name, size, and style.

Source

fromStr

static Font fromStr(Str s, Bool checked := true)

Parse font from string (see toStr). If invalid and checked is true then throw ParseErr otherwise return null.

Examples:

Font.fromStr("12pt Arial")
Font.fromStr("bold 10pt Courier")
Font.fromStr("bold italic 8pt Times Roman")

Source

hash

override Int hash()

Return hash of name, size, and style.

Source

italic

const Bool italic

Is this font in italic.

Source

make

new make(Str name := null, Int size := 12, Bool bold := false, Bool italic := false)

Construct a Font with family name, size in points, and optional bold/italic style.

Source

name

const Str name

Name of font.

Source

size

const Int size

Size of font in points.

Source

toStr

override Str toStr()

Format as "[bold] [italic] <size>pt <name>"

Source