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

Commit 1252ac0

Browse files
authored
[web] Support woff2 fonts (#55908)
- Enable support for WOFF2 fonts. - Add Brotli depndency (increases CK size by ~53KB compressed, including the Brotli dictionary). - Use split WOFF2 fonts for Emoji. - Remove the `useColorEmoji` runtime config flag. Partially based off of #41282 Fixes flutter/flutter#119536 Contributes to flutter/flutter#153974 and opens the door for moving more fonts to WOFF2.
1 parent c5f301b commit 1252ac0

File tree

22 files changed

+3591
-2433
lines changed

22 files changed

+3591
-2433
lines changed

DEPS

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ vars = {
158158
"upstream_boolean_selector": "https://github.com/dart-lang/boolean_selector.git",
159159
"upstream_boringssl_gen": "https://github.com/dart-lang/boringssl_gen.git",
160160
"upstream_boringssl": "https://github.com/openssl/openssl.git",
161+
"upstream_brotli": "https://github.com/google/brotli.git",
161162
"upstream_browser_launcher": "https://github.com/dart-lang/browser_launcher.git",
162163
"upstream_buildroot": "https://github.com/flutter/buildroot.git",
163164
"upstream_cli_util": "https://github.com/dart-lang/cli_util.git",
@@ -320,6 +321,9 @@ deps = {
320321
'src/flutter/third_party/boringssl':
321322
Var('dart_git') + '/boringssl_gen.git' + '@' + Var('dart_boringssl_gen_rev'),
322323

324+
'src/flutter/third_party/brotli':
325+
Var('skia_git') + '/external/github.com/google/brotli.git' + '@' + '350100a5bb9d9671aca85213b2ec7a70a361b0cd',
326+
323327
'src/flutter/third_party/yapf':
324328
Var('flutter_git') + '/third_party/yapf' + '@' + '212c5b5ad8e172d2d914ae454c121c89cccbcb35',
325329

@@ -1006,7 +1010,7 @@ deps = {
10061010
'packages': [
10071011
{
10081012
'package': 'flutter/flutter_font_fallbacks',
1009-
'version': 'c81f5a2b369b48df3728d2b247a27901bb76bbce0c40b343fe1cc924a36b36ea'
1013+
'version': '91f2de34d4a309816a182ce7552201d95388e2e0bceea951a6dd04693ed6fe30'
10101014
}
10111015
],
10121016
'dep_type': 'cipd',
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright 2013 The Flutter Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
source_root = "//flutter/third_party/brotli"
6+
7+
config("brotli_public") {
8+
include_dirs = [
9+
"$source_root/c/include",
10+
"$source_root/c/common/dictionary.h",
11+
]
12+
13+
cflags = []
14+
foreach(dir, include_dirs) {
15+
cflags += [
16+
"-isystem",
17+
rebase_path(dir),
18+
]
19+
}
20+
}
21+
22+
static_library("brotli") {
23+
# Brotli is used by freetype; it only needs the brotli decoder.
24+
sources = [
25+
"$source_root/c/common/constants.c",
26+
"$source_root/c/common/context.c",
27+
"$source_root/c/common/dictionary.c",
28+
"$source_root/c/common/platform.c",
29+
"$source_root/c/common/shared_dictionary.c",
30+
"$source_root/c/common/transform.c",
31+
"$source_root/c/dec/bit_reader.c",
32+
"$source_root/c/dec/decode.c",
33+
"$source_root/c/dec/huffman.c",
34+
"$source_root/c/dec/state.c",
35+
]
36+
37+
public_configs = [ ":brotli_public" ]
38+
cflags = [ "-w" ]
39+
}

ci/licenses.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function verify_licenses() (
173173

174174
local actualLicenseCount
175175
actualLicenseCount="$(tail -n 1 flutter/ci/licenses_golden/licenses_flutter | tr -dc '0-9')"
176-
local expectedLicenseCount=909 # When changing this number: Update the error message below as well describing the newly expected license types.
176+
local expectedLicenseCount=918
177177

178178
if [[ $actualLicenseCount -ne $expectedLicenseCount ]]; then
179179
echo "=============================== ERROR ==============================="

ci/licenses_golden/excluded_files

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,6 +1346,33 @@
13461346
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/xchacha20_poly1305_test.json
13471347
../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/xchacha20_poly1305_test.txt
13481348
../../../flutter/third_party/boringssl/src/util
1349+
../../../flutter/third_party/brotli/.editorconfig
1350+
../../../flutter/third_party/brotli/.git
1351+
../../../flutter/third_party/brotli/.gitattributes
1352+
../../../flutter/third_party/brotli/.github
1353+
../../../flutter/third_party/brotli/.gitignore
1354+
../../../flutter/third_party/brotli/BUILD.bazel
1355+
../../../flutter/third_party/brotli/CHANGELOG.md
1356+
../../../flutter/third_party/brotli/CMakeLists.txt
1357+
../../../flutter/third_party/brotli/CONTRIBUTING.md
1358+
../../../flutter/third_party/brotli/MANIFEST.in
1359+
../../../flutter/third_party/brotli/README
1360+
../../../flutter/third_party/brotli/README.md
1361+
../../../flutter/third_party/brotli/SECURITY.md
1362+
../../../flutter/third_party/brotli/WORKSPACE.bazel
1363+
../../../flutter/third_party/brotli/c/fuzz/.bazelrc
1364+
../../../flutter/third_party/brotli/c/fuzz/BUILD.bazel
1365+
../../../flutter/third_party/brotli/c/fuzz/WORKSPACE.bazel
1366+
../../../flutter/third_party/brotli/csharp
1367+
../../../flutter/third_party/brotli/docs
1368+
../../../flutter/third_party/brotli/go
1369+
../../../flutter/third_party/brotli/java
1370+
../../../flutter/third_party/brotli/js
1371+
../../../flutter/third_party/brotli/python
1372+
../../../flutter/third_party/brotli/research
1373+
../../../flutter/third_party/brotli/scripts
1374+
../../../flutter/third_party/brotli/setup.py
1375+
../../../flutter/third_party/brotli/tests
13491376
../../../flutter/third_party/cpu_features/src/.clang-format
13501377
../../../flutter/third_party/cpu_features/src/.git
13511378
../../../flutter/third_party/cpu_features/src/.github

0 commit comments

Comments
 (0)