Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 311ed5a

Browse files
Casey Hillersmdebbar
andauthored
[CP][web] Make 'Noto Color Emoji' opt-in (#40990) (#40991)
[web] Make 'Noto Color Emoji' opt-in b/277330347 - This incurred a large 24 MB size increase for web projects that is blocking customer releases. ## Pre-launch Checklist - [X] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [X] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [X] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See [testing the engine] for instructions on writing and running engine tests. - [ ] I updated/added relevant documentation (doc comments with `///`). - [X] I signed the [CLA]. - [X] All existing and new tests are passing. Co-authored-by: Mouad Debbar <mdebbar@google.com>
1 parent dc4fe90 commit 311ed5a

File tree

6 files changed

+48
-6
lines changed

6 files changed

+48
-6
lines changed

lib/web_ui/dev/generate_fallback_font_data.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,18 @@ class GenerateFallbackFontDataCommand extends Command<bool>
114114
sb.writeln();
115115
sb.writeln('// DO NOT EDIT! This file is generated. See:');
116116
sb.writeln('// dev/generate_fallback_font_data.dart');
117+
sb.writeln("import '../configuration.dart';");
117118
sb.writeln("import 'noto_font.dart';");
118119
sb.writeln();
119120
sb.writeln('final List<NotoFont> fallbackFonts = <NotoFont>[');
120121

121122
for (final String family in fallbackFonts) {
123+
if (family == 'Noto Emoji') {
124+
sb.write(' if (!configuration.useColorEmoji)');
125+
}
126+
if (family == 'Noto Color Emoji') {
127+
sb.write(' if (configuration.useColorEmoji)');
128+
}
122129
sb.writeln(" NotoFont('$family', '${urlForFamily[family]!}',");
123130
final List<String> starts = <String>[];
124131
final List<String> ends = <String>[];
@@ -166,6 +173,7 @@ class GenerateFallbackFontDataCommand extends Command<bool>
166173
const List<String> fallbackFonts = <String>[
167174
'Noto Sans',
168175
'Noto Color Emoji',
176+
'Noto Emoji',
169177
'Noto Sans Symbols',
170178
'Noto Sans Symbols 2',
171179
'Noto Sans Adlam',

lib/web_ui/lib/src/engine/canvaskit/font_fallback_data.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// DO NOT EDIT! This file is generated. See:
66
// dev/generate_fallback_font_data.dart
7+
import '../configuration.dart';
78
import 'noto_font.dart';
89

910
final List<NotoFont> fallbackFonts = <NotoFont>[
@@ -12,11 +13,16 @@ final List<NotoFont> fallbackFonts = <NotoFont>[
1213
// <int>[0x7e,0x377,0x37f,0x38a,0x38c,0x3a1,0x3e1,0x52f,0x97f,0x1ac0,0x1c88,0x1cf6,0x1cf9,0x1df9,0x1f15,0x1f1d,0x1f45,0x1f4d,0x1f57,0x1f59,0x1f5b,0x1f5d,0x1f7d,0x1fb4,0x1fc4,0x1fd3,0x1fdb,0x1fef,0x1ff4,0x1ffe,0x2064,0x2071,0x208e,0x209c,0x20bf,0x20f0,0x215f,0x2184,0x2189,0x2212,0x2215,0x25cc,0x2c7f,0x2e52,0xa69f,0xa7bf,0xa7ca,0xa7ff,0xa839,0xa8ff,0xa92e,0xab6b,0xfb06,0xfe00,0xfe2f,0xfeff,0xfffd,]
1314
'w|2m;4g|k7;oq|5;p0|6;p8|;pa|j;pv|1q;s0|8v;1s0|3j;59s|g;5mo|8;5ow|12;5q0|1;5q8|6x;5x7|7u;654|5;65c|11;66g|5;66o|7;66x|;66z|;671|;673|u;680|1g;69i|e;69y|d;6ae|5;6al|i;6b6|2;6ba|8;6bk|2s;6ee|b;6es|q;6fk|c;6g0|v;6i8|;6io|2n;6mc|;6mh|;6qa|;6qd|;7gs|;8rk|v;928|36;wu8|2n;wzk|5b;x4y|8;x6d|a;x80|9;xcw|v;xf2|;xtc|1n;1dkw|6;1e68|;1e74|f;1edb|;1ekc|1;',
1415
),
15-
NotoFont('Noto Color Emoji', 'https://fonts.gstatic.com/s/notocoloremoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFab5s79iz64w.ttf',
16+
if (configuration.useColorEmoji) NotoFont('Noto Color Emoji', 'https://fonts.gstatic.com/s/notocoloremoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFab5s79iz64w.ttf',
1617
// <int>[0x20,0x23,0x2a,0x30,0xa9,0xae,0x200d,0x203c,0x2049,0x20e3,0x2122,0x2139,0x2194,0x21a9,0x231a,0x2328,0x23cf,0x23e9,0x23f8,0x24c2,0x25aa,0x25b6,0x25c0,0x25fb,0x2600,0x260e,0x2611,0x2614,0x2618,0x261d,0x2620,0x2622,0x2626,0x262a,0x262e,0x2638,0x2640,0x2642,0x2648,0x265f,0x2663,0x2665,0x2668,0x267b,0x267e,0x2692,0x2699,0x269b,0x26a0,0x26a7,0x26aa,0x26b0,0x26bd,0x26c4,0x26c8,0x26ce,0x26d1,0x26d3,0x26e9,0x26f0,0x26f7,0x26fd,0x2702,0x2705,0x2708,0x270f,0x2712,0x2714,0x2716,0x271d,0x2721,0x2728,0x2733,0x2744,0x2747,0x274c,0x274e,0x2753,0x2757,0x2763,0x2795,0x27a1,0x27b0,0x27bf,0x2934,0x2b05,0x2b1b,0x2b50,0x2b55,0x3030,0x303d,0x3297,0x3299,0x1f004,0x1f0cf,0x1f170,0x1f17e,0x1f18e,0x1f191,0x1f1e6,0x1f201,0x1f21a,0x1f22f,0x1f232,0x1f250,0x1f300,0x1f324,0x1f396,0x1f399,0x1f39e,0x1f3f3,0x1f3f7,0x1f4ff,0x1f549,0x1f550,0x1f56f,0x1f573,0x1f587,0x1f58a,0x1f590,0x1f595,0x1f5a4,0x1f5a8,0x1f5b1,0x1f5bc,0x1f5c2,0x1f5d1,0x1f5dc,0x1f5e1,0x1f5e3,0x1f5e8,0x1f5ef,0x1f5f3,0x1f5fa,0x1f680,0x1f6cb,0x1f6d5,0x1f6dc,0x1f6e9,0x1f6eb,0x1f6f0,0x1f6f3,0x1f7e0,0x1f7f0,0x1f90c,0x1f93c,0x1f947,0x1fa70,0x1fa80,0x1fa90,0x1fabf,0x1face,0x1fae0,0x1faf0,0xe0030,0xe0061,0xe007f,0xfe4e5,0xfe82c,0xfe82e,],
1718
// <int>[0x20,0x23,0x2a,0x39,0xa9,0xae,0x200d,0x203c,0x2049,0x20e3,0x2122,0x2139,0x2199,0x21aa,0x231b,0x2328,0x23cf,0x23f3,0x23fa,0x24c2,0x25ab,0x25b6,0x25c0,0x25fe,0x2604,0x260e,0x2611,0x2615,0x2618,0x261d,0x2620,0x2623,0x2626,0x262a,0x262f,0x263a,0x2640,0x2642,0x2653,0x2660,0x2663,0x2666,0x2668,0x267b,0x267f,0x2697,0x2699,0x269c,0x26a1,0x26a7,0x26ab,0x26b1,0x26be,0x26c5,0x26c8,0x26cf,0x26d1,0x26d4,0x26ea,0x26f5,0x26fa,0x26fd,0x2702,0x2705,0x270d,0x270f,0x2712,0x2714,0x2716,0x271d,0x2721,0x2728,0x2734,0x2744,0x2747,0x274c,0x274e,0x2755,0x2757,0x2764,0x2797,0x27a1,0x27b0,0x27bf,0x2935,0x2b07,0x2b1c,0x2b50,0x2b55,0x3030,0x303d,0x3297,0x3299,0x1f004,0x1f0cf,0x1f171,0x1f17f,0x1f18e,0x1f19a,0x1f1ff,0x1f202,0x1f21a,0x1f22f,0x1f23a,0x1f251,0x1f321,0x1f393,0x1f397,0x1f39b,0x1f3f0,0x1f3f5,0x1f4fd,0x1f53d,0x1f54e,0x1f567,0x1f570,0x1f57a,0x1f587,0x1f58d,0x1f590,0x1f596,0x1f5a5,0x1f5a8,0x1f5b2,0x1f5bc,0x1f5c4,0x1f5d3,0x1f5de,0x1f5e1,0x1f5e3,0x1f5e8,0x1f5ef,0x1f5f3,0x1f64f,0x1f6c5,0x1f6d2,0x1f6d7,0x1f6e5,0x1f6e9,0x1f6ec,0x1f6f0,0x1f6fc,0x1f7eb,0x1f7f0,0x1f93a,0x1f945,0x1f9ff,0x1fa7c,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uration.useColorEmoji) NotoFont('Noto Emoji', 'https://fonts.gstatic.com/s/notoemoji/v34/bMrnmSyK7YY-MEu6aWjPDs-ar6uWaGWuob-r0jwvS-FGJCMY.ttf',
22+
// <int>[0x20,0x23,0x2a,0x30,0xa9,0xae,0x200d,0x203c,0x2049,0x20e3,0x2122,0x2139,0x2194,0x21a9,0x231a,0x2328,0x23cf,0x23e9,0x23f8,0x24c2,0x25aa,0x25b6,0x25c0,0x25fb,0x2600,0x260e,0x2611,0x2614,0x2618,0x261d,0x2620,0x2622,0x2626,0x262a,0x262e,0x2638,0x2640,0x2642,0x2648,0x265f,0x2663,0x2665,0x2668,0x267b,0x267e,0x2692,0x2699,0x269b,0x26a0,0x26a7,0x26aa,0x26b0,0x26bd,0x26c4,0x26c8,0x26ce,0x26d1,0x26d3,0x26e9,0x26f0,0x26f7,0x26fd,0x2702,0x2705,0x2708,0x270f,0x2712,0x2714,0x2716,0x271d,0x2721,0x2728,0x2733,0x2744,0x2747,0x274c,0x274e,0x2753,0x2757,0x2763,0x2795,0x27a1,0x27b0,0x27bf,0x2934,0x2b05,0x2b1b,0x2b50,0x2b55,0x3030,0x303d,0x3297,0x3299,0xfe0e,0x1f004,0x1f0cf,0x1f170,0x1f17e,0x1f18e,0x1f191,0x1f1e6,0x1f201,0x1f21a,0x1f22f,0x1f232,0x1f250,0x1f300,0x1f324,0x1f396,0x1f399,0x1f39e,0x1f3f3,0x1f3f7,0x1f4ff,0x1f549,0x1f550,0x1f56f,0x1f573,0x1f587,0x1f58a,0x1f590,0x1f595,0x1f5a4,0x1f5a8,0x1f5b1,0x1f5bc,0x1f5c2,0x1f5d1,0x1f5dc,0x1f5e1,0x1f5e3,0x1f5e8,0x1f5ef,0x1f5f3,0x1f5fa,0x1f680,0x1f6cb,0x1f6d5,0x1f6dc,0x1f6e9,0x1f6eb,0x1f6f0,0x1f6f3,0x1f7e0,0x1f7f0,0x1f90c,0x1f93c,0x1f947,0x1fa70,0x1fa80,0x1fa90,0x1fabf,0x1face,0x1fae0,0x1faf0,0xe0030,0xe0061,0xe007f,0xfe4e5,0xfe82c,0xfe82e,],
23+
// <int>[0x20,0x23,0x2a,0x39,0xa9,0xae,0x200d,0x203c,0x2049,0x20e3,0x2122,0x2139,0x2199,0x21aa,0x231b,0x2328,0x23cf,0x23f3,0x23fa,0x24c2,0x25ab,0x25b6,0x25c0,0x25fe,0x2604,0x260e,0x2611,0x2615,0x2618,0x261d,0x2620,0x2623,0x2626,0x262a,0x262f,0x263a,0x2640,0x2642,0x2653,0x2660,0x2663,0x2666,0x2668,0x267b,0x267f,0x2697,0x2699,0x269c,0x26a1,0x26a7,0x26ab,0x26b1,0x26be,0x26c5,0x26c8,0x26cf,0x26d1,0x26d4,0x26ea,0x26f5,0x26fa,0x26fd,0x2702,0x2705,0x270d,0x270f,0x2712,0x2714,0x2716,0x271d,0x2721,0x2728,0x2734,0x2744,0x2747,0x274c,0x274e,0x2755,0x2757,0x2764,0x2797,0x27a1,0x27b0,0x27bf,0x2935,0x2b07,0x2b1c,0x2b50,0x2b55,0x3030,0x303d,0x3297,0x3299,0xfe0f,0x1f004,0x1f0cf,0x1f171,0x1f17f,0x1f18e,0x1f19a,0x1f1ff,0x1f202,0x1f21a,0x1f22f,0x1f23a,0x1f251,0x1f321,0x1f393,0x1f397,0x1f39b,0x1f3f0,0x1f3f5,0x1f4fd,0x1f53d,0x1f54e,0x1f567,0x1f570,0x1f57a,0x1f587,0x1f58d,0x1f590,0x1f596,0x1f5a5,0x1f5a8,0x1f5b2,0x1f5bc,0x1f5c4,0x1f5d3,0x1f5de,0x1f5e1,0x1f5e3,0x1f5e8,0x1f5ef,0x1f5f3,0x1f64f,0x1f6c5,0x1f6d2,0x1f6d7,0x1f6e5,0x1f6e9,0x1f6ec,0x1f6f0,0x1f6fc,0x1f7eb,0x1f7f0,0x1f93a,0x1f945,0x1f9ff,0x1fa7c,0x1fa88,0x1fabd,0x1fac5,0x1fadb,0x1fae8,0x1faf8,0xe0039,0xe007a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q65FkAtHfwd-eIS2brbDN6gxP34F9jRRCe4W3gfQ8gavVFRkzrbQ.ttf',
2127
// <int>[0x20,0xa0,0xa5,0xa7,0xae,0xb4,0xb6,0xba,0xbf,0x10a,0x116,0x11e,0x126,0x12a,0x12e,0x136,0x139,0x141,0x14a,0x150,0x15e,0x164,0x16a,0x1cd,0x218,0x237,0x2c6,0x2c9,0x2d8,0x300,0x306,0x30a,0x312,0x326,0x1e80,0x1e9e,0x1ef2,0x2013,0x2018,0x201c,0x2022,0x2026,0x2039,0x20ac,0x20dd,0x20e2,0x2122,0x2160,0x2185,0x218a,0x2190,0x2212,0x2300,0x2311,0x2317,0x231c,0x2322,0x2329,0x232c,0x237c,0x2380,0x2396,0x23af,0x23be,0x23d0,0x23e2,0x2460,0x25cc,0x260a,0x2613,0x2624,0x2638,0x263d,0x2669,0x2690,0x26a2,0x26ad,0x26ce,0x26e2,0x271d,0x2776,0x2921,0x1f100,0x1f110,0x1f170,0x1f19b,0x1f546,0x1f54f,0x1f610,0x1f700,],
2228
// <int>[0x7e,0xa3,0xa5,0xab,0xb0,0xb4,0xb8,0xbb,0x107,0x113,0x11b,0x123,0x127,0x12b,0x133,0x137,0x13e,0x148,0x14d,0x15b,0x161,0x165,0x17e,0x1ce,0x21b,0x237,0x2c7,0x2c9,0x2dd,0x304,0x308,0x30c,0x312,0x328,0x1e85,0x1e9e,0x1ef3,0x2014,0x201a,0x201e,0x2022,0x2026,0x203a,0x20ac,0x20e0,0x20e4,0x2122,0x2183,0x2188,0x218b,0x2199,0x2212,0x230f,0x2315,0x2317,0x231f,0x2323,0x232a,0x2335,0x237c,0x2394,0x239a,0x23af,0x23cd,0x23db,0x23e8,0x24ff,0x25cc,0x260d,0x2613,0x262f,0x263b,0x2653,0x267e,0x269d,0x26a9,0x26bc,0x26ce,0x26ff,0x2721,0x2793,0x2922,0x1f10c,0x1f16c,0x1f190,0x1f1ac,0x1f549,0x1f54f,0x1f610,0x1f773,]

lib/web_ui/lib/src/engine/canvaskit/font_fallbacks.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ class FontFallbackData {
225225
registeredFallbackFonts.add(RegisteredFont(bytes, family, typeface));
226226
// Insert emoji font before all other fallback fonts so we use the emoji
227227
// whenever it's available.
228-
if (family == 'Noto Color Emoji') {
228+
if (family == 'Noto Color Emoji' || family == 'Noto Emoji') {
229229
if (globalFontFallbacks.first == 'Roboto') {
230230
globalFontFallbacks.insert(1, family);
231231
} else {

lib/web_ui/lib/src/engine/configuration.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,12 @@ class FlutterConfiguration {
277277
///
278278
/// This is used by the Renderer class to decide how to initialize the engine.
279279
String? get requestedRendererType => _configuration?.renderer ?? _requestedRendererType;
280+
281+
/// Whether to use color emojis or not.
282+
///
283+
/// The font used to render color emojis is large (~24MB). This configuration
284+
/// gives developers the ability to decide for their app.
285+
bool get useColorEmoji => _configuration?.useColorEmoji ?? false;
280286
}
281287

282288
@JS('window.flutterConfiguration')
@@ -317,6 +323,10 @@ extension JsFlutterConfigurationExtension on JsFlutterConfiguration {
317323
@JS('renderer')
318324
external JSString? get _renderer;
319325
String? get renderer => _renderer?.toDart;
326+
327+
@JS('useColorEmoji')
328+
external JSBoolean? get _useColorEmoji;
329+
bool? get useColorEmoji => _useColorEmoji?.toDart;
320330
}
321331

322332
/// A JavaScript entrypoint that allows developer to set rendering backend

lib/web_ui/test/canvaskit/fallback_fonts_golden_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void testMain() {
3535
.singleWhere((NotoFont font) => font.name == 'Noto Sans Arabic')
3636
.url;
3737
final String notoEmojiUrl = fallbackFonts
38-
.singleWhere((NotoFont font) => font.name == 'Noto Color Emoji')
38+
.singleWhere((NotoFont font) => font.name == 'Noto Emoji')
3939
.url;
4040
TestDownloader.mockDownloads[notoSansArabicUrl] =
4141
'/assets/fonts/NotoNaskhArabic-Regular.ttf';
@@ -123,7 +123,7 @@ void testMain() {
123123

124124
expect(FontFallbackData.instance.globalFontFallbacks, <String>[
125125
'Roboto',
126-
'Noto Color Emoji',
126+
'Noto Emoji',
127127
'Noto Sans Arabic',
128128
]);
129129
});
@@ -144,7 +144,7 @@ void testMain() {
144144
await notoDownloadQueue.debugWhenIdle();
145145

146146
expect(FontFallbackData.instance.globalFontFallbacks,
147-
contains('Noto Color Emoji'));
147+
contains('Noto Emoji'));
148148

149149
final CkPictureRecorder recorder = CkPictureRecorder();
150150
final CkCanvas canvas = recorder.beginRecording(kDefaultRegion);
@@ -250,7 +250,7 @@ void testMain() {
250250
testedFonts,
251251
unorderedEquals(<String>{
252252
'Noto Sans',
253-
'Noto Color Emoji',
253+
'Noto Emoji',
254254
'Noto Sans Symbols',
255255
'Noto Sans Symbols 2',
256256
'Noto Sans Adlam',

lib/web_ui/test/engine/configuration_test.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,22 @@ void testMain() {
103103
expect(config.canvasKitVariant, CanvasKitVariant.chromium);
104104
});
105105
});
106+
107+
group('useColorEmoji', () {
108+
test('defaults to false', () {
109+
final FlutterConfiguration config = FlutterConfiguration();
110+
config.setUserConfiguration(
111+
js_util.jsify(<String, Object?>{}) as JsFlutterConfiguration,
112+
);
113+
expect(config.useColorEmoji, isFalse);
114+
});
115+
116+
test('can be set to true', () {
117+
final FlutterConfiguration config = FlutterConfiguration();
118+
config.setUserConfiguration(
119+
js_util.jsify(<String, Object?>{'useColorEmoji': true}) as JsFlutterConfiguration,
120+
);
121+
expect(config.useColorEmoji, isTrue);
122+
});
123+
});
106124
}

0 commit comments

Comments
 (0)