sceneTextStyleOf function

SceneTextStyle sceneTextStyleOf(
  1. TextStyle style
)

The properties of the app's text style the table knows. What is left out (fontFeatures, shadows, a foreground paint) is the app's to draw: the guest renders with the app's own TextStyle underneath, so nothing is lost on the canvas, only unnamed in the editor.

Implementation

SceneTextStyle sceneTextStyleOf(TextStyle style) => SceneTextStyle(
  fontFamily: style.fontFamily,
  fontSize: style.fontSize,
  weight: style.fontWeight == null
      ? null
      : SceneFontWeight.values[FontWeight.values.indexOf(style.fontWeight!)],
  italic: style.fontStyle == null ? null : style.fontStyle == FontStyle.italic,
  letterSpacing: style.letterSpacing,
  wordSpacing: style.wordSpacing,
  lineHeight: style.height,
  color: style.color?.scene,
  decorationColor: style.decorationColor?.scene,
  decorationThickness: style.decorationThickness,
  decorationStyle: style.decorationStyle == null
      ? null
      : SceneTextDecorationStyle.values[style.decorationStyle!.index],
);