From 2af8c83f84a6bc0159474bf7b8423ceeaf5c9372 Mon Sep 17 00:00:00 2001 From: Mouad Debbar Date: Mon, 21 Oct 2024 13:38:22 +0000 Subject: [PATCH] [web] Support woff2 fonts (flutter/engine#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 https://github.com/flutter/engine/pull/41282 Fixes https://github.com/flutter/flutter/issues/119536 Contributes to https://github.com/flutter/flutter/issues/153974 and opens the door for moving more fonts to WOFF2. --- DEPS | 6 +- .../secondary/third_party/brotli/BUILD.gn | 39 + engine/src/flutter/ci/licenses.sh | 2 +- .../flutter/ci/licenses_golden/excluded_files | 27 + .../ci/licenses_golden/licenses_flutter | 427 +- .../flutter/ci/licenses_golden/tool_signature | 2 +- .../lib/web_ui/dev/roll_fallback_fonts.dart | 151 +- .../flutter/lib/web_ui/dev/test_platform.dart | 2 - .../web_ui/lib/src/engine/configuration.dart | 10 - .../lib/src/engine/font_fallback_data.dart | 5123 +++++++++-------- .../web_ui/lib/src/engine/font_fallbacks.dart | 7 +- .../lib/web_ui/lib/src/engine/noto_font.dart | 16 +- engine/src/flutter/lib/web_ui/pubspec.yaml | 1 + .../test/engine/configuration_test.dart | 12 - .../test/ui/fallback_fonts_golden_test.dart | 33 +- .../lib/web_ui/test/ui/text_golden_test.dart | 9 + .../flutter/sky/packages/sky_engine/LICENSE | 199 + .../flutter/third_party/canvaskit/BUILD.gn | 2 +- engine/src/flutter/tools/gn | 1 + .../tools/licenses/lib/filesystem.dart | 3 + .../src/flutter/tools/licenses/lib/paths.dart | 9 + .../flutter/tools/licenses/lib/patterns.dart | 7 + 22 files changed, 3623 insertions(+), 2465 deletions(-) create mode 100644 engine/src/flutter/build/secondary/third_party/brotli/BUILD.gn diff --git a/DEPS b/DEPS index 68010f9ecc..5d01487961 100644 --- a/DEPS +++ b/DEPS @@ -158,6 +158,7 @@ vars = { "upstream_boolean_selector": "https://github.com/dart-lang/boolean_selector.git", "upstream_boringssl_gen": "https://github.com/dart-lang/boringssl_gen.git", "upstream_boringssl": "https://github.com/openssl/openssl.git", + "upstream_brotli": "https://github.com/google/brotli.git", "upstream_browser_launcher": "https://github.com/dart-lang/browser_launcher.git", "upstream_buildroot": "https://github.com/flutter/buildroot.git", "upstream_cli_util": "https://github.com/dart-lang/cli_util.git", @@ -320,6 +321,9 @@ deps = { 'src/flutter/third_party/boringssl': Var('dart_git') + '/boringssl_gen.git' + '@' + Var('dart_boringssl_gen_rev'), + 'src/flutter/third_party/brotli': + Var('skia_git') + '/external/github.com/google/brotli.git' + '@' + '350100a5bb9d9671aca85213b2ec7a70a361b0cd', + 'src/flutter/third_party/yapf': Var('flutter_git') + '/third_party/yapf' + '@' + '212c5b5ad8e172d2d914ae454c121c89cccbcb35', @@ -1006,7 +1010,7 @@ deps = { 'packages': [ { 'package': 'flutter/flutter_font_fallbacks', - 'version': 'c81f5a2b369b48df3728d2b247a27901bb76bbce0c40b343fe1cc924a36b36ea' + 'version': '91f2de34d4a309816a182ce7552201d95388e2e0bceea951a6dd04693ed6fe30' } ], 'dep_type': 'cipd', diff --git a/engine/src/flutter/build/secondary/third_party/brotli/BUILD.gn b/engine/src/flutter/build/secondary/third_party/brotli/BUILD.gn new file mode 100644 index 0000000000..d98ec7a74e --- /dev/null +++ b/engine/src/flutter/build/secondary/third_party/brotli/BUILD.gn @@ -0,0 +1,39 @@ +# Copyright 2013 The Flutter Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_root = "//flutter/third_party/brotli" + +config("brotli_public") { + include_dirs = [ + "$source_root/c/include", + "$source_root/c/common/dictionary.h", + ] + + cflags = [] + foreach(dir, include_dirs) { + cflags += [ + "-isystem", + rebase_path(dir), + ] + } +} + +static_library("brotli") { + # Brotli is used by freetype; it only needs the brotli decoder. + sources = [ + "$source_root/c/common/constants.c", + "$source_root/c/common/context.c", + "$source_root/c/common/dictionary.c", + "$source_root/c/common/platform.c", + "$source_root/c/common/shared_dictionary.c", + "$source_root/c/common/transform.c", + "$source_root/c/dec/bit_reader.c", + "$source_root/c/dec/decode.c", + "$source_root/c/dec/huffman.c", + "$source_root/c/dec/state.c", + ] + + public_configs = [ ":brotli_public" ] + cflags = [ "-w" ] +} diff --git a/engine/src/flutter/ci/licenses.sh b/engine/src/flutter/ci/licenses.sh index d5aab8294c..d71028c375 100755 --- a/engine/src/flutter/ci/licenses.sh +++ b/engine/src/flutter/ci/licenses.sh @@ -173,7 +173,7 @@ function verify_licenses() ( local actualLicenseCount actualLicenseCount="$(tail -n 1 flutter/ci/licenses_golden/licenses_flutter | tr -dc '0-9')" - local expectedLicenseCount=909 # When changing this number: Update the error message below as well describing the newly expected license types. + local expectedLicenseCount=918 if [[ $actualLicenseCount -ne $expectedLicenseCount ]]; then echo "=============================== ERROR ===============================" diff --git a/engine/src/flutter/ci/licenses_golden/excluded_files b/engine/src/flutter/ci/licenses_golden/excluded_files index 98286f6347..1009dc88cc 100644 --- a/engine/src/flutter/ci/licenses_golden/excluded_files +++ b/engine/src/flutter/ci/licenses_golden/excluded_files @@ -1346,6 +1346,33 @@ ../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/xchacha20_poly1305_test.json ../../../flutter/third_party/boringssl/src/third_party/wycheproof_testvectors/xchacha20_poly1305_test.txt ../../../flutter/third_party/boringssl/src/util +../../../flutter/third_party/brotli/.editorconfig +../../../flutter/third_party/brotli/.git +../../../flutter/third_party/brotli/.gitattributes +../../../flutter/third_party/brotli/.github +../../../flutter/third_party/brotli/.gitignore +../../../flutter/third_party/brotli/BUILD.bazel +../../../flutter/third_party/brotli/CHANGELOG.md +../../../flutter/third_party/brotli/CMakeLists.txt +../../../flutter/third_party/brotli/CONTRIBUTING.md +../../../flutter/third_party/brotli/MANIFEST.in +../../../flutter/third_party/brotli/README +../../../flutter/third_party/brotli/README.md +../../../flutter/third_party/brotli/SECURITY.md +../../../flutter/third_party/brotli/WORKSPACE.bazel +../../../flutter/third_party/brotli/c/fuzz/.bazelrc +../../../flutter/third_party/brotli/c/fuzz/BUILD.bazel +../../../flutter/third_party/brotli/c/fuzz/WORKSPACE.bazel +../../../flutter/third_party/brotli/csharp +../../../flutter/third_party/brotli/docs +../../../flutter/third_party/brotli/go +../../../flutter/third_party/brotli/java +../../../flutter/third_party/brotli/js +../../../flutter/third_party/brotli/python +../../../flutter/third_party/brotli/research +../../../flutter/third_party/brotli/scripts +../../../flutter/third_party/brotli/setup.py +../../../flutter/third_party/brotli/tests ../../../flutter/third_party/cpu_features/src/.clang-format ../../../flutter/third_party/cpu_features/src/.git ../../../flutter/third_party/cpu_features/src/.github diff --git a/engine/src/flutter/ci/licenses_golden/licenses_flutter b/engine/src/flutter/ci/licenses_golden/licenses_flutter index 58c532962b..2f9eb9fa69 100644 --- a/engine/src/flutter/ci/licenses_golden/licenses_flutter +++ b/engine/src/flutter/ci/licenses_golden/licenses_flutter @@ -36833,6 +36833,42 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: brotli +ORIGIN: ../../../flutter/third_party/brotli/LICENSE +TYPE: LicenseType.mit +FILE: ../../../flutter/third_party/brotli/.bazelignore +FILE: ../../../flutter/third_party/brotli/c/common/context.c +FILE: ../../../flutter/third_party/brotli/c/common/dictionary.bin +FILE: ../../../flutter/third_party/brotli/c/common/dictionary.bin.br +FILE: ../../../flutter/third_party/brotli/c/common/transform.h +FILE: ../../../flutter/third_party/brotli/c/enc/matching_tag_mask.h +FILE: ../../../flutter/third_party/brotli/c/tools/brotli.md +FILE: ../../../flutter/third_party/brotli/fetch-spec/shared-brotli-fetch-spec.txt +FILE: ../../../flutter/third_party/brotli/pyproject.toml +FILE: ../../../flutter/third_party/brotli/setup.cfg +---------------------------------------------------------------------------------------------------- +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +==================================================================================================== + ==================================================================================================== LIBRARY: icu ORIGIN: ../../../flutter/third_party/icu/source/data/sprep/rfc3491.txt + ../../../flutter/third_party/icu/LICENSE @@ -41300,6 +41336,51 @@ freely, subject to the following restrictions: 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== +==================================================================================================== +LIBRARY: brotli +ORIGIN: ../../../flutter/third_party/brotli/c/enc/entropy_encode.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/entropy_encode.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/find_match_length.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/hash.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/hash_longest_match64_inc.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/hash_longest_match64_simd_inc.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/hash_longest_match_inc.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/hash_longest_match_quickly_inc.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/hash_longest_match_simd_inc.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/write_bits.h + ../../../flutter/third_party/brotli/LICENSE +TYPE: LicenseType.mit +FILE: ../../../flutter/third_party/brotli/c/enc/entropy_encode.c +FILE: ../../../flutter/third_party/brotli/c/enc/entropy_encode.h +FILE: ../../../flutter/third_party/brotli/c/enc/find_match_length.h +FILE: ../../../flutter/third_party/brotli/c/enc/hash.h +FILE: ../../../flutter/third_party/brotli/c/enc/hash_longest_match64_inc.h +FILE: ../../../flutter/third_party/brotli/c/enc/hash_longest_match64_simd_inc.h +FILE: ../../../flutter/third_party/brotli/c/enc/hash_longest_match_inc.h +FILE: ../../../flutter/third_party/brotli/c/enc/hash_longest_match_quickly_inc.h +FILE: ../../../flutter/third_party/brotli/c/enc/hash_longest_match_simd_inc.h +FILE: ../../../flutter/third_party/brotli/c/enc/write_bits.h +---------------------------------------------------------------------------------------------------- +Copyright 2010 Google Inc. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +==================================================================================================== + ==================================================================================================== LIBRARY: libwebp ORIGIN: ../../../flutter/third_party/libwebp/src/dec/frame_dec.c + ../../../flutter/third_party/libwebp/COPYING @@ -42012,6 +42093,119 @@ in the file LICENSE in the source distribution or at https://www.openssl.org/source/license.html ==================================================================================================== +==================================================================================================== +LIBRARY: brotli +ORIGIN: ../../../flutter/third_party/brotli/c/common/constants.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/common/context.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/common/dictionary.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/common/dictionary.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/common/transform.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/dec/bit_reader.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/dec/bit_reader.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/dec/decode.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/dec/huffman.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/dec/huffman.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/dec/prefix.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/backward_references.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/backward_references.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/backward_references_hq.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/backward_references_hq.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/backward_references_inc.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/bit_cost.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/bit_cost.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/bit_cost_inc.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/block_splitter.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/block_splitter.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/block_splitter_inc.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/cluster.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/cluster.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/cluster_inc.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/command.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/command.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/encode.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/fast_log.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/fast_log.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/histogram.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/histogram.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/histogram_inc.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/literal_cost.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/literal_cost.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/prefix.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/ringbuffer.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/static_dict.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/static_dict.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/utf8_util.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/utf8_util.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/include/brotli/decode.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/include/brotli/encode.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/include/brotli/types.h + ../../../flutter/third_party/brotli/LICENSE +TYPE: LicenseType.mit +FILE: ../../../flutter/third_party/brotli/c/common/constants.c +FILE: ../../../flutter/third_party/brotli/c/common/context.h +FILE: ../../../flutter/third_party/brotli/c/common/dictionary.c +FILE: ../../../flutter/third_party/brotli/c/common/dictionary.h +FILE: ../../../flutter/third_party/brotli/c/common/transform.c +FILE: ../../../flutter/third_party/brotli/c/dec/bit_reader.c +FILE: ../../../flutter/third_party/brotli/c/dec/bit_reader.h +FILE: ../../../flutter/third_party/brotli/c/dec/decode.c +FILE: ../../../flutter/third_party/brotli/c/dec/huffman.c +FILE: ../../../flutter/third_party/brotli/c/dec/huffman.h +FILE: ../../../flutter/third_party/brotli/c/dec/prefix.h +FILE: ../../../flutter/third_party/brotli/c/enc/backward_references.c +FILE: ../../../flutter/third_party/brotli/c/enc/backward_references.h +FILE: ../../../flutter/third_party/brotli/c/enc/backward_references_hq.c +FILE: ../../../flutter/third_party/brotli/c/enc/backward_references_hq.h +FILE: ../../../flutter/third_party/brotli/c/enc/backward_references_inc.h +FILE: ../../../flutter/third_party/brotli/c/enc/bit_cost.c +FILE: ../../../flutter/third_party/brotli/c/enc/bit_cost.h +FILE: ../../../flutter/third_party/brotli/c/enc/bit_cost_inc.h +FILE: ../../../flutter/third_party/brotli/c/enc/block_splitter.c +FILE: ../../../flutter/third_party/brotli/c/enc/block_splitter.h +FILE: ../../../flutter/third_party/brotli/c/enc/block_splitter_inc.h +FILE: ../../../flutter/third_party/brotli/c/enc/cluster.c +FILE: ../../../flutter/third_party/brotli/c/enc/cluster.h +FILE: ../../../flutter/third_party/brotli/c/enc/cluster_inc.h +FILE: ../../../flutter/third_party/brotli/c/enc/command.c +FILE: ../../../flutter/third_party/brotli/c/enc/command.h +FILE: ../../../flutter/third_party/brotli/c/enc/encode.c +FILE: ../../../flutter/third_party/brotli/c/enc/fast_log.c +FILE: ../../../flutter/third_party/brotli/c/enc/fast_log.h +FILE: ../../../flutter/third_party/brotli/c/enc/histogram.c +FILE: ../../../flutter/third_party/brotli/c/enc/histogram.h +FILE: ../../../flutter/third_party/brotli/c/enc/histogram_inc.h +FILE: ../../../flutter/third_party/brotli/c/enc/literal_cost.c +FILE: ../../../flutter/third_party/brotli/c/enc/literal_cost.h +FILE: ../../../flutter/third_party/brotli/c/enc/prefix.h +FILE: ../../../flutter/third_party/brotli/c/enc/ringbuffer.h +FILE: ../../../flutter/third_party/brotli/c/enc/static_dict.c +FILE: ../../../flutter/third_party/brotli/c/enc/static_dict.h +FILE: ../../../flutter/third_party/brotli/c/enc/utf8_util.c +FILE: ../../../flutter/third_party/brotli/c/enc/utf8_util.h +FILE: ../../../flutter/third_party/brotli/c/include/brotli/decode.h +FILE: ../../../flutter/third_party/brotli/c/include/brotli/encode.h +FILE: ../../../flutter/third_party/brotli/c/include/brotli/types.h +---------------------------------------------------------------------------------------------------- +Copyright 2013 Google Inc. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +==================================================================================================== + ==================================================================================================== LIBRARY: libwebp ORIGIN: ../../../flutter/third_party/libwebp/imageio/wicdec.c + ../../../flutter/third_party/libwebp/COPYING @@ -48116,6 +48310,39 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ==================================================================================================== +==================================================================================================== +LIBRARY: brotli +ORIGIN: ../../../flutter/third_party/brotli/c/enc/block_encoder_inc.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/brotli_bit_stream.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/brotli_bit_stream.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/tools/brotli.c + ../../../flutter/third_party/brotli/LICENSE +TYPE: LicenseType.mit +FILE: ../../../flutter/third_party/brotli/c/enc/block_encoder_inc.h +FILE: ../../../flutter/third_party/brotli/c/enc/brotli_bit_stream.c +FILE: ../../../flutter/third_party/brotli/c/enc/brotli_bit_stream.h +FILE: ../../../flutter/third_party/brotli/c/tools/brotli.c +---------------------------------------------------------------------------------------------------- +Copyright 2014 Google Inc. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +==================================================================================================== + ==================================================================================================== LIBRARY: libwebp ORIGIN: ../../../flutter/third_party/libwebp/imageio/webpdec.c + ../../../flutter/third_party/libwebp/COPYING @@ -48612,6 +48839,59 @@ in the file LICENSE in the source distribution or at https://www.openssl.org/source/license.html ==================================================================================================== +==================================================================================================== +LIBRARY: brotli +ORIGIN: ../../../flutter/third_party/brotli/c/dec/state.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/dec/state.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/compress_fragment.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/compress_fragment.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/compress_fragment_two_pass.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/compress_fragment_two_pass.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/dictionary_hash.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/dictionary_hash.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/entropy_encode_static.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/memory.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/metablock.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/metablock.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/metablock_inc.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/static_dict_lut.h + ../../../flutter/third_party/brotli/LICENSE +TYPE: LicenseType.mit +FILE: ../../../flutter/third_party/brotli/c/dec/state.c +FILE: ../../../flutter/third_party/brotli/c/dec/state.h +FILE: ../../../flutter/third_party/brotli/c/enc/compress_fragment.c +FILE: ../../../flutter/third_party/brotli/c/enc/compress_fragment.h +FILE: ../../../flutter/third_party/brotli/c/enc/compress_fragment_two_pass.c +FILE: ../../../flutter/third_party/brotli/c/enc/compress_fragment_two_pass.h +FILE: ../../../flutter/third_party/brotli/c/enc/dictionary_hash.c +FILE: ../../../flutter/third_party/brotli/c/enc/dictionary_hash.h +FILE: ../../../flutter/third_party/brotli/c/enc/entropy_encode_static.h +FILE: ../../../flutter/third_party/brotli/c/enc/memory.c +FILE: ../../../flutter/third_party/brotli/c/enc/metablock.c +FILE: ../../../flutter/third_party/brotli/c/enc/metablock.h +FILE: ../../../flutter/third_party/brotli/c/enc/metablock_inc.h +FILE: ../../../flutter/third_party/brotli/c/enc/static_dict_lut.h +---------------------------------------------------------------------------------------------------- +Copyright 2015 Google Inc. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +==================================================================================================== + ==================================================================================================== LIBRARY: libwebp ORIGIN: ../../../flutter/third_party/libwebp/extras/extras.c + ../../../flutter/third_party/libwebp/COPYING @@ -49047,12 +49327,14 @@ found in the LICENSE file ==================================================================================================== LIBRARY: accessibility +LIBRARY: brotli ORIGIN: ../../../flutter/third_party/accessibility/ax/ax_tree_data.cc + ../../../flutter/third_party/accessibility/LICENSE ORIGIN: ../../../flutter/third_party/accessibility/ax/ax_tree_data.h + ../../../flutter/third_party/accessibility/LICENSE ORIGIN: ../../../flutter/third_party/accessibility/ax/platform/ax_platform_node_win.cc + ../../../flutter/third_party/accessibility/LICENSE ORIGIN: ../../../flutter/third_party/accessibility/ax/platform/ax_platform_node_win.h + ../../../flutter/third_party/accessibility/LICENSE ORIGIN: ../../../flutter/third_party/accessibility/ax/platform/test_ax_node_wrapper.cc + ../../../flutter/third_party/accessibility/LICENSE ORIGIN: ../../../flutter/third_party/accessibility/ax/platform/test_ax_node_wrapper.h + ../../../flutter/third_party/accessibility/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/fuzz/decode_fuzzer.c + ../../../LICENSE TYPE: LicenseType.bsd FILE: ../../../flutter/third_party/accessibility/ax/ax_tree_data.cc FILE: ../../../flutter/third_party/accessibility/ax/ax_tree_data.h @@ -49060,6 +49342,7 @@ FILE: ../../../flutter/third_party/accessibility/ax/platform/ax_platform_node_wi FILE: ../../../flutter/third_party/accessibility/ax/platform/ax_platform_node_win.h FILE: ../../../flutter/third_party/accessibility/ax/platform/test_ax_node_wrapper.cc FILE: ../../../flutter/third_party/accessibility/ax/platform/test_ax_node_wrapper.h +FILE: ../../../flutter/third_party/brotli/c/fuzz/decode_fuzzer.c ---------------------------------------------------------------------------------------------------- Copyright 2015 The Chromium Authors. All rights reserved. @@ -49125,6 +49408,51 @@ OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ==================================================================================================== +==================================================================================================== +LIBRARY: brotli +ORIGIN: ../../../flutter/third_party/brotli/c/common/constants.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/common/platform.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/common/platform.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/common/version.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/hash_forgetful_chain_inc.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/hash_to_binary_tree_inc.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/memory.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/quality.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/fuzz/run_decode_fuzzer.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/include/brotli/port.h + ../../../flutter/third_party/brotli/LICENSE +TYPE: LicenseType.mit +FILE: ../../../flutter/third_party/brotli/c/common/constants.h +FILE: ../../../flutter/third_party/brotli/c/common/platform.c +FILE: ../../../flutter/third_party/brotli/c/common/platform.h +FILE: ../../../flutter/third_party/brotli/c/common/version.h +FILE: ../../../flutter/third_party/brotli/c/enc/hash_forgetful_chain_inc.h +FILE: ../../../flutter/third_party/brotli/c/enc/hash_to_binary_tree_inc.h +FILE: ../../../flutter/third_party/brotli/c/enc/memory.h +FILE: ../../../flutter/third_party/brotli/c/enc/quality.h +FILE: ../../../flutter/third_party/brotli/c/fuzz/run_decode_fuzzer.c +FILE: ../../../flutter/third_party/brotli/c/include/brotli/port.h +---------------------------------------------------------------------------------------------------- +Copyright 2016 Google Inc. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +==================================================================================================== + ==================================================================================================== LIBRARY: libwebp ORIGIN: ../../../flutter/third_party/libwebp/extras/get_disto.c + ../../../flutter/third_party/libwebp/COPYING @@ -49739,6 +50067,47 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: brotli +ORIGIN: ../../../flutter/third_party/brotli/c/common/shared_dictionary.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/common/shared_dictionary_internal.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/compound_dictionary.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/compound_dictionary.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/encoder_dict.c + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/encoder_dict.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/params.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/include/brotli/shared_dictionary.h + ../../../flutter/third_party/brotli/LICENSE +TYPE: LicenseType.mit +FILE: ../../../flutter/third_party/brotli/c/common/shared_dictionary.c +FILE: ../../../flutter/third_party/brotli/c/common/shared_dictionary_internal.h +FILE: ../../../flutter/third_party/brotli/c/enc/compound_dictionary.c +FILE: ../../../flutter/third_party/brotli/c/enc/compound_dictionary.h +FILE: ../../../flutter/third_party/brotli/c/enc/encoder_dict.c +FILE: ../../../flutter/third_party/brotli/c/enc/encoder_dict.h +FILE: ../../../flutter/third_party/brotli/c/enc/params.h +FILE: ../../../flutter/third_party/brotli/c/include/brotli/shared_dictionary.h +---------------------------------------------------------------------------------------------------- +Copyright 2017 Google Inc. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +==================================================================================================== + ==================================================================================================== LIBRARY: libwebp ORIGIN: ../../../flutter/third_party/libwebp/extras/vwebp_sdl.c + ../../../flutter/third_party/libwebp/COPYING @@ -50225,6 +50594,35 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: brotli +ORIGIN: ../../../flutter/third_party/brotli/c/enc/hash_composite_inc.h + ../../../flutter/third_party/brotli/LICENSE +ORIGIN: ../../../flutter/third_party/brotli/c/enc/hash_rolling_inc.h + ../../../flutter/third_party/brotli/LICENSE +TYPE: LicenseType.mit +FILE: ../../../flutter/third_party/brotli/c/enc/hash_composite_inc.h +FILE: ../../../flutter/third_party/brotli/c/enc/hash_rolling_inc.h +---------------------------------------------------------------------------------------------------- +Copyright 2018 Google Inc. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +==================================================================================================== + ==================================================================================================== LIBRARY: libwebp ORIGIN: ../../../flutter/third_party/libwebp/src/dsp/cost_neon.c + ../../../flutter/third_party/libwebp/COPYING @@ -53073,6 +53471,33 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: brotli +ORIGIN: ../../../flutter/third_party/brotli/c/enc/state.h + ../../../flutter/third_party/brotli/LICENSE +TYPE: LicenseType.mit +FILE: ../../../flutter/third_party/brotli/c/enc/state.h +---------------------------------------------------------------------------------------------------- +Copyright 2022 Google Inc. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +==================================================================================================== + ==================================================================================================== LIBRARY: libwebp ORIGIN: ../../../flutter/third_party/libwebp/sharpyuv/sharpyuv.c + ../../../flutter/third_party/libwebp/COPYING @@ -71010,4 +71435,4 @@ freely, subject to the following restrictions: 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 909 +Total license count: 918 diff --git a/engine/src/flutter/ci/licenses_golden/tool_signature b/engine/src/flutter/ci/licenses_golden/tool_signature index abb989ef90..800d7abe31 100644 --- a/engine/src/flutter/ci/licenses_golden/tool_signature +++ b/engine/src/flutter/ci/licenses_golden/tool_signature @@ -1,2 +1,2 @@ -Signature: dbe5e49be0f842a35b32e2e3ecfff7a6 +Signature: e2ff885216f18058fdca914a1cc4149c diff --git a/engine/src/flutter/lib/web_ui/dev/roll_fallback_fonts.dart b/engine/src/flutter/lib/web_ui/dev/roll_fallback_fonts.dart index bdec667f55..3cc7af2f79 100644 --- a/engine/src/flutter/lib/web_ui/dev/roll_fallback_fonts.dart +++ b/engine/src/flutter/lib/web_ui/dev/roll_fallback_fonts.dart @@ -9,6 +9,8 @@ import 'dart:typed_data'; import 'package:args/command_runner.dart'; import 'package:convert/convert.dart'; import 'package:crypto/crypto.dart' as crypto; +import 'package:csslib/parser.dart' as csslib; +import 'package:csslib/visitor.dart' show StyleSheet, UriTerm, Visitor; import 'package:http/http.dart' as http; import 'package:path/path.dart' as path; @@ -58,29 +60,12 @@ class RollFallbackFontsCommand extends Command } Future _generateFallbackFontData() async { - if (apiKey.isEmpty) { - throw UsageException('No Google Fonts API key provided', argParser.usage); - } final http.Client client = http.Client(); - final http.Response response = await client.get(Uri.parse( - 'https://www.googleapis.com/webfonts/v1/webfonts?key=$apiKey')); - if (response.statusCode != 200) { - throw ToolExit('Failed to download Google Fonts list.'); - } - final Map googleFontsResult = - jsonDecode(response.body) as Map; - final List> fontDatas = - (googleFontsResult['items'] as List) - .cast>(); + final List fallbackFonts = []; final Map urlForFamily = {}; - for (final Map fontData in fontDatas) { - if (fallbackFonts.contains(fontData['family'])) { - final files = fontData['files']! as Map; - final Uri uri = Uri.parse(files['regular']! as String) - .replace(scheme: 'https'); - urlForFamily[fontData['family']! as String] = uri; - } - } + await _addApiFallbackFonts(client, fallbackFonts, urlForFamily); + await _addSplitFallbackFonts(client, fallbackFonts, urlForFamily); + final Map charsetForFamily = {}; final io.Directory fontDir = await io.Directory.systemTemp.createTemp('flutter_fallback_fonts'); print('Downloading fonts into temp directory: ${fontDir.path}'); @@ -106,7 +91,7 @@ class RollFallbackFontsCommand extends Command io.File(path.join(fontDir.path, urlSuffix)); final Uint8List bodyBytes = fontResponse.bodyBytes; - if (!_checkForLicenseAttribution(bodyBytes)) { + if (!await _checkForLicenseAttribution(client, urlSuffix, bodyBytes)) { throw ToolExit( 'Expected license attribution not found in file: $urlString'); } @@ -159,24 +144,17 @@ class RollFallbackFontsCommand extends Command sb.writeln('// dev/roll_fallback_fonts.dart'); sb.writeln("import 'noto_font.dart';"); sb.writeln(); - sb.writeln('List getFallbackFontList(bool useColorEmoji) => ['); + sb.writeln('List getFallbackFontList() => ['); for (final _Font font in fonts) { final String family = font.family; - String enabledArgument = ''; - if (family == 'Noto Emoji') { - enabledArgument = 'enabled: !useColorEmoji, '; - } - if (family == 'Noto Color Emoji') { - enabledArgument = 'enabled: useColorEmoji, '; - } final String urlString = urlForFamily[family]!.toString(); if (!urlString.startsWith(expectedUrlPrefix)) { throw ToolExit( 'Unexpected url format received from Google Fonts API: $urlString.'); } final String urlSuffix = urlString.substring(expectedUrlPrefix.length); - sb.writeln(" NotoFont('$family', $enabledArgument'$urlSuffix'),"); + sb.writeln(" NotoFont('$family', '$urlSuffix'),"); } sb.writeln('];'); sb.writeln(); @@ -328,12 +306,80 @@ OTHER DEALINGS IN THE FONT SOFTWARE. '--deps-file=$depFilePath' ]); } + + Future _addApiFallbackFonts( + http.Client client, + List fallbackFonts, + Map urlForFamily, + ) async { + if (apiKey.isEmpty) { + throw UsageException('No Google Fonts API key provided', argParser.usage); + } + final http.Response response = await client.get(Uri.parse( + 'https://www.googleapis.com/webfonts/v1/webfonts?key=$apiKey')); + if (response.statusCode != 200) { + throw ToolExit('Failed to download Google Fonts list.'); + } + final Map googleFontsResult = + jsonDecode(response.body) as Map; + final List> fontDatas = + (googleFontsResult['items'] as List) + .cast>(); + for (final Map fontData in fontDatas) { + final String family = fontData['family']! as String; + if (apiFallbackFonts.contains(family)) { + final files = fontData['files']! as Map; + final Uri uri = Uri.parse(files['regular']! as String) + .replace(scheme: 'https'); + urlForFamily[family] = uri; + fallbackFonts.add(family); + } + } + } + + Future _addSplitFallbackFonts( + http.Client client, + List fallbackFonts, + Map urlForFamily, + ) async { + for (final String font in splitFallbackFonts) { + final String modifiedFontName = font.replaceAll(' ', '+'); + final Uri cssUri = Uri.parse( + 'https://fonts.googleapis.com/css2?family=$modifiedFontName'); + final http.Response response = + await client.get(cssUri, headers: { + // Spoof the User-Agent so Google Fonts serves WOFF2 fonts + 'User-Agent': + 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) ' + 'Chrome/112.0.0.0 Safari/537.36' + }); + final String cssString = response.body; + final StyleSheet stylesheet = csslib.parse(cssString); + final UriCollector uriCollector = UriCollector(); + stylesheet.visit(uriCollector); + int familyCount = 0; + for (final Uri uri in uriCollector.uris) { + final String fontName = '$font $familyCount'; + fallbackFonts.add(fontName); + urlForFamily[fontName] = uri; + familyCount += 1; + } + } + } } -const List fallbackFonts = [ +class UriCollector extends Visitor { + final List uris = []; + + @override + void visitUriTerm(UriTerm uriTerm) { + uris.add(Uri.parse(uriTerm.value as String)); + } +} + +/// Fonts that should be downloaded directly from the Google Fonts API. +const List apiFallbackFonts = [ 'Noto Sans', - 'Noto Color Emoji', - 'Noto Emoji', 'Noto Music', 'Noto Sans Symbols', 'Noto Sans Symbols 2', @@ -478,24 +524,31 @@ const List fallbackFonts = [ 'Noto Serif Tibetan', ]; -bool _checkForLicenseAttribution(Uint8List fontBytes) { - final ByteData fontData = fontBytes.buffer.asByteData(); - final int codePointCount = fontData.lengthInBytes ~/ 2; +/// Fonts which are split up into several smaller subfonts. These need special +/// handling. +const List splitFallbackFonts = [ + 'Noto Color Emoji', +]; + +Future _checkForLicenseAttribution( + http.Client client, + String urlSuffix, + Uint8List fontBytes, +) async { + const String googleFontsUpstream = + 'https://github.com/google/fonts/tree/main/ofl'; const String attributionString = 'This Font Software is licensed under the SIL Open Font License, Version 1.1.'; - for (int i = 0; i < codePointCount - attributionString.length; i++) { - bool match = true; - for (int j = 0; j < attributionString.length; j++) { - if (fontData.getUint16((i + j) * 2) != attributionString.codeUnitAt(j)) { - match = false; - break; - } - } - if (match) { - return true; - } + + final String fontPackageName = urlSuffix.split('/').first; + final String fontLicenseUrl = '$googleFontsUpstream/$fontPackageName/OFL.txt'; + final http.Response response = await client.get(Uri.parse(fontLicenseUrl)); + if (response.statusCode != 200) { + throw ToolExit('Failed to download `$fontPackageName` license at $fontLicenseUrl'); } - return false; + final String licenseString = response.body; + + return licenseString.contains(attributionString); } class _Font { diff --git a/engine/src/flutter/lib/web_ui/dev/test_platform.dart b/engine/src/flutter/lib/web_ui/dev/test_platform.dart index d2bae4ec18..88a633f497 100644 --- a/engine/src/flutter/lib/web_ui/dev/test_platform.dart +++ b/engine/src/flutter/lib/web_ui/dev/test_platform.dart @@ -572,8 +572,6 @@ class BrowserPlatform extends PlatformPlugin {