sceneStyleProps top-level constant

List<SceneProp> const sceneStyleProps

The table's STYLE SUBSET: exactly what a SceneTextStyle carries, and exactly what sceneTextStyleFields names — pinned both ways, so a row added here without a field there would be authorable and unshareable. Every one of these is spelled inside the node's one style: argument.

Implementation

const sceneStyleProps = <SceneProp>[
  SceneProp(
    'fontFamily',
    ScenePropKind.string,
    owner: ScenePropOwner.text,
    read: _fontFamily,
    write: _setFontFamily,
  ),
  SceneProp(
    'fontSize',
    ScenePropKind.number,
    owner: ScenePropOwner.text,
    defaultValue: 16.0,
    animatable: true,
    read: _fontSize,
    write: _setFontSize,
  ),
  SceneProp(
    'weight',
    ScenePropKind.choice,
    owner: ScenePropOwner.text,
    defaultValue: SceneFontWeight.w400,
    choices: _weights,
    read: _weight,
    write: _setWeight,
  ),
  SceneProp(
    'italic',
    ScenePropKind.boolean,
    owner: ScenePropOwner.text,
    defaultValue: false,
    read: _italic,
    write: _setItalic,
  ),
  SceneProp(
    'letterSpacing',
    ScenePropKind.number,
    owner: ScenePropOwner.text,
    defaultValue: 0.0,
    animatable: true,
    read: _letterSpacing,
    write: _setLetterSpacing,
  ),
  SceneProp(
    'wordSpacing',
    ScenePropKind.number,
    owner: ScenePropOwner.text,
    defaultValue: 0.0,
    animatable: true,
    read: _wordSpacing,
    write: _setWordSpacing,
  ),
  // A multiple of the font size, and 1.15 because that is what the renderer
  // used to hardcode: the default moves nothing, and now a file can reach it.
  SceneProp(
    'lineHeight',
    ScenePropKind.number,
    owner: ScenePropOwner.text,
    defaultValue: 1.15,
    animatable: true,
    read: _lineHeight,
    write: _setLineHeight,
  ),
  SceneProp(
    'color',
    ScenePropKind.color,
    owner: ScenePropOwner.text,
    defaultValue: SceneColor(0xFF1A1A1A),
    animatable: true,
    read: _color,
    write: _setColor,
  ),
  SceneProp(
    'textCase',
    ScenePropKind.choice,
    owner: ScenePropOwner.text,
    defaultValue: SceneTextCase.none,
    choices: _cases,
    read: _textCase,
    write: _setTextCase,
  ),
  SceneProp(
    'decoration',
    ScenePropKind.choice,
    owner: ScenePropOwner.text,
    defaultValue: SceneTextDecoration.none,
    choices: _decorations,
    read: _decoration,
    write: _setDecoration,
  ),
  SceneProp(
    'decorationColor',
    ScenePropKind.color,
    owner: ScenePropOwner.text,
    read: _decorationColor,
    write: _setDecorationColor,
  ),
  SceneProp(
    'decorationThickness',
    ScenePropKind.number,
    owner: ScenePropOwner.text,
    defaultValue: 1.0,
    animatable: true,
    read: _decorationThickness,
    write: _setDecorationThickness,
  ),
  SceneProp(
    'decorationStyle',
    ScenePropKind.choice,
    owner: ScenePropOwner.text,
    defaultValue: SceneTextDecorationStyle.solid,
    choices: _decorationStyles,
    read: _decorationStyle,
    write: _setDecorationStyle,
  ),
  SceneProp(
    'layers',
    ScenePropKind.layers,
    owner: ScenePropOwner.text,
    defaultValue: <TextLayer>[],
    read: _layers,
    write: _setLayers,
  ),
  // The face's own dials. The map is one property; each axis is a part of
  // it, so `axes.wght` binds and animates while the map does neither.
  SceneProp(
    'axes',
    ScenePropKind.axes,
    owner: ScenePropOwner.text,
    defaultValue: <String, double>{},
    read: _axes,
    write: _setAxes,
  ),
];