Skip to content

Font

The Font class is used to define the font properties for text elements, including the font name, size, color, and style.

Constructor:

  • constructor(name: string, size: number, color: string, style: FontStyle)
    Creates a Font instance.
    • name: The name of the font (e.g., "Arial", "Times New Roman").
    • size: The size of the font (in points) (e.g. 11).
    • color: The color of the font (as a string representing a color name or RGB code. For example: "red", "#FF00FF").
    • style: The FontStyle object defining the font’s styling (e.g., bold, italic).
Example
this.edit_box1.font.name = "Arial";  
this.edit_box1.font.size = 12;  
this.edit_box1.font.style.bold = true;  
this.edit_box1.font.style.italic = true;