bundledLabelStyle function
style with the variable-font axes and features of its bundled family
(unchanged for the platform font).
Implementation
TextStyle bundledLabelStyle(TextStyle style, {bool slashedZero = false}) {
final font = BundledFont.fromFamily(style.fontFamily);
if (!font.isBundled) return style;
final weight = (style.fontWeight ?? FontWeight.w400).value.toDouble();
return style.copyWith(
fontVariations: font.variations(weight: weight, fontSize: style.fontSize),
fontFeatures: font.features(slashedZero: slashedZero),
);
}