You can configure a font control suite that consists of a font selector, font weight selector, font size stepper, and solid color padding box.

Configuration description

FieldDescriptionData typeRequired?Remarks
nameThe name of the control.stringYesNone.
typeThe type of the control.stringYesNone.
defaultThe default value.arrayNoIf this field is not specified, the default value is empty.
componentsThe controls in the suite.arrayNoDefault value: ["fontFamily","fontWeight","fontSize","color"]. You can configure "fontFamily", "fontWeight", "fontSize", and "color".
enableHideSpecifies whether controls in the suite can be hidden.booleanNoDefault value: false. If this field is set to true, a show or hide icon appears, and the show field is added.

Value description

ConditionData typeExampleDefault value
The enableHide field is not configured or is set to false.object
{
 "fontFamily": "simSun",
 "fontWeight": 400,
 "color": "#333",
 "fontSize": 12
}
{
 "fontFamily": "Microsoft Yahei",
 "fontWeight": "normal",
 "color": "#fff",
 "fontSize": 12
}
The enableHide field is set to true.object
{
 "fontFamily": "simSun",
 "fontWeight": 400,
 "color": "#333",
 "fontSize": 12,
 "show": true
}
{
 "fontFamily": "Microsoft Yahei",
 "fontWeight": "normal",
 "color": "#fff",
 "fontSize": 12,
 "show": true
}

Configuration examples

  • The enableHide field not configuredConfiguration example 1
    {
      "font": {
        "name": "Font",
        "type": "font",
        "default": {
          "fontFamily": "simSun",
          "fontWeight": 400,
          "color": "#333",
          "fontSize": 12
        }
      }
    }
  • The enableHide field set to trueConfiguration example 2
    {
      "font": {
        "name": "Font",
        "type": "font",
        "enableHide": true,
        "default": {
          "fontFamily": "simSun",
          "fontWeight": 400,
          "color": "#333",
          "fontSize": 12
        }
      }
    }
  • Customized settings of the components fieldConfiguration example 3
    {
      "fontComponents": {
        "name": "Font",
        "type": "font",
        "enableHide": true,
        "components": ["fontSize", "color"]
      }
    }