Main Content


Font for box, function, and state labels


    Use a Stateflow.StateFont object to specify the font properties for box, function, and state labels in a chart.


    Each chart has its own Stateflow.StateFont object. To access the Stateflow.StateFont object, use the StateFont property for the Stateflow.Chart object.


    expand all

    Stateflow® API objects have properties that correspond to the values you set in the Stateflow Editor. To access or modify a property, use dot notation. To access or modify multiple properties for multiple API objects, use the get and set functions, respectively. For more information, see Modify Properties and Call Functions of Stateflow Objects.

    Font name, specified as a string scalar or character vector. This property also determines the font for annotations in the chart.

    Font angle, specified as "NORMAL" or "ITALIC".

    Font weight, specified as "NORMAL" or "BOLD".

    Default font size for new boxes, functions, and states in the chart, specified as a scalar. This property also determines the default font size for new annotations in the chart.


    collapse all

    Access the Stateflow.StateFont object for the Stateflow.Chart object ch.

    font = ch.StateFont;

    Set the font for box, function, and state labels to Arial. Set the font angle to italics and the font weight to bold. Set the default font size to 8.

    font.Name = "Arial";
    font.Angle = "ITALIC";
    font.Weight = "BOLD";
    font.Size = 8;

    Version History

    Introduced before R2006a