Shiny Language Reference

Language Reference > Font Functions


createfont

createfont(font FontVar, string Typeface, int PointSize);

createfont(font FontVar, string Typeface, int PointSize, bool Bold, bool Italic);

 

Synonyms:

fontcreate(font FontVar, string Typeface, int PointSize);

fontcreate(font FontVar, string Typeface, int PointSize, bool Bold, bool Italic);

 

Creates a display font

CREATEFONT creates a font object in the specified style and associates it with a FONT variable. It can also be used to reassign a font to a different style (for example, changing a font to and from bold)

 

Parameters

FontVar

The variable declared as type FONT to associate with this font object

Typeface

The name of the font to use when creating this font

PointSize

The size in standard points of the font

Bold

An expression that can reasonably evaluate to a boolean, where TRUE specifies a bold type and FALSE specifies a normal type. Default is FALSE.

Italic

An expression that can reasonably evaluate to a boolean, where TRUE specifies an italic type and FALSE specifies a normal type. Default is FALSE.

 

Return Value

None

 

Example Code

// Creates a 12 point, non-bold, non-italic Arial font
font MyFont;
createfont(MyFont, "Arial", 12);

// Creates a 9 point Courier, non-bold, italic font
font MyFont;
createfont(MyFont, "Courier", 9, False, True);