© Efflare Systems
website : e-mail

index | examples | api | language
Font
Represents an installed Windows font as referred to by their system-wide names. Provides a variety of style and formatting options.

Constructor
Font(
         name:string='Verdana', size:number=9,
         bold:boolean=false, italic:boolean=false, underline:boolean=false, strikeout:boolean=false,
         charset:string='default'
         weight:=0,
         quality:number:=1
)

» The first two or three parameters are often all that's used and everything is available in properties as well.

Properties
name:string
» get and set font name

size:number
» get and set size, accepts negative values

bold:boolean
» get and set bold

italic:boolean
» get and set italic

underline:boolean
» get and set underline

strikeout:boolean
» get and set strikeout

charset:string
» get and set character set ( SEE : Character Sets )

weight:number
» get and set weight, overrides bold setting, acceptable values are between 0 and 900, 400=normal, 700=bold, results of this setting are font dependent

quality:number
» get and set quality ( SEE : Font Antialiasing )


Formatting Properties

righttoleft
» get and set, layout in right to left for bi-directional capable fonts

singleline
» get and set, draw text on a single line, carriage returns and line feeds do not break the line

alignbottom
» get and set, singleline only, align bottom

alignvcenter
» get and set, singleline only, center vertically

wordwrap
» get and set, wraps words at drawing bounds

alignleft
» get and set, align left

alignright
» get and set, align right

aligncenter
» get and set, center horizontally

aligntop
» get and set, align top

Methods
getwidth( text:string ) : number
» returns the width in pixels required to render text in this font

getheight( text:string ) : number
» returns the height in pixels required to render text in this font

getdimensions( text:string ) : number, number
» returns the width and height in pixels required to render text in this font