const class gfx::Font
Font models the rendering of text.
Get ascent of this font which is the distance in pixels from baseline to top of chars, not including any leading area.
const Bool bold
Is this font bold.
Get descent of this font which is the distance in pixels from baseline to bottom of chars, not including any leading area.
Free any operating system resources used by this font. Dispose is required if this color has been used in an operation such as FWT onPaint which allocated a system resource to represent this instance.
Equality is based on name, size, and style.
Parse font from string (see
toStr). If invalid and checked is true then throw ParseErr otherwise return null.
Font.fromStr("12pt Arial") Font.fromStr("bold 10pt Courier") Font.fromStr("bold italic 8pt Times Roman")
virtual override Int hash()
Return hash of name, size, and style.
Get height of this font which is the pixels is the sum of ascent, descent, and leading.
const Bool italic
Is this font in italic.
Get leading of this font which is the distance in pixels above the ascent which may include accents and other marks.
new make(|This| f)
Construct with it-block
const Str name := "Serif"
Name of font.
const Int size := 11
Size of font in points.
Return this font, but with a bold styling. If this font is already bold then return this.
Return this font, but with a italic styling. If this font is already italic then return this.
Return this font, but with a plain styling (neither bold, nor italic). If this font is already plain then return this.
Return this font, but with the specified point size. If thsi font already has the given size return this.
virtual override Str toStr()
"[bold] [italic] <size>pt <name>"
Get the width of the string in pixels when painted with this font.