
Font models the rendering of text.
Slots
- bold
-
const Bool bold
Is this font bold.
- dispose
-
native Void dispose()
Free any operating system resources used by this instance.
- equals
-
override Bool equals(Obj that)
Equality is based on name, size, and style.
- 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")
- hash
-
override Int hash()
Return hash of name, size, and style.
- italic
-
const Bool italic
Is this font in italic.
- 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.
- name
-
const Str name
Name of font.
- size
-
const Int size
Size of font in points.
- toStr
-
override Str toStr()
Format as
"[bold] [italic] <size>pt <name>"