textStyle method

  1. @override
TextStyle textStyle(
  1. TextStyle base
)
override

The style the font-drawn glyphs use, from the display's base style (e.g. a condensed width axis). Measuring and painting both use it.

Implementation

@override
TextStyle textStyle(TextStyle base) {
  final font = BundledFont.fromFamily(base.fontFamily);
  if (!font.isBundled) return base;
  final weight = (base.fontWeight ?? FontWeight.w400).value.toDouble();
  return base.copyWith(
    fontVariations: font.variations(
      weight: weight,
      width: widthPermille / 10,
      fontSize: base.fontSize,
    ),
    fontFeatures: font.features(),
  );
}