setDefaultFont()

ICE Data Services -

setDefaultFont()
Previous  Top  Next


setDefaultFont( fontFace, size [, fgColor] [, flags])

The setDefaultFont() function was introduced in EFS2 and is designed to work in conjunction with the drawText() function. It allows you to set a default font to be used in all drawing operations.

Parameters

fontFace
the fontFace to use as the default
size
the desired size of the font
fgColor
optional. the foreground color to use
flags
optional. see Text Flags below


Text Flags

Text.BOLD
display the text in bold
Text.ITALIC
display the text in italics
Text.UNDERLINE
underline the text
Text.LEFT
align the text to the left Text.RIGHT align the text to the right Text.TOP align the text to the top Text.BOTTOM align the text to the bottom Text.ONTOP draw the text on top of the study Text.FRAME draw a frame around the text using fgColor as the frame color Text.BUTTON draws the text as a button (fgColor is ignored) Text.CENTER horizontally center the text over the bar Text.VCENTER vertically center the text Text.PLAIN
display plain text
Note: Text flags can be ORed together to combine various attributes (e.g., Text.ITALIC | Text.BOLD | Text.UNDERLINE)


Usage

   //set the default font to Arial 14-pt, use magenta a the color and apply
   //bold and underline attributes
   setDefaultFont( 
"Arial"14, Color.magenta, Text.BOLD | Text.UNDERLINE );

   //set the default font to Courier New 10-pt
   setDefaultFont( 
"Courier New"10 );