From 2d9b158faff1337ed6f147c4a6808b32808fca3f Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Tue, 28 May 2019 11:35:03 -0700 Subject: [PATCH] Revert "Framework support for font features in text styles (#33230)" (#33444) This reverts commit 841286d652379a6e9f1e95d54c8c9e628f4f1d5c. --- .../flutter/lib/src/painting/text_style.dart | 23 +------------------ .../flutter/test/material/theme_test.dart | 3 --- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/packages/flutter/lib/src/painting/text_style.dart b/packages/flutter/lib/src/painting/text_style.dart index 34ed2b97fa..285d2dbccb 100644 --- a/packages/flutter/lib/src/painting/text_style.dart +++ b/packages/flutter/lib/src/painting/text_style.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:ui' as ui show ParagraphStyle, TextStyle, StrutStyle, lerpDouble, Shadow, FontFeature; +import 'dart:ui' as ui show ParagraphStyle, TextStyle, StrutStyle, lerpDouble, Shadow; import 'package:flutter/foundation.dart'; @@ -316,7 +316,6 @@ class TextStyle extends Diagnosticable { this.foreground, this.background, this.shadows, - this.fontFeatures, this.decoration, this.decorationColor, this.decorationStyle, @@ -563,15 +562,6 @@ class TextStyle extends Diagnosticable { /// equivalent as order produces differing transparency. final List shadows; - /// A list of [FontFeature]s that affect how the font selects glyphs. - /// - /// Some fonts support multiple variants of how a given character can be - /// rendered. For example, a font might provide both proportional and - /// tabular numbers, or it might offer versions of the zero digit with - /// and without slashes. [FontFeature]s can be used to select which of - /// these variants will be used for rendering. - final List fontFeatures; - /// Creates a copy of this text style but with the given fields replaced with /// the new values. /// @@ -598,7 +588,6 @@ class TextStyle extends Diagnosticable { Paint foreground, Paint background, List shadows, - List fontFeatures, TextDecoration decoration, Color decorationColor, TextDecorationStyle decorationStyle, @@ -630,7 +619,6 @@ class TextStyle extends Diagnosticable { foreground: foreground ?? this.foreground, background: background ?? this.background, shadows: shadows ?? this.shadows, - fontFeatures: fontFeatures ?? this.fontFeatures, decoration: decoration ?? this.decoration, decorationColor: decorationColor ?? this.decorationColor, decorationStyle: decorationStyle ?? this.decorationStyle, @@ -730,7 +718,6 @@ class TextStyle extends Diagnosticable { foreground: foreground, background: background, shadows: shadows, - fontFeatures: fontFeatures, decoration: decoration ?? this.decoration, decorationColor: decorationColor ?? this.decorationColor, decorationStyle: decorationStyle ?? this.decorationStyle, @@ -789,7 +776,6 @@ class TextStyle extends Diagnosticable { foreground: other.foreground, background: other.background, shadows: other.shadows, - fontFeatures: other.fontFeatures, decoration: other.decoration, decorationColor: other.decorationColor, decorationStyle: other.decorationStyle, @@ -843,7 +829,6 @@ class TextStyle extends Diagnosticable { background: t < 0.5 ? null : b.background, decoration: t < 0.5 ? null : b.decoration, shadows: t < 0.5 ? null : b.shadows, - fontFeatures: t < 0.5 ? null : b.fontFeatures, decorationColor: Color.lerp(null, b.decorationColor, t), decorationStyle: t < 0.5 ? null : b.decorationStyle, decorationThickness: t < 0.5 ? null : b.decorationThickness, @@ -869,7 +854,6 @@ class TextStyle extends Diagnosticable { foreground: t < 0.5 ? a.foreground : null, background: t < 0.5 ? a.background : null, shadows: t < 0.5 ? a.shadows : null, - fontFeatures: t < 0.5 ? a.fontFeatures : null, decoration: t < 0.5 ? a.decoration : null, decorationColor: Color.lerp(a.decorationColor, null, t), decorationStyle: t < 0.5 ? a.decorationStyle : null, @@ -903,7 +887,6 @@ class TextStyle extends Diagnosticable { : b.background ?? (Paint()..color = b.backgroundColor) : null, shadows: t < 0.5 ? a.shadows : b.shadows, - fontFeatures: t < 0.5 ? a.fontFeatures : b.fontFeatures, decoration: t < 0.5 ? a.decoration : b.decoration, decorationColor: Color.lerp(a.decorationColor, b.decorationColor, t), decorationStyle: t < 0.5 ? a.decorationStyle : b.decorationStyle, @@ -936,7 +919,6 @@ class TextStyle extends Diagnosticable { : null ), shadows: shadows, - fontFeatures: fontFeatures, ); } @@ -1012,7 +994,6 @@ class TextStyle extends Diagnosticable { foreground != other.foreground || background != other.background || !listEquals(shadows, other.shadows) || - !listEquals(fontFeatures, other.fontFeatures) || !listEquals(fontFamilyFallback, other.fontFamilyFallback)) return RenderComparison.layout; if (color != other.color || @@ -1051,7 +1032,6 @@ class TextStyle extends Diagnosticable { decorationStyle == typedOther.decorationStyle && decorationThickness == typedOther.decorationThickness && listEquals(shadows, typedOther.shadows) && - listEquals(fontFeatures, typedOther.fontFeatures) && listEquals(fontFamilyFallback, typedOther.fontFamilyFallback); } @@ -1077,7 +1057,6 @@ class TextStyle extends Diagnosticable { decorationColor, decorationStyle, shadows, - fontFeatures, ); } diff --git a/packages/flutter/test/material/theme_test.dart b/packages/flutter/test/material/theme_test.dart index f3d90e47a1..c723a11627 100644 --- a/packages/flutter/test/material/theme_test.dart +++ b/packages/flutter/test/material/theme_test.dart @@ -719,8 +719,6 @@ class _TextStyleProxy implements TextStyle { double get wordSpacing => _delegate.wordSpacing; @override List get shadows => _delegate.shadows; - @override - List get fontFeatures => _delegate.fontFeatures; @override String toString({ DiagnosticLevel minLevel = DiagnosticLevel.debug }) => @@ -783,7 +781,6 @@ class _TextStyleProxy implements TextStyle { ui.Paint foreground, ui.Paint background, List shadows, - List fontFeatures, TextDecoration decoration, Color decorationColor, TextDecorationStyle decorationStyle,