From 47a710ba990f4c0a7079297997dd222e353bf0d0 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Tue, 4 Mar 2025 16:13:40 +0000 Subject: [PATCH] Move flutter/third_party/txt into flutter/txt (#164248) The flutter/txt library does not currently contain any third-party code. --- engine/src/flutter/.clang-tidy | 2 +- engine/src/flutter/BUILD.gn | 4 +- .../ci/builders/linux_host_engine_test.json | 2 +- .../builders/standalone/linux_benchmarks.json | 2 +- engine/src/flutter/ci/licenses.sh | 1 - .../flutter/ci/licenses_golden/excluded_files | 10 +- .../ci/licenses_golden/licenses_flutter | 178 +++++++++--------- .../flutter/ci/licenses_golden/tool_signature | 2 +- engine/src/flutter/display_list/BUILD.gn | 5 +- .../src/flutter/display_list/testing/BUILD.gn | 2 +- engine/src/flutter/flow/BUILD.gn | 5 +- .../flutter/flow/flow_run_all_unittests.cc | 3 +- .../flutter/impeller/display_list/BUILD.gn | 4 +- engine/src/flutter/impeller/entity/BUILD.gn | 2 +- engine/src/flutter/impeller/fixtures/BUILD.gn | 10 +- .../flutter/impeller/renderer/render_pass.cc | 16 +- .../flutter/impeller/toolkit/interop/BUILD.gn | 2 +- .../impeller/toolkit/interop/formats.h | 6 +- .../impeller/toolkit/interop/paragraph.h | 2 +- .../toolkit/interop/paragraph_builder.cc | 2 +- .../toolkit/interop/paragraph_builder.h | 2 +- .../toolkit/interop/paragraph_style.h | 2 +- .../toolkit/interop/typography_context.cc | 2 +- .../toolkit/interop/typography_context.h | 2 +- .../src/flutter/impeller/typographer/BUILD.gn | 2 +- engine/src/flutter/lib/ui/BUILD.gn | 4 +- engine/src/flutter/lib/ui/text/paragraph.h | 2 +- .../flutter/lib/ui/text/paragraph_builder.cc | 12 +- .../flutter/lib/ui/text/paragraph_builder.h | 2 +- .../web_ui/dev/steps/copy_artifacts_step.dart | 1 - engine/src/flutter/runtime/BUILD.gn | 4 +- engine/src/flutter/shell/common/BUILD.gn | 4 +- .../flutter/shell/platform/android/BUILD.gn | 2 +- .../platform_view_android_delegate/BUILD.gn | 2 +- .../shell/platform/darwin/ios/BUILD.gn | 2 +- .../shell/platform/fuchsia/flutter/BUILD.gn | 14 +- engine/src/flutter/testing/dart/BUILD.gn | 2 +- .../src/flutter/testing/dart/canvas_test.dart | 4 +- .../IosUnitTests.xcodeproj/project.pbxproj | 4 +- engine/src/flutter/testing/run_tests.py | 2 +- .../txt/src/txt/font_asset_provider.cc | 36 ---- .../txt/src/txt/font_asset_provider.h | 40 ---- .../third_party/txt/src/txt/font_features.cc | 55 ------ .../third_party/txt/src/txt/font_features.h | 54 ------ .../third_party/txt/src/txt/font_style.h | 29 --- .../third_party/txt/src/txt/font_weight.h | 36 ---- .../txt/src/txt/placeholder_run.cc | 34 ---- .../third_party/txt/src/txt/text_baseline.h | 29 --- .../txt/src/txt/text_decoration.cc | 26 --- .../third_party/txt/src/txt/text_decoration.h | 35 ---- .../third_party/txt/src/txt/text_shadow.cc | 50 ----- .../third_party/txt/src/txt/text_shadow.h | 44 ----- .../third_party/txt/src/txt/text_style.cc | 74 -------- .../txt/tests/txt_run_all_unittests.cc | 24 --- .../third_party/txt/tests/txt_test_utils.cc | 31 --- .../third_party/txt/tests/txt_test_utils.h | 30 --- .../src/flutter/tools/licenses/lib/paths.dart | 2 +- .../{third_party => }/txt/.clang-format | 0 .../{third_party => }/txt/.gitattributes | 0 .../flutter/{third_party => }/txt/.gitignore | 0 .../flutter/{third_party => }/txt/BUILD.gn | 16 +- .../txt/benchmarks/skparagraph_benchmarks.cc | 59 +++--- .../txt/benchmarks/txt_run_all_benchmarks.cc | 20 +- .../txt/src/skia/paragraph_builder_skia.cc | 20 +- .../txt/src/skia/paragraph_builder_skia.h | 26 +-- .../txt/src/skia/paragraph_skia.cc | 20 +- .../txt/src/skia/paragraph_skia.h | 24 +-- .../txt/src/txt/asset_font_manager.cc | 21 +-- .../txt/src/txt/asset_font_manager.h | 24 +-- .../txt/src/txt/font_asset_provider.cc | 24 +++ .../flutter/txt/src/txt/font_asset_provider.h | 28 +++ .../txt/src/txt/font_collection.cc | 38 ++-- .../txt/src/txt/font_collection.h | 24 +-- .../src/flutter/txt/src/txt/font_features.cc | 44 +++++ .../src/flutter/txt/src/txt/font_features.h | 42 +++++ engine/src/flutter/txt/src/txt/font_style.h | 19 ++ engine/src/flutter/txt/src/txt/font_weight.h | 26 +++ .../txt/src/txt/line_metrics.h | 24 +-- .../{third_party => }/txt/src/txt/paragraph.h | 26 +-- .../txt/src/txt/paragraph_builder.cc | 22 +-- .../txt/src/txt/paragraph_builder.h | 26 +-- .../txt/src/txt/paragraph_style.cc | 18 +- .../txt/src/txt/paragraph_style.h | 28 +-- .../flutter/txt/src/txt/placeholder_run.cc | 22 +++ .../txt/src/txt/placeholder_run.h | 24 +-- .../{third_party => }/txt/src/txt/platform.cc | 0 .../{third_party => }/txt/src/txt/platform.h | 6 +- .../txt/src/txt/platform_android.cc | 0 .../txt/src/txt/platform_fuchsia.cc | 0 .../txt/src/txt/platform_linux.cc | 0 .../txt/src/txt/platform_mac.h | 6 +- .../txt/src/txt/platform_mac.mm | 0 .../txt/src/txt/platform_windows.cc | 0 .../txt/src/txt/run_metrics.h | 24 +-- .../txt/src/txt/test_font_manager.cc | 20 +- .../txt/src/txt/test_font_manager.h | 24 +-- .../src/flutter/txt/src/txt/text_baseline.h | 17 ++ .../flutter/txt/src/txt/text_decoration.cc | 14 ++ .../src/flutter/txt/src/txt/text_decoration.h | 23 +++ engine/src/flutter/txt/src/txt/text_shadow.cc | 43 +++++ engine/src/flutter/txt/src/txt/text_shadow.h | 32 ++++ engine/src/flutter/txt/src/txt/text_style.cc | 81 ++++++++ .../txt/src/txt/text_style.h | 24 +-- .../src/txt/typeface_font_asset_provider.cc | 22 +-- .../src/txt/typeface_font_asset_provider.h | 26 +-- .../txt/tests/font_collection_tests.cc | 18 +- .../txt/tests/paragraph_builder_skia_tests.cc | 18 +- .../txt/tests/paragraph_unittests.cc | 11 +- .../txt/tests/platform_mac_tests.cc | 0 .../txt/tests/txt_run_all_unittests.cc | 12 ++ .../src/flutter/txt/tests/txt_test_utils.cc | 19 ++ engine/src/flutter/txt/tests/txt_test_utils.h | 18 ++ .../txt/third_party/fonts/HomemadeApple.ttf | Bin .../txt/third_party/fonts/NotoColorEmoji.ttf | Bin .../fonts/NotoNaskhArabic-Regular.ttf | Bin .../txt/third_party/fonts/Roboto-Medium.ttf | Bin .../txt/third_party/fonts/Roboto-Regular.ttf | Bin .../fonts/RobotoSlab-VariableFont_wght.ttf | Bin .../txt/third_party/fonts/ahem.ttf | Bin 119 files changed, 806 insertions(+), 1277 deletions(-) delete mode 100644 engine/src/flutter/third_party/txt/src/txt/font_asset_provider.cc delete mode 100644 engine/src/flutter/third_party/txt/src/txt/font_asset_provider.h delete mode 100644 engine/src/flutter/third_party/txt/src/txt/font_features.cc delete mode 100644 engine/src/flutter/third_party/txt/src/txt/font_features.h delete mode 100644 engine/src/flutter/third_party/txt/src/txt/font_style.h delete mode 100644 engine/src/flutter/third_party/txt/src/txt/font_weight.h delete mode 100644 engine/src/flutter/third_party/txt/src/txt/placeholder_run.cc delete mode 100644 engine/src/flutter/third_party/txt/src/txt/text_baseline.h delete mode 100644 engine/src/flutter/third_party/txt/src/txt/text_decoration.cc delete mode 100644 engine/src/flutter/third_party/txt/src/txt/text_decoration.h delete mode 100644 engine/src/flutter/third_party/txt/src/txt/text_shadow.cc delete mode 100644 engine/src/flutter/third_party/txt/src/txt/text_shadow.h delete mode 100644 engine/src/flutter/third_party/txt/src/txt/text_style.cc delete mode 100644 engine/src/flutter/third_party/txt/tests/txt_run_all_unittests.cc delete mode 100644 engine/src/flutter/third_party/txt/tests/txt_test_utils.cc delete mode 100644 engine/src/flutter/third_party/txt/tests/txt_test_utils.h rename engine/src/flutter/{third_party => }/txt/.clang-format (100%) rename engine/src/flutter/{third_party => }/txt/.gitattributes (100%) rename engine/src/flutter/{third_party => }/txt/.gitignore (100%) rename engine/src/flutter/{third_party => }/txt/BUILD.gn (88%) rename engine/src/flutter/{third_party => }/txt/benchmarks/skparagraph_benchmarks.cc (86%) rename engine/src/flutter/{third_party => }/txt/benchmarks/txt_run_all_benchmarks.cc (56%) rename engine/src/flutter/{third_party => }/txt/src/skia/paragraph_builder_skia.cc (92%) rename engine/src/flutter/{third_party => }/txt/src/skia/paragraph_builder_skia.h (71%) rename engine/src/flutter/{third_party => }/txt/src/skia/paragraph_skia.cc (96%) rename engine/src/flutter/{third_party => }/txt/src/skia/paragraph_skia.h (75%) rename engine/src/flutter/{third_party => }/txt/src/txt/asset_font_manager.cc (79%) rename engine/src/flutter/{third_party => }/txt/src/txt/asset_font_manager.h (76%) create mode 100644 engine/src/flutter/txt/src/txt/font_asset_provider.cc create mode 100644 engine/src/flutter/txt/src/txt/font_asset_provider.h rename engine/src/flutter/{third_party => }/txt/src/txt/font_collection.cc (75%) rename engine/src/flutter/{third_party => }/txt/src/txt/font_collection.h (71%) create mode 100644 engine/src/flutter/txt/src/txt/font_features.cc create mode 100644 engine/src/flutter/txt/src/txt/font_features.h create mode 100644 engine/src/flutter/txt/src/txt/font_style.h create mode 100644 engine/src/flutter/txt/src/txt/font_weight.h rename engine/src/flutter/{third_party => }/txt/src/txt/line_metrics.h (75%) rename engine/src/flutter/{third_party => }/txt/src/txt/paragraph.h (90%) rename engine/src/flutter/{third_party => }/txt/src/txt/paragraph_builder.cc (53%) rename engine/src/flutter/{third_party => }/txt/src/txt/paragraph_builder.h (73%) rename engine/src/flutter/{third_party => }/txt/src/txt/paragraph_style.cc (65%) rename engine/src/flutter/{third_party => }/txt/src/txt/paragraph_style.h (78%) create mode 100644 engine/src/flutter/txt/src/txt/placeholder_run.cc rename engine/src/flutter/{third_party => }/txt/src/txt/placeholder_run.h (76%) rename engine/src/flutter/{third_party => }/txt/src/txt/platform.cc (100%) rename engine/src/flutter/{third_party => }/txt/src/txt/platform.h (78%) rename engine/src/flutter/{third_party => }/txt/src/txt/platform_android.cc (100%) rename engine/src/flutter/{third_party => }/txt/src/txt/platform_fuchsia.cc (100%) rename engine/src/flutter/{third_party => }/txt/src/txt/platform_linux.cc (100%) rename engine/src/flutter/{third_party => }/txt/src/txt/platform_mac.h (73%) rename engine/src/flutter/{third_party => }/txt/src/txt/platform_mac.mm (100%) rename engine/src/flutter/{third_party => }/txt/src/txt/platform_windows.cc (100%) rename engine/src/flutter/{third_party => }/txt/src/txt/run_metrics.h (65%) rename engine/src/flutter/{third_party => }/txt/src/txt/test_font_manager.cc (57%) rename engine/src/flutter/{third_party => }/txt/src/txt/test_font_manager.h (52%) create mode 100644 engine/src/flutter/txt/src/txt/text_baseline.h create mode 100644 engine/src/flutter/txt/src/txt/text_decoration.cc create mode 100644 engine/src/flutter/txt/src/txt/text_decoration.h create mode 100644 engine/src/flutter/txt/src/txt/text_shadow.cc create mode 100644 engine/src/flutter/txt/src/txt/text_shadow.h create mode 100644 engine/src/flutter/txt/src/txt/text_style.cc rename engine/src/flutter/{third_party => }/txt/src/txt/text_style.h (71%) rename engine/src/flutter/{third_party => }/txt/src/txt/typeface_font_asset_provider.cc (79%) rename engine/src/flutter/{third_party => }/txt/src/txt/typeface_font_asset_provider.h (66%) rename engine/src/flutter/{third_party => }/txt/tests/font_collection_tests.cc (55%) rename engine/src/flutter/{third_party => }/txt/tests/paragraph_builder_skia_tests.cc (56%) rename engine/src/flutter/{third_party => }/txt/tests/paragraph_unittests.cc (97%) rename engine/src/flutter/{third_party => }/txt/tests/platform_mac_tests.cc (100%) create mode 100644 engine/src/flutter/txt/tests/txt_run_all_unittests.cc create mode 100644 engine/src/flutter/txt/tests/txt_test_utils.cc create mode 100644 engine/src/flutter/txt/tests/txt_test_utils.h rename engine/src/flutter/{third_party => }/txt/third_party/fonts/HomemadeApple.ttf (100%) rename engine/src/flutter/{third_party => }/txt/third_party/fonts/NotoColorEmoji.ttf (100%) rename engine/src/flutter/{third_party => }/txt/third_party/fonts/NotoNaskhArabic-Regular.ttf (100%) rename engine/src/flutter/{third_party => }/txt/third_party/fonts/Roboto-Medium.ttf (100%) rename engine/src/flutter/{third_party => }/txt/third_party/fonts/Roboto-Regular.ttf (100%) rename engine/src/flutter/{third_party => }/txt/third_party/fonts/RobotoSlab-VariableFont_wght.ttf (100%) rename engine/src/flutter/{third_party => }/txt/third_party/fonts/ahem.ttf (100%) diff --git a/engine/src/flutter/.clang-tidy b/engine/src/flutter/.clang-tidy index c22fc34772..fe6bc371e3 100644 --- a/engine/src/flutter/.clang-tidy +++ b/engine/src/flutter/.clang-tidy @@ -60,4 +60,4 @@ CheckOptions: # updated. # # tl;dr: I'm sorry. -HeaderFilterRegex: "[..\/]+\/flutter\/(assets|benchmarking|bin|build|ci|common|display_list|docs|examples|flow|flutter_frontend_server|flutter_vma|fml|impeller|lib|runtime|shell|skia|sky|testing|tools|vulkan|wasm|web_sdk)\/.*" +HeaderFilterRegex: "[..\/]+\/flutter\/(assets|benchmarking|bin|build|ci|common|display_list|docs|examples|flow|flutter_frontend_server|flutter_vma|fml|impeller|lib|runtime|shell|skia|sky|testing|tools|txt|vulkan|wasm|web_sdk)\/.*" diff --git a/engine/src/flutter/BUILD.gn b/engine/src/flutter/BUILD.gn index ac36e26ad0..8a854b24e0 100644 --- a/engine/src/flutter/BUILD.gn +++ b/engine/src/flutter/BUILD.gn @@ -149,7 +149,7 @@ group("flutter") { "//flutter/impeller/geometry:geometry_benchmarks", "//flutter/lib/ui:ui_benchmarks", "//flutter/shell/common:shell_benchmarks", - "//flutter/third_party/txt:txt_benchmarks", + "//flutter/txt:txt_benchmarks", ] } @@ -200,7 +200,7 @@ group("unittests") { "//flutter/testing/dart", "//flutter/testing/smoke_test_failure", "//flutter/third_party/tonic/tests:tonic_unittests", - "//flutter/third_party/txt:txt_unittests", + "//flutter/txt:txt_unittests", ] # The accessibility library only supports Mac and Windows at the moment. diff --git a/engine/src/flutter/ci/builders/linux_host_engine_test.json b/engine/src/flutter/ci/builders/linux_host_engine_test.json index 779e569cd3..bb135c71ab 100644 --- a/engine/src/flutter/ci/builders/linux_host_engine_test.json +++ b/engine/src/flutter/ci/builders/linux_host_engine_test.json @@ -140,7 +140,7 @@ "flutter/shell/common:shell_benchmarks", "flutter/shell/testing", "flutter/tools/path_ops", - "flutter/third_party/txt:txt_benchmarks" + "flutter/txt:txt_benchmarks" ] }, "tests": [ diff --git a/engine/src/flutter/ci/builders/standalone/linux_benchmarks.json b/engine/src/flutter/ci/builders/standalone/linux_benchmarks.json index 442cbf5ca9..6a6a896e2a 100644 --- a/engine/src/flutter/ci/builders/standalone/linux_benchmarks.json +++ b/engine/src/flutter/ci/builders/standalone/linux_benchmarks.json @@ -33,7 +33,7 @@ "flutter/lib/ui:ui_benchmarks", "flutter/shell/common:shell_benchmarks", "flutter/shell/testing", - "flutter/third_party/txt:txt_benchmarks", + "flutter/txt:txt_benchmarks", "flutter/tools/path_ops", "flutter/build/archives:flutter_patched_sdk", "flutter:unittests" diff --git a/engine/src/flutter/ci/licenses.sh b/engine/src/flutter/ci/licenses.sh index e6f058218b..79b3e97932 100755 --- a/engine/src/flutter/ci/licenses.sh +++ b/engine/src/flutter/ci/licenses.sh @@ -183,7 +183,6 @@ function verify_licenses() ( echo "double-check that all newly added files have a BSD-style license" echo "header with the following copyright:" echo " Copyright 2013 The Flutter Authors. All rights reserved." - echo "Files in 'third_party/txt' may have an Apache license header instead." echo "If you're absolutely sure that the change in license count is" echo "intentional, update 'flutter/ci/licenses.sh' with the new count." echo "=================================================================" diff --git a/engine/src/flutter/ci/licenses_golden/excluded_files b/engine/src/flutter/ci/licenses_golden/excluded_files index b0abcaa9ed..9f5b8bd016 100644 --- a/engine/src/flutter/ci/licenses_golden/excluded_files +++ b/engine/src/flutter/ci/licenses_golden/excluded_files @@ -3030,11 +3030,6 @@ ../../../flutter/third_party/tonic/filesystem/README.md ../../../flutter/third_party/tonic/filesystem/tests ../../../flutter/third_party/tonic/tests -../../../flutter/third_party/txt/.clang-format -../../../flutter/third_party/txt/.gitattributes -../../../flutter/third_party/txt/.gitignore -../../../flutter/third_party/txt/tests -../../../flutter/third_party/txt/third_party/fonts ../../../flutter/third_party/vulkan-deps/.git ../../../flutter/third_party/vulkan-deps/.gitattributes ../../../flutter/third_party/vulkan-deps/.gitignore @@ -3322,6 +3317,11 @@ ../../../flutter/tools/licenses/lib/README ../../../flutter/tools/licenses/pubspec.yaml ../../../flutter/tools/licenses/test +../../../flutter/txt/.clang-format +../../../flutter/txt/.gitattributes +../../../flutter/txt/.gitignore +../../../flutter/txt/tests +../../../flutter/txt/third_party/fonts ../../../flutter/web_sdk ../../../fuchsia/sdk/linux/.build-id ../../../fuchsia/sdk/linux/.versions diff --git a/engine/src/flutter/ci/licenses_golden/licenses_flutter b/engine/src/flutter/ci/licenses_golden/licenses_flutter index 46fe4f69a9..68c620e707 100644 --- a/engine/src/flutter/ci/licenses_golden/licenses_flutter +++ b/engine/src/flutter/ci/licenses_golden/licenses_flutter @@ -959,7 +959,6 @@ LIBRARY: perfetto LIBRARY: shaderc LIBRARY: spirv-cross LIBRARY: swiftshader -LIBRARY: txt LIBRARY: vulkan-headers LIBRARY: vulkan-utility-libraries LIBRARY: vulkan-validation-layers @@ -2319,42 +2318,6 @@ ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutte ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/swiftshader/src/WSI/libWaylandClient.hpp ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/swiftshader/src/WSI/libXCB.cpp ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/swiftshader/src/WSI/libXCB.hpp -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/benchmarks/skparagraph_benchmarks.cc -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/benchmarks/txt_run_all_benchmarks.cc -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/skia/paragraph_builder_skia.cc -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/skia/paragraph_builder_skia.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/skia/paragraph_skia.cc -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/skia/paragraph_skia.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/asset_font_manager.cc -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/asset_font_manager.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/font_asset_provider.cc -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/font_asset_provider.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/font_collection.cc -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/font_collection.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/font_features.cc -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/font_features.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/font_style.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/font_weight.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/line_metrics.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/paragraph.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/paragraph_builder.cc -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/paragraph_builder.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/paragraph_style.cc -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/paragraph_style.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/placeholder_run.cc -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/placeholder_run.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/run_metrics.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/test_font_manager.cc -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/test_font_manager.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/text_baseline.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/text_decoration.cc -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/text_decoration.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/text_shadow.cc -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/text_shadow.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/text_style.cc -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/text_style.h -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/typeface_font_asset_provider.cc -ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/txt/src/txt/typeface_font_asset_provider.h ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/vulkan-deps/glslang/src/SPIRV/bitutils.h ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/vulkan-deps/glslang/src/SPIRV/hex_float.h ORIGIN: http://www.apache.org/licenses/LICENSE-2.0 referenced by ../../../flutter/third_party/vulkan-deps/glslang/src/gtests/Common.cpp @@ -7079,42 +7042,6 @@ FILE: ../../../flutter/third_party/swiftshader/src/WSI/libWaylandClient.cpp FILE: ../../../flutter/third_party/swiftshader/src/WSI/libWaylandClient.hpp FILE: ../../../flutter/third_party/swiftshader/src/WSI/libXCB.cpp FILE: ../../../flutter/third_party/swiftshader/src/WSI/libXCB.hpp -FILE: ../../../flutter/third_party/txt/benchmarks/skparagraph_benchmarks.cc -FILE: ../../../flutter/third_party/txt/benchmarks/txt_run_all_benchmarks.cc -FILE: ../../../flutter/third_party/txt/src/skia/paragraph_builder_skia.cc -FILE: ../../../flutter/third_party/txt/src/skia/paragraph_builder_skia.h -FILE: ../../../flutter/third_party/txt/src/skia/paragraph_skia.cc -FILE: ../../../flutter/third_party/txt/src/skia/paragraph_skia.h -FILE: ../../../flutter/third_party/txt/src/txt/asset_font_manager.cc -FILE: ../../../flutter/third_party/txt/src/txt/asset_font_manager.h -FILE: ../../../flutter/third_party/txt/src/txt/font_asset_provider.cc -FILE: ../../../flutter/third_party/txt/src/txt/font_asset_provider.h -FILE: ../../../flutter/third_party/txt/src/txt/font_collection.cc -FILE: ../../../flutter/third_party/txt/src/txt/font_collection.h -FILE: ../../../flutter/third_party/txt/src/txt/font_features.cc -FILE: ../../../flutter/third_party/txt/src/txt/font_features.h -FILE: ../../../flutter/third_party/txt/src/txt/font_style.h -FILE: ../../../flutter/third_party/txt/src/txt/font_weight.h -FILE: ../../../flutter/third_party/txt/src/txt/line_metrics.h -FILE: ../../../flutter/third_party/txt/src/txt/paragraph.h -FILE: ../../../flutter/third_party/txt/src/txt/paragraph_builder.cc -FILE: ../../../flutter/third_party/txt/src/txt/paragraph_builder.h -FILE: ../../../flutter/third_party/txt/src/txt/paragraph_style.cc -FILE: ../../../flutter/third_party/txt/src/txt/paragraph_style.h -FILE: ../../../flutter/third_party/txt/src/txt/placeholder_run.cc -FILE: ../../../flutter/third_party/txt/src/txt/placeholder_run.h -FILE: ../../../flutter/third_party/txt/src/txt/run_metrics.h -FILE: ../../../flutter/third_party/txt/src/txt/test_font_manager.cc -FILE: ../../../flutter/third_party/txt/src/txt/test_font_manager.h -FILE: ../../../flutter/third_party/txt/src/txt/text_baseline.h -FILE: ../../../flutter/third_party/txt/src/txt/text_decoration.cc -FILE: ../../../flutter/third_party/txt/src/txt/text_decoration.h -FILE: ../../../flutter/third_party/txt/src/txt/text_shadow.cc -FILE: ../../../flutter/third_party/txt/src/txt/text_shadow.h -FILE: ../../../flutter/third_party/txt/src/txt/text_style.cc -FILE: ../../../flutter/third_party/txt/src/txt/text_style.h -FILE: ../../../flutter/third_party/txt/src/txt/typeface_font_asset_provider.cc -FILE: ../../../flutter/third_party/txt/src/txt/typeface_font_asset_provider.h FILE: ../../../flutter/third_party/vulkan-deps/glslang/src/SPIRV/bitutils.h FILE: ../../../flutter/third_party/vulkan-deps/glslang/src/SPIRV/hex_float.h FILE: ../../../flutter/third_party/vulkan-deps/glslang/src/gtests/Common.cpp @@ -41215,7 +41142,6 @@ LIBRARY: accessibility LIBRARY: engine LIBRARY: spring_animation LIBRARY: tonic -LIBRARY: txt LIBRARY: web_test_fonts LIBRARY: web_unicode ORIGIN: ../../../flutter/LICENSE @@ -44093,18 +44019,54 @@ ORIGIN: ../../../flutter/third_party/tonic/typed_data/typed_list.cc + ../../../f ORIGIN: ../../../flutter/third_party/tonic/typed_data/typed_list.h + ../../../flutter/third_party/tonic/LICENSE ORIGIN: ../../../flutter/third_party/tonic/typed_data/uint16_list.h + ../../../flutter/third_party/tonic/LICENSE ORIGIN: ../../../flutter/third_party/tonic/typed_data/uint8_list.h + ../../../flutter/third_party/tonic/LICENSE -ORIGIN: ../../../flutter/third_party/txt/src/txt/platform.cc + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/third_party/txt/src/txt/platform.h + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/third_party/txt/src/txt/platform_android.cc + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/third_party/txt/src/txt/platform_fuchsia.cc + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/third_party/txt/src/txt/platform_linux.cc + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/third_party/txt/src/txt/platform_mac.h + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/third_party/txt/src/txt/platform_mac.mm + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/third_party/txt/src/txt/platform_windows.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/third_party/web_test_fonts/lib/web_test_fonts.dart + ../../../flutter/LICENSE ORIGIN: ../../../flutter/third_party/web_test_fonts/lib/web_test_fonts/web_test_fonts.dart + ../../../flutter/LICENSE ORIGIN: ../../../flutter/third_party/web_unicode/lib/web_unicode.dart + ../../../flutter/LICENSE ORIGIN: ../../../flutter/third_party/web_unicode/tool/unicode_sync_script.dart + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/benchmarks/skparagraph_benchmarks.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/benchmarks/txt_run_all_benchmarks.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/skia/paragraph_builder_skia.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/skia/paragraph_builder_skia.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/skia/paragraph_skia.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/skia/paragraph_skia.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/asset_font_manager.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/asset_font_manager.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/font_asset_provider.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/font_asset_provider.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/font_collection.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/font_collection.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/font_features.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/font_features.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/font_style.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/font_weight.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/line_metrics.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/paragraph.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/paragraph_builder.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/paragraph_builder.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/paragraph_style.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/paragraph_style.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/placeholder_run.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/placeholder_run.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/platform.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/platform.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/platform_android.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/platform_fuchsia.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/platform_linux.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/platform_mac.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/platform_mac.mm + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/platform_windows.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/run_metrics.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/test_font_manager.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/test_font_manager.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/text_baseline.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/text_decoration.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/text_decoration.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/text_shadow.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/text_shadow.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/text_style.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/text_style.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/typeface_font_asset_provider.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/txt/src/txt/typeface_font_asset_provider.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/vulkan/procs/vulkan_handle.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/vulkan/procs/vulkan_handle.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/vulkan/procs/vulkan_interface.cc + ../../../flutter/LICENSE @@ -47053,18 +47015,54 @@ FILE: ../../../flutter/third_party/tonic/typed_data/typed_list.cc FILE: ../../../flutter/third_party/tonic/typed_data/typed_list.h FILE: ../../../flutter/third_party/tonic/typed_data/uint16_list.h FILE: ../../../flutter/third_party/tonic/typed_data/uint8_list.h -FILE: ../../../flutter/third_party/txt/src/txt/platform.cc -FILE: ../../../flutter/third_party/txt/src/txt/platform.h -FILE: ../../../flutter/third_party/txt/src/txt/platform_android.cc -FILE: ../../../flutter/third_party/txt/src/txt/platform_fuchsia.cc -FILE: ../../../flutter/third_party/txt/src/txt/platform_linux.cc -FILE: ../../../flutter/third_party/txt/src/txt/platform_mac.h -FILE: ../../../flutter/third_party/txt/src/txt/platform_mac.mm -FILE: ../../../flutter/third_party/txt/src/txt/platform_windows.cc FILE: ../../../flutter/third_party/web_test_fonts/lib/web_test_fonts.dart FILE: ../../../flutter/third_party/web_test_fonts/lib/web_test_fonts/web_test_fonts.dart FILE: ../../../flutter/third_party/web_unicode/lib/web_unicode.dart FILE: ../../../flutter/third_party/web_unicode/tool/unicode_sync_script.dart +FILE: ../../../flutter/txt/benchmarks/skparagraph_benchmarks.cc +FILE: ../../../flutter/txt/benchmarks/txt_run_all_benchmarks.cc +FILE: ../../../flutter/txt/src/skia/paragraph_builder_skia.cc +FILE: ../../../flutter/txt/src/skia/paragraph_builder_skia.h +FILE: ../../../flutter/txt/src/skia/paragraph_skia.cc +FILE: ../../../flutter/txt/src/skia/paragraph_skia.h +FILE: ../../../flutter/txt/src/txt/asset_font_manager.cc +FILE: ../../../flutter/txt/src/txt/asset_font_manager.h +FILE: ../../../flutter/txt/src/txt/font_asset_provider.cc +FILE: ../../../flutter/txt/src/txt/font_asset_provider.h +FILE: ../../../flutter/txt/src/txt/font_collection.cc +FILE: ../../../flutter/txt/src/txt/font_collection.h +FILE: ../../../flutter/txt/src/txt/font_features.cc +FILE: ../../../flutter/txt/src/txt/font_features.h +FILE: ../../../flutter/txt/src/txt/font_style.h +FILE: ../../../flutter/txt/src/txt/font_weight.h +FILE: ../../../flutter/txt/src/txt/line_metrics.h +FILE: ../../../flutter/txt/src/txt/paragraph.h +FILE: ../../../flutter/txt/src/txt/paragraph_builder.cc +FILE: ../../../flutter/txt/src/txt/paragraph_builder.h +FILE: ../../../flutter/txt/src/txt/paragraph_style.cc +FILE: ../../../flutter/txt/src/txt/paragraph_style.h +FILE: ../../../flutter/txt/src/txt/placeholder_run.cc +FILE: ../../../flutter/txt/src/txt/placeholder_run.h +FILE: ../../../flutter/txt/src/txt/platform.cc +FILE: ../../../flutter/txt/src/txt/platform.h +FILE: ../../../flutter/txt/src/txt/platform_android.cc +FILE: ../../../flutter/txt/src/txt/platform_fuchsia.cc +FILE: ../../../flutter/txt/src/txt/platform_linux.cc +FILE: ../../../flutter/txt/src/txt/platform_mac.h +FILE: ../../../flutter/txt/src/txt/platform_mac.mm +FILE: ../../../flutter/txt/src/txt/platform_windows.cc +FILE: ../../../flutter/txt/src/txt/run_metrics.h +FILE: ../../../flutter/txt/src/txt/test_font_manager.cc +FILE: ../../../flutter/txt/src/txt/test_font_manager.h +FILE: ../../../flutter/txt/src/txt/text_baseline.h +FILE: ../../../flutter/txt/src/txt/text_decoration.cc +FILE: ../../../flutter/txt/src/txt/text_decoration.h +FILE: ../../../flutter/txt/src/txt/text_shadow.cc +FILE: ../../../flutter/txt/src/txt/text_shadow.h +FILE: ../../../flutter/txt/src/txt/text_style.cc +FILE: ../../../flutter/txt/src/txt/text_style.h +FILE: ../../../flutter/txt/src/txt/typeface_font_asset_provider.cc +FILE: ../../../flutter/txt/src/txt/typeface_font_asset_provider.h FILE: ../../../flutter/vulkan/procs/vulkan_handle.cc FILE: ../../../flutter/vulkan/procs/vulkan_handle.h FILE: ../../../flutter/vulkan/procs/vulkan_interface.cc diff --git a/engine/src/flutter/ci/licenses_golden/tool_signature b/engine/src/flutter/ci/licenses_golden/tool_signature index 06a53c8f3a..bbeca7968e 100644 --- a/engine/src/flutter/ci/licenses_golden/tool_signature +++ b/engine/src/flutter/ci/licenses_golden/tool_signature @@ -1,2 +1,2 @@ -Signature: c84f698d3be586c08f30d61b87c71a64 +Signature: 3e70644686476fd49381d86a050498ab diff --git a/engine/src/flutter/display_list/BUILD.gn b/engine/src/flutter/display_list/BUILD.gn index 4bab84f438..04121176a7 100644 --- a/engine/src/flutter/display_list/BUILD.gn +++ b/engine/src/flutter/display_list/BUILD.gn @@ -141,8 +141,7 @@ source_set("display_list") { } test_fixtures("display_list_fixtures") { - fixtures = - [ "//flutter/third_party/txt/third_party/fonts/Roboto-Regular.ttf" ] + fixtures = [ "//flutter/txt/third_party/fonts/Roboto-Regular.ttf" ] } if (enable_unittests) { @@ -207,7 +206,7 @@ if (enable_unittests) { "//flutter/display_list/testing:display_list_testing", "//flutter/impeller/typographer/backends/skia:typographer_skia_backend", "//flutter/testing", - "//flutter/third_party/txt", + "//flutter/txt", ] if (!defined(defines)) { diff --git a/engine/src/flutter/display_list/testing/BUILD.gn b/engine/src/flutter/display_list/testing/BUILD.gn index fc48324c76..93a9458da3 100644 --- a/engine/src/flutter/display_list/testing/BUILD.gn +++ b/engine/src/flutter/display_list/testing/BUILD.gn @@ -17,7 +17,7 @@ source_set("display_list_testing") { deps = [ "//flutter/skia", "//flutter/testing:testing_lib", - "//flutter/third_party/txt", + "//flutter/txt", ] public_deps = [ "//flutter/display_list:display_list" ] diff --git a/engine/src/flutter/flow/BUILD.gn b/engine/src/flutter/flow/BUILD.gn index ce4afa9781..0f15ba2f35 100644 --- a/engine/src/flutter/flow/BUILD.gn +++ b/engine/src/flutter/flow/BUILD.gn @@ -99,7 +99,7 @@ source_set("flow") { "//flutter/common/graphics", "//flutter/display_list", "//flutter/fml", - "//flutter/third_party/txt", + "//flutter/txt", ] deps = [ "//flutter/skia" ] @@ -114,8 +114,7 @@ source_set("flow") { if (enable_unittests) { test_fixtures("flow_fixtures") { - fixtures = - [ "//flutter/third_party/txt/third_party/fonts/Roboto-Regular.ttf" ] + fixtures = [ "//flutter/txt/third_party/fonts/Roboto-Regular.ttf" ] } source_set("flow_testing") { diff --git a/engine/src/flutter/flow/flow_run_all_unittests.cc b/engine/src/flutter/flow/flow_run_all_unittests.cc index eb7a58b5a8..d98ede0fc4 100644 --- a/engine/src/flutter/flow/flow_run_all_unittests.cc +++ b/engine/src/flutter/flow/flow_run_all_unittests.cc @@ -23,7 +23,6 @@ int main(int argc, char** argv) { cmd.GetOptionValueWithDefault("golden-dir", "flutter/testing/resources")); #endif flutter::SetFontFile(cmd.GetOptionValueWithDefault( - "font-file", - "flutter/third_party/txt/third_party/fonts/Roboto-Regular.ttf")); + "font-file", "flutter/txt/third_party/fonts/Roboto-Regular.ttf")); return RUN_ALL_TESTS(); } diff --git a/engine/src/flutter/impeller/display_list/BUILD.gn b/engine/src/flutter/impeller/display_list/BUILD.gn index 3c4f1aefc8..4d9c4f8a90 100644 --- a/engine/src/flutter/impeller/display_list/BUILD.gn +++ b/engine/src/flutter/impeller/display_list/BUILD.gn @@ -106,7 +106,7 @@ template("display_list_unittests_component") { ":display_list", "../playground:playground_test", "//flutter/impeller/golden_tests:screenshot", - "//flutter/third_party/txt", + "//flutter/txt", ] if (defined(invoker.public_configs)) { public_configs = invoker.public_configs @@ -182,7 +182,7 @@ template("aiks_unittests_component") { "//flutter/impeller/golden_tests:golden_playground_test", "//flutter/impeller/playground:playground_test", "//flutter/testing:testing_lib", - "//flutter/third_party/txt", + "//flutter/txt", ] if (defined(invoker.public_configs)) { public_configs = invoker.public_configs diff --git a/engine/src/flutter/impeller/entity/BUILD.gn b/engine/src/flutter/impeller/entity/BUILD.gn index b696b112c5..fe25c779a9 100644 --- a/engine/src/flutter/impeller/entity/BUILD.gn +++ b/engine/src/flutter/impeller/entity/BUILD.gn @@ -273,6 +273,6 @@ impeller_component("entity_unittests") { "../playground:playground_test", "//flutter/display_list/testing:display_list_testing", "//flutter/impeller/typographer/backends/skia:typographer_skia_backend", - "//flutter/third_party/txt", + "//flutter/txt", ] } diff --git a/engine/src/flutter/impeller/fixtures/BUILD.gn b/engine/src/flutter/impeller/fixtures/BUILD.gn index f3a81d1cc6..f4e6bc5f0e 100644 --- a/engine/src/flutter/impeller/fixtures/BUILD.gn +++ b/engine/src/flutter/impeller/fixtures/BUILD.gn @@ -102,11 +102,11 @@ impellerc("runtime_stages") { test_fixtures("file_fixtures") { fixtures = [ - "//flutter/third_party/txt/third_party/fonts/ahem.ttf", - "//flutter/third_party/txt/third_party/fonts/HomemadeApple.ttf", - "//flutter/third_party/txt/third_party/fonts/NotoColorEmoji.ttf", - "//flutter/third_party/txt/third_party/fonts/Roboto-Medium.ttf", - "//flutter/third_party/txt/third_party/fonts/Roboto-Regular.ttf", + "//flutter/txt/third_party/fonts/ahem.ttf", + "//flutter/txt/third_party/fonts/HomemadeApple.ttf", + "//flutter/txt/third_party/fonts/NotoColorEmoji.ttf", + "//flutter/txt/third_party/fonts/Roboto-Medium.ttf", + "//flutter/txt/third_party/fonts/Roboto-Regular.ttf", "airplane.jpg", "bay_bridge.jpg", "blend_mode_dst.png", diff --git a/engine/src/flutter/impeller/renderer/render_pass.cc b/engine/src/flutter/impeller/renderer/render_pass.cc index f01b0c8e4a..73626e28ac 100644 --- a/engine/src/flutter/impeller/renderer/render_pass.cc +++ b/engine/src/flutter/impeller/renderer/render_pass.cc @@ -267,12 +267,15 @@ bool RenderPass::BindDynamicResource(ShaderStage stage, return BindBuffer(stage, slot, std::move(resouce)); } -bool RenderPass::BindDynamicResource(ShaderStage stage, - DescriptorType type, - const SampledImageSlot& slot, - std::unique_ptr metadata, - std::shared_ptr texture, - raw_ptr sampler) { +bool RenderPass::BindDynamicResource( + ShaderStage stage, + DescriptorType type, + const SampledImageSlot& slot, + std::unique_ptr metadata, + std::shared_ptr texture, + raw_ptr + sampler // NOLINT(performance-unnecessary-value-param) +) { if (!sampler) { return false; } @@ -303,6 +306,7 @@ bool RenderPass::BindTexture(ShaderStage stage, TextureAndSampler data = TextureAndSampler{ .stage = stage, .texture = std::move(resource), + // NOLINTNEXTLINE(performance-move-const-arg) .sampler = sampler, }; diff --git a/engine/src/flutter/impeller/toolkit/interop/BUILD.gn b/engine/src/flutter/impeller/toolkit/interop/BUILD.gn index bee866d931..2fcf715166 100644 --- a/engine/src/flutter/impeller/toolkit/interop/BUILD.gn +++ b/engine/src/flutter/impeller/toolkit/interop/BUILD.gn @@ -76,7 +76,7 @@ impeller_component("interop_base") { "../../renderer/backend", "//flutter/display_list", "//flutter/fml", - "//flutter/third_party/txt", + "//flutter/txt", ] } diff --git a/engine/src/flutter/impeller/toolkit/interop/formats.h b/engine/src/flutter/impeller/toolkit/interop/formats.h index faec502a24..a96e04aafd 100644 --- a/engine/src/flutter/impeller/toolkit/interop/formats.h +++ b/engine/src/flutter/impeller/toolkit/interop/formats.h @@ -9,9 +9,9 @@ #include "flutter/display_list/dl_builder.h" #include "flutter/display_list/dl_color.h" -#include "flutter/third_party/txt/src/txt/font_style.h" -#include "flutter/third_party/txt/src/txt/font_weight.h" -#include "flutter/third_party/txt/src/txt/paragraph_style.h" +#include "flutter/txt/src/txt/font_style.h" +#include "flutter/txt/src/txt/font_weight.h" +#include "flutter/txt/src/txt/paragraph_style.h" #include "impeller/entity/entity.h" #include "impeller/geometry/color.h" #include "impeller/geometry/matrix.h" diff --git a/engine/src/flutter/impeller/toolkit/interop/paragraph.h b/engine/src/flutter/impeller/toolkit/interop/paragraph.h index 9a60fe721f..06eb5583ed 100644 --- a/engine/src/flutter/impeller/toolkit/interop/paragraph.h +++ b/engine/src/flutter/impeller/toolkit/interop/paragraph.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_IMPELLER_TOOLKIT_INTEROP_PARAGRAPH_H_ #define FLUTTER_IMPELLER_TOOLKIT_INTEROP_PARAGRAPH_H_ -#include "flutter/third_party/txt/src/txt/paragraph.h" +#include "flutter/txt/src/txt/paragraph.h" #include "impeller/toolkit/interop/impeller.h" #include "impeller/toolkit/interop/object.h" diff --git a/engine/src/flutter/impeller/toolkit/interop/paragraph_builder.cc b/engine/src/flutter/impeller/toolkit/interop/paragraph_builder.cc index d983c38b00..9ddc2313f4 100644 --- a/engine/src/flutter/impeller/toolkit/interop/paragraph_builder.cc +++ b/engine/src/flutter/impeller/toolkit/interop/paragraph_builder.cc @@ -4,7 +4,7 @@ #include "impeller/toolkit/interop/paragraph_builder.h" -#include "flutter/third_party/txt/src/skia/paragraph_builder_skia.h" +#include "flutter/txt/src/skia/paragraph_builder_skia.h" #include "impeller/base/validation.h" #include "impeller/toolkit/interop/paragraph.h" diff --git a/engine/src/flutter/impeller/toolkit/interop/paragraph_builder.h b/engine/src/flutter/impeller/toolkit/interop/paragraph_builder.h index 8ea141ecfa..2305eccfdf 100644 --- a/engine/src/flutter/impeller/toolkit/interop/paragraph_builder.h +++ b/engine/src/flutter/impeller/toolkit/interop/paragraph_builder.h @@ -7,7 +7,7 @@ #include -#include "flutter/third_party/txt/src/txt/paragraph_builder.h" +#include "flutter/txt/src/txt/paragraph_builder.h" #include "impeller/toolkit/interop/impeller.h" #include "impeller/toolkit/interop/object.h" #include "impeller/toolkit/interop/paragraph.h" diff --git a/engine/src/flutter/impeller/toolkit/interop/paragraph_style.h b/engine/src/flutter/impeller/toolkit/interop/paragraph_style.h index 0a3e898ddb..1e12f031a4 100644 --- a/engine/src/flutter/impeller/toolkit/interop/paragraph_style.h +++ b/engine/src/flutter/impeller/toolkit/interop/paragraph_style.h @@ -5,10 +5,10 @@ #ifndef FLUTTER_IMPELLER_TOOLKIT_INTEROP_PARAGRAPH_STYLE_H_ #define FLUTTER_IMPELLER_TOOLKIT_INTEROP_PARAGRAPH_STYLE_H_ +#include "flutter/txt/src/txt/paragraph_style.h" #include "impeller/toolkit/interop/impeller.h" #include "impeller/toolkit/interop/object.h" #include "impeller/toolkit/interop/paint.h" -#include "third_party/txt/src/txt/paragraph_style.h" namespace impeller::interop { diff --git a/engine/src/flutter/impeller/toolkit/interop/typography_context.cc b/engine/src/flutter/impeller/toolkit/interop/typography_context.cc index ed863fa61e..5ee88858e4 100644 --- a/engine/src/flutter/impeller/toolkit/interop/typography_context.cc +++ b/engine/src/flutter/impeller/toolkit/interop/typography_context.cc @@ -7,7 +7,7 @@ #include #include "flutter/fml/icu_util.h" -#include "flutter/third_party/txt/src/txt/platform.h" +#include "flutter/txt/src/txt/platform.h" #include "impeller/base/validation.h" #include "impeller/toolkit/interop/embedded_icu_data.h" diff --git a/engine/src/flutter/impeller/toolkit/interop/typography_context.h b/engine/src/flutter/impeller/toolkit/interop/typography_context.h index f086ffc6b4..d4f505df75 100644 --- a/engine/src/flutter/impeller/toolkit/interop/typography_context.h +++ b/engine/src/flutter/impeller/toolkit/interop/typography_context.h @@ -8,7 +8,7 @@ #include #include "flutter/third_party/skia/modules/skparagraph/include/TypefaceFontProvider.h" -#include "flutter/third_party/txt/src/txt/font_collection.h" +#include "flutter/txt/src/txt/font_collection.h" #include "impeller/toolkit/interop/impeller.h" #include "impeller/toolkit/interop/object.h" diff --git a/engine/src/flutter/impeller/typographer/BUILD.gn b/engine/src/flutter/impeller/typographer/BUILD.gn index 3470c3d0be..7279b6aabe 100644 --- a/engine/src/flutter/impeller/typographer/BUILD.gn +++ b/engine/src/flutter/impeller/typographer/BUILD.gn @@ -51,6 +51,6 @@ impeller_component("typographer_unittests") { "../playground:playground_test", "backends/skia:typographer_skia_backend", "//flutter/display_list/testing:display_list_testing", - "//flutter/third_party/txt", + "//flutter/txt", ] } diff --git a/engine/src/flutter/lib/ui/BUILD.gn b/engine/src/flutter/lib/ui/BUILD.gn index 407934d1a8..510941157e 100644 --- a/engine/src/flutter/lib/ui/BUILD.gn +++ b/engine/src/flutter/lib/ui/BUILD.gn @@ -169,7 +169,7 @@ source_set("ui") { "//flutter/shell/common:display", "//flutter/shell/common:platform_message_handler", "//flutter/skia/modules/skparagraph", - "//flutter/third_party/txt", + "//flutter/txt", ] deps = [ @@ -230,7 +230,7 @@ if (enable_unittests) { "fixtures/FontManifest.json", "fixtures/unmultiplied_alpha.png", "fixtures/WideGamutIndexed.png", - "//flutter/third_party/txt/third_party/fonts/Roboto-Medium.ttf", + "//flutter/txt/third_party/fonts/Roboto-Medium.ttf", ] } diff --git a/engine/src/flutter/lib/ui/text/paragraph.h b/engine/src/flutter/lib/ui/text/paragraph.h index d37e1ae62a..a3e4389be1 100644 --- a/engine/src/flutter/lib/ui/text/paragraph.h +++ b/engine/src/flutter/lib/ui/text/paragraph.h @@ -8,7 +8,7 @@ #include "flutter/fml/message_loop.h" #include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/painting/canvas.h" -#include "flutter/third_party/txt/src/txt/paragraph.h" +#include "flutter/txt/src/txt/paragraph.h" namespace flutter { diff --git a/engine/src/flutter/lib/ui/text/paragraph_builder.cc b/engine/src/flutter/lib/ui/text/paragraph_builder.cc index d5ea7cc2fc..1281a107c3 100644 --- a/engine/src/flutter/lib/ui/text/paragraph_builder.cc +++ b/engine/src/flutter/lib/ui/text/paragraph_builder.cc @@ -13,12 +13,12 @@ #include "flutter/lib/ui/text/font_collection.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/platform_configuration.h" -#include "flutter/third_party/txt/src/txt/font_style.h" -#include "flutter/third_party/txt/src/txt/font_weight.h" -#include "flutter/third_party/txt/src/txt/paragraph_style.h" -#include "flutter/third_party/txt/src/txt/text_baseline.h" -#include "flutter/third_party/txt/src/txt/text_decoration.h" -#include "flutter/third_party/txt/src/txt/text_style.h" +#include "flutter/txt/src/txt/font_style.h" +#include "flutter/txt/src/txt/font_weight.h" +#include "flutter/txt/src/txt/paragraph_style.h" +#include "flutter/txt/src/txt/text_baseline.h" +#include "flutter/txt/src/txt/text_decoration.h" +#include "flutter/txt/src/txt/text_style.h" #include "third_party/icu/source/common/unicode/ustring.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/tonic/converter/dart_converter.h" diff --git a/engine/src/flutter/lib/ui/text/paragraph_builder.h b/engine/src/flutter/lib/ui/text/paragraph_builder.h index 809f91bc3f..895cae10f1 100644 --- a/engine/src/flutter/lib/ui/text/paragraph_builder.h +++ b/engine/src/flutter/lib/ui/text/paragraph_builder.h @@ -10,7 +10,7 @@ #include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/painting/paint.h" #include "flutter/lib/ui/text/paragraph.h" -#include "flutter/third_party/txt/src/txt/paragraph_builder.h" +#include "flutter/txt/src/txt/paragraph_builder.h" #include "third_party/tonic/typed_data/typed_list.h" namespace flutter { diff --git a/engine/src/flutter/lib/web_ui/dev/steps/copy_artifacts_step.dart b/engine/src/flutter/lib/web_ui/dev/steps/copy_artifacts_step.dart index 9537110afc..f825680c48 100644 --- a/engine/src/flutter/lib/web_ui/dev/steps/copy_artifacts_step.dart +++ b/engine/src/flutter/lib/web_ui/dev/steps/copy_artifacts_step.dart @@ -132,7 +132,6 @@ class CopyArtifactsStep implements PipelineStep { final String fontsPath = pathlib.join( environment.flutterDirectory.path, - 'third_party', 'txt', 'third_party', 'fonts', diff --git a/engine/src/flutter/runtime/BUILD.gn b/engine/src/flutter/runtime/BUILD.gn index 5c75d2f4cb..a0e8610a6e 100644 --- a/engine/src/flutter/runtime/BUILD.gn +++ b/engine/src/flutter/runtime/BUILD.gn @@ -12,7 +12,7 @@ source_set("test_font") { ] deps = [ "//flutter/skia", - "//flutter/third_party/txt", + "//flutter/txt", ] public_configs = [ "//flutter:config" ] defines = [] @@ -116,7 +116,7 @@ source_set("runtime") { "//flutter/shell/common:display", "//flutter/skia", "//flutter/third_party/tonic", - "//flutter/third_party/txt", + "//flutter/txt", ] if (flutter_runtime_mode != "release" && !is_fuchsia) { diff --git a/engine/src/flutter/shell/common/BUILD.gn b/engine/src/flutter/shell/common/BUILD.gn index ddceabbf3f..c3ffd57d5c 100644 --- a/engine/src/flutter/shell/common/BUILD.gn +++ b/engine/src/flutter/shell/common/BUILD.gn @@ -135,7 +135,7 @@ source_set("common") { "//flutter/shell/version", "//flutter/third_party/rapidjson", "//flutter/third_party/tonic", - "//flutter/third_party/txt", + "//flutter/txt", ] deps = [ @@ -205,7 +205,7 @@ if (enable_unittests) { fixtures = [ "fixtures/shelltest_screenshot.png", "fixtures/hello_loop_2.gif", - "//flutter/third_party/txt/third_party/fonts/Roboto-Regular.ttf", + "//flutter/txt/third_party/fonts/Roboto-Regular.ttf", ] } diff --git a/engine/src/flutter/shell/platform/android/BUILD.gn b/engine/src/flutter/shell/platform/android/BUILD.gn index f3b972a054..c75b5e8c7f 100644 --- a/engine/src/flutter/shell/platform/android/BUILD.gn +++ b/engine/src/flutter/shell/platform/android/BUILD.gn @@ -167,7 +167,7 @@ source_set("flutter_shell_native_src") { "//flutter/shell/platform/android/surface", "//flutter/shell/platform/android/surface:native_window", "//flutter/skia", - "//flutter/third_party/txt", + "//flutter/txt", "//flutter/vulkan", ] diff --git a/engine/src/flutter/shell/platform/android/platform_view_android_delegate/BUILD.gn b/engine/src/flutter/shell/platform/android/platform_view_android_delegate/BUILD.gn index f01f6f8da4..fbec934de2 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android_delegate/BUILD.gn +++ b/engine/src/flutter/shell/platform/android/platform_view_android_delegate/BUILD.gn @@ -38,6 +38,6 @@ executable("platform_view_android_delegate_unittests") { "//flutter/shell/platform/android/jni:jni_mock", "//flutter/testing", "//flutter/testing:dart", - "//flutter/third_party/txt", + "//flutter/txt", ] } diff --git a/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn b/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn index 508d7c1142..edcdbb71d0 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn +++ b/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn @@ -256,7 +256,7 @@ shared_library("ios_test_flutter") { "//flutter/third_party/rapidjson", "//flutter/third_party/spring_animation", "//flutter/third_party/tonic", - "//flutter/third_party/txt", + "//flutter/txt", ] public_configs = [ ":ios_gpu_configuration_config", diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn index 90c7ba95e4..a7408d7ee5 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn @@ -644,8 +644,7 @@ if (enable_unittests) { binary = "display_list_unittests" resources = [ { - path = rebase_path( - "//flutter/third_party/txt/third_party/fonts/Roboto-Regular.ttf") + path = rebase_path("//flutter/txt/third_party/fonts/Roboto-Regular.ttf") dest = "assets/Roboto-Regular.ttf" }, ] @@ -657,8 +656,7 @@ if (enable_unittests) { binary = "display_list_rendertests" resources = [ { - path = rebase_path( - "//flutter/third_party/txt/third_party/fonts/Roboto-Regular.ttf") + path = rebase_path("//flutter/txt/third_party/fonts/Roboto-Regular.ttf") dest = "assets/Roboto-Regular.ttf" }, ] @@ -685,8 +683,7 @@ if (enable_unittests) { dest = "flutter/testing/resources/performance_overlay_gold_120fps.png" }, { - path = rebase_path( - "//flutter/third_party/txt/third_party/fonts/Roboto-Regular.ttf") + path = rebase_path("//flutter/txt/third_party/fonts/Roboto-Regular.ttf") dest = "assets/Roboto-Regular.ttf" }, ] @@ -733,8 +730,7 @@ if (enable_unittests) { dest = "assets/shelltest_screenshot.png" }, { - path = rebase_path( - "//flutter/third_party/txt/third_party/fonts/Roboto-Regular.ttf") + path = rebase_path("//flutter/txt/third_party/fonts/Roboto-Regular.ttf") dest = "assets/Roboto-Regular.ttf" }, ] @@ -744,7 +740,7 @@ if (enable_unittests) { } fuchsia_test_archive("txt_tests") { - deps = [ "//flutter/third_party/txt:txt_unittests" ] + deps = [ "//flutter/txt:txt_unittests" ] gen_cml_file = true binary = "txt_unittests" diff --git a/engine/src/flutter/testing/dart/BUILD.gn b/engine/src/flutter/testing/dart/BUILD.gn index 8d658f2d28..d240383f48 100644 --- a/engine/src/flutter/testing/dart/BUILD.gn +++ b/engine/src/flutter/testing/dart/BUILD.gn @@ -65,7 +65,7 @@ foreach(test, tests) { "-DkFlutterBuildDirectory=$flutter_build_dir", "-DkSkiaGoldWorkDirectory=$skia_gold_work_dir", ] - deps = [ "//flutter/third_party/txt:txt_fixtures" ] + deps = [ "//flutter/txt:txt_fixtures" ] testonly = true } } diff --git a/engine/src/flutter/testing/dart/canvas_test.dart b/engine/src/flutter/testing/dart/canvas_test.dart index f68c26a47b..ddbb9cf670 100644 --- a/engine/src/flutter/testing/dart/canvas_test.dart +++ b/engine/src/flutter/testing/dart/canvas_test.dart @@ -752,7 +752,7 @@ void main() async { // However, Flutter opts-in to a Skia feature to render tabs as a single space. // See: https://github.com/flutter/flutter/issues/79153 final File file = File( - path.join(_flutterBuildPath, 'flutter', 'third_party', 'txt', 'assets', 'Roboto-Regular.ttf'), + path.join(_flutterBuildPath, 'flutter', 'txt', 'assets', 'Roboto-Regular.ttf'), ); final Uint8List fontData = await file.readAsBytes(); await loadFontFromList(fontData, fontFamily: 'RobotoSerif'); @@ -1316,7 +1316,7 @@ void main() async { test('TextDecoration renders non-solid lines', () async { final File file = File( - path.join(_flutterBuildPath, 'flutter', 'third_party', 'txt', 'assets', 'Roboto-Regular.ttf'), + path.join(_flutterBuildPath, 'flutter', 'txt', 'assets', 'Roboto-Regular.ttf'), ); final Uint8List fontData = await file.readAsBytes(); await loadFontFromList(fontData, fontFamily: 'RobotoSlab'); diff --git a/engine/src/flutter/testing/ios/IosUnitTests/IosUnitTests.xcodeproj/project.pbxproj b/engine/src/flutter/testing/ios/IosUnitTests/IosUnitTests.xcodeproj/project.pbxproj index 66f378bcbb..f0211a07c6 100644 --- a/engine/src/flutter/testing/ios/IosUnitTests/IosUnitTests.xcodeproj/project.pbxproj +++ b/engine/src/flutter/testing/ios/IosUnitTests/IosUnitTests.xcodeproj/project.pbxproj @@ -496,7 +496,7 @@ ../../../../third_party/skia, ../../../../third_party, ../../../../third_party/rapidjson/include, - ../../../../flutter/third_party/txt/src, + ../../../../flutter/txt/src, ../../../../third_party/harfbuzz/src, ../../../../third_party/icu/source/common, ); @@ -540,7 +540,7 @@ ../../../../third_party/skia, ../../../../third_party, ../../../../third_party/rapidjson/include, - ../../../../flutter/third_party/txt/src, + ../../../../flutter/txt/src, ../../../../third_party/harfbuzz/src, ../../../../third_party/icu/source/common, ); diff --git a/engine/src/flutter/testing/run_tests.py b/engine/src/flutter/testing/run_tests.py index 9022e4be30..062b4b0231 100755 --- a/engine/src/flutter/testing/run_tests.py +++ b/engine/src/flutter/testing/run_tests.py @@ -37,7 +37,7 @@ SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) BUILDROOT_DIR = os.path.abspath(os.path.join(os.path.realpath(__file__), '..', '..', '..')) OUT_DIR = os.path.join(BUILDROOT_DIR, 'out') GOLDEN_DIR = os.path.join(BUILDROOT_DIR, 'flutter', 'testing', 'resources') -FONTS_DIR = os.path.join(BUILDROOT_DIR, 'flutter', 'third_party', 'txt', 'third_party', 'fonts') +FONTS_DIR = os.path.join(BUILDROOT_DIR, 'flutter', 'txt', 'third_party', 'fonts') ROBOTO_FONT_PATH = os.path.join(FONTS_DIR, 'Roboto-Regular.ttf') FONT_SUBSET_DIR = os.path.join(BUILDROOT_DIR, 'flutter', 'tools', 'font_subset') diff --git a/engine/src/flutter/third_party/txt/src/txt/font_asset_provider.cc b/engine/src/flutter/third_party/txt/src/txt/font_asset_provider.cc deleted file mode 100644 index a840b2e5f4..0000000000 --- a/engine/src/flutter/third_party/txt/src/txt/font_asset_provider.cc +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2018 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -#include "txt/font_asset_provider.h" - -namespace txt { - -// Return a canonicalized version of a family name that is suitable for -// matching. -std::string FontAssetProvider::CanonicalFamilyName(std::string family_name) { - std::string result(family_name.length(), 0); - - // Convert ASCII characters to lower case. - std::transform(family_name.begin(), family_name.end(), result.begin(), - [](char c) { return (c & 0x80) ? c : ::tolower(c); }); - - return result; -} - -} // namespace txt diff --git a/engine/src/flutter/third_party/txt/src/txt/font_asset_provider.h b/engine/src/flutter/third_party/txt/src/txt/font_asset_provider.h deleted file mode 100644 index f43aacd68b..0000000000 --- a/engine/src/flutter/third_party/txt/src/txt/font_asset_provider.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2018 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TXT_FONT_ASSET_PROVIDER_H_ -#define TXT_FONT_ASSET_PROVIDER_H_ - -#include - -#include "third_party/skia/include/core/SkFontMgr.h" - -namespace txt { - -class FontAssetProvider { - public: - virtual ~FontAssetProvider() = default; - - virtual size_t GetFamilyCount() const = 0; - virtual std::string GetFamilyName(int index) const = 0; - virtual sk_sp MatchFamily(const std::string& family_name) = 0; - - protected: - static std::string CanonicalFamilyName(std::string family_name); -}; - -} // namespace txt - -#endif // TXT_FONT_ASSET_PROVIDER_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/font_features.cc b/engine/src/flutter/third_party/txt/src/txt/font_features.cc deleted file mode 100644 index fd999ccd98..0000000000 --- a/engine/src/flutter/third_party/txt/src/txt/font_features.cc +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2019 Google, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "font_features.h" - -#include - -namespace txt { - -void FontFeatures::SetFeature(std::string tag, int value) { - feature_map_[tag] = value; -} - -std::string FontFeatures::GetFeatureSettings() const { - if (feature_map_.empty()) - return ""; - - std::ostringstream stream; - - for (const auto& kv : feature_map_) { - if (stream.tellp()) { - stream << ','; - } - stream << kv.first << '=' << kv.second; - } - - return stream.str(); -} - -const std::map& FontFeatures::GetFontFeatures() const { - return feature_map_; -} - -void FontVariations::SetAxisValue(std::string tag, float value) { - axis_map_[tag] = value; -} - -const std::map& FontVariations::GetAxisValues() const { - return axis_map_; -} - -} // namespace txt diff --git a/engine/src/flutter/third_party/txt/src/txt/font_features.h b/engine/src/flutter/third_party/txt/src/txt/font_features.h deleted file mode 100644 index b6810ef75c..0000000000 --- a/engine/src/flutter/third_party/txt/src/txt/font_features.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2019 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef LIB_TXT_SRC_FONT_FEATURES_H_ -#define LIB_TXT_SRC_FONT_FEATURES_H_ - -#include -#include -#include - -namespace txt { - -// Feature tags that can be applied in a text style to control how a font -// selects glyphs. -class FontFeatures { - public: - void SetFeature(std::string tag, int value); - - std::string GetFeatureSettings() const; - - const std::map& GetFontFeatures() const; - - private: - std::map feature_map_; -}; - -// Axis tags and values that can be applied in a text style to control the -// attributes of variable fonts. -class FontVariations { - public: - void SetAxisValue(std::string tag, float value); - - const std::map& GetAxisValues() const; - - private: - std::map axis_map_; -}; - -} // namespace txt - -#endif // LIB_TXT_SRC_FONT_FEATURE_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/font_style.h b/engine/src/flutter/third_party/txt/src/txt/font_style.h deleted file mode 100644 index ee903dbea0..0000000000 --- a/engine/src/flutter/third_party/txt/src/txt/font_style.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef LIB_TXT_SRC_FONT_STYLE_H_ -#define LIB_TXT_SRC_FONT_STYLE_H_ - -namespace txt { - -enum class FontStyle { - normal, - italic, -}; - -} // namespace txt - -#endif // LIB_TXT_SRC_FONT_STYLE_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/font_weight.h b/engine/src/flutter/third_party/txt/src/txt/font_weight.h deleted file mode 100644 index c3d6745b7a..0000000000 --- a/engine/src/flutter/third_party/txt/src/txt/font_weight.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef LIB_TXT_SRC_FONT_WEIGHT_H_ -#define LIB_TXT_SRC_FONT_WEIGHT_H_ - -namespace txt { - -enum class FontWeight { - w100, // Thin - w200, // Extra-Light - w300, // Light - w400, // Normal/Regular - w500, // Medium - w600, // Semi-bold - w700, // Bold - w800, // Extra-Bold - w900, // Black -}; - -} // namespace txt - -#endif // LIB_TXT_SRC_FONT_WEIGHT_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/placeholder_run.cc b/engine/src/flutter/third_party/txt/src/txt/placeholder_run.cc deleted file mode 100644 index 3f20d468ff..0000000000 --- a/engine/src/flutter/third_party/txt/src/txt/placeholder_run.cc +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019 Google, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "placeholder_run.h" - -namespace txt { - -PlaceholderRun::PlaceholderRun() {} - -PlaceholderRun::PlaceholderRun(double width, - double height, - PlaceholderAlignment alignment, - TextBaseline baseline, - double baseline_offset) - : width(width), - height(height), - alignment(alignment), - baseline(baseline), - baseline_offset(baseline_offset) {} - -} // namespace txt diff --git a/engine/src/flutter/third_party/txt/src/txt/text_baseline.h b/engine/src/flutter/third_party/txt/src/txt/text_baseline.h deleted file mode 100644 index 67f88cac8c..0000000000 --- a/engine/src/flutter/third_party/txt/src/txt/text_baseline.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef LIB_TXT_SRC_TEXT_BASELINE_H_ -#define LIB_TXT_SRC_TEXT_BASELINE_H_ - -namespace txt { - -enum TextBaseline { - kAlphabetic, - kIdeographic, -}; - -} // namespace txt - -#endif // LIB_TXT_SRC_TEXT_BASELINE_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/text_decoration.cc b/engine/src/flutter/third_party/txt/src/txt/text_decoration.cc deleted file mode 100644 index 95b8a8b8e8..0000000000 --- a/engine/src/flutter/third_party/txt/src/txt/text_decoration.cc +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2017 Google, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -#include "text_decoration.h" - -namespace txt { - -// - -} // namespace txt diff --git a/engine/src/flutter/third_party/txt/src/txt/text_decoration.h b/engine/src/flutter/third_party/txt/src/txt/text_decoration.h deleted file mode 100644 index b77af0e52c..0000000000 --- a/engine/src/flutter/third_party/txt/src/txt/text_decoration.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2017 Google, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef LIB_TXT_SRC_TEXT_DECORATION_H_ -#define LIB_TXT_SRC_TEXT_DECORATION_H_ - -namespace txt { - -// Multiple decorations can be applied at once. Ex: Underline and overline is -// (0x1 | 0x2) -enum TextDecoration { - kNone = 0x0, - kUnderline = 0x1, - kOverline = 0x2, - kLineThrough = 0x4, -}; - -enum TextDecorationStyle { kSolid, kDouble, kDotted, kDashed, kWavy }; - -} // namespace txt - -#endif // LIB_TXT_SRC_TEXT_DECORATION_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/text_shadow.cc b/engine/src/flutter/third_party/txt/src/txt/text_shadow.cc deleted file mode 100644 index 9fb0b2d82f..0000000000 --- a/engine/src/flutter/third_party/txt/src/txt/text_shadow.cc +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2018 Google, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "text_shadow.h" -#include "third_party/skia/include/core/SkColor.h" - -namespace txt { - -TextShadow::TextShadow() {} -TextShadow::TextShadow(SkColor color, SkPoint offset, double blur_sigma) - : color(color), offset(offset), blur_sigma(blur_sigma) {} - -bool TextShadow::operator==(const TextShadow& other) const { - if (color != other.color) - return false; - if (offset != other.offset) - return false; - if (blur_sigma != other.blur_sigma) - return false; - - return true; -} - -bool TextShadow::operator!=(const TextShadow& other) const { - return !(*this == other); -} - -bool TextShadow::hasShadow() const { - if (!offset.isZero()) - return true; - if (blur_sigma > 0.5) - return true; - - return false; -} - -} // namespace txt diff --git a/engine/src/flutter/third_party/txt/src/txt/text_shadow.h b/engine/src/flutter/third_party/txt/src/txt/text_shadow.h deleted file mode 100644 index 5fe61dbde7..0000000000 --- a/engine/src/flutter/third_party/txt/src/txt/text_shadow.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2018 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef LIB_TXT_SRC_TEXT_SHADOW_H_ -#define LIB_TXT_SRC_TEXT_SHADOW_H_ - -#include "third_party/skia/include/core/SkColor.h" -#include "third_party/skia/include/core/SkPoint.h" - -namespace txt { - -class TextShadow { - public: - SkColor color = SK_ColorBLACK; - SkPoint offset; - double blur_sigma = 0.0; - - TextShadow(); - - TextShadow(SkColor color, SkPoint offset, double blur_sigma); - - bool operator==(const TextShadow& other) const; - - bool operator!=(const TextShadow& other) const; - - bool hasShadow() const; -}; - -} // namespace txt - -#endif // LIB_TXT_SRC_TEXT_SHADOW_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/text_style.cc b/engine/src/flutter/third_party/txt/src/txt/text_style.cc deleted file mode 100644 index c571f31edd..0000000000 --- a/engine/src/flutter/third_party/txt/src/txt/text_style.cc +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2017 Google, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "text_style.h" - -#include "font_style.h" -#include "font_weight.h" -#include "third_party/skia/include/core/SkColor.h" -#include "txt/platform.h" - -namespace txt { - -TextStyle::TextStyle() : font_families(GetDefaultFontFamilies()) {} - -bool TextStyle::equals(const TextStyle& other) const { - if (color != other.color) - return false; - if (decoration != other.decoration) - return false; - if (decoration_color != other.decoration_color) - return false; - if (decoration_style != other.decoration_style) - return false; - if (decoration_thickness_multiplier != other.decoration_thickness_multiplier) - return false; - if (font_weight != other.font_weight) - return false; - if (font_style != other.font_style) - return false; - if (letter_spacing != other.letter_spacing) - return false; - if (word_spacing != other.word_spacing) - return false; - if (height != other.height) - return false; - if (has_height_override != other.has_height_override) - return false; - if (half_leading != other.half_leading) - return false; - if (locale != other.locale) - return false; - if (foreground != other.foreground) - return false; - if (font_families.size() != other.font_families.size()) - return false; - if (text_shadows.size() != other.text_shadows.size()) - return false; - for (size_t font_index = 0; font_index < font_families.size(); ++font_index) { - if (font_families[font_index] != other.font_families[font_index]) - return false; - } - for (size_t shadow_index = 0; shadow_index < text_shadows.size(); - ++shadow_index) { - if (text_shadows[shadow_index] != other.text_shadows[shadow_index]) - return false; - } - - return true; -} - -} // namespace txt diff --git a/engine/src/flutter/third_party/txt/tests/txt_run_all_unittests.cc b/engine/src/flutter/third_party/txt/tests/txt_run_all_unittests.cc deleted file mode 100644 index 7a20fa6b99..0000000000 --- a/engine/src/flutter/third_party/txt/tests/txt_run_all_unittests.cc +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2017 Google, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "flutter/fml/backtrace.h" -#include "flutter/testing/testing.h" - -int main(int argc, char** argv) { - fml::InstallCrashHandler(); - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/engine/src/flutter/third_party/txt/tests/txt_test_utils.cc b/engine/src/flutter/third_party/txt/tests/txt_test_utils.cc deleted file mode 100644 index 62bae34f39..0000000000 --- a/engine/src/flutter/third_party/txt/tests/txt_test_utils.cc +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2017 Google, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "txt_test_utils.h" - -namespace txt { - -static std::string gFontDir; - -const std::string& GetFontDir() { - return gFontDir; -} - -void SetFontDir(const std::string& dir) { - gFontDir = dir; -} - -} // namespace txt diff --git a/engine/src/flutter/third_party/txt/tests/txt_test_utils.h b/engine/src/flutter/third_party/txt/tests/txt_test_utils.h deleted file mode 100644 index 603c93ab88..0000000000 --- a/engine/src/flutter/third_party/txt/tests/txt_test_utils.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2017 Google, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef LIB_TXT_TESTS_TXT_TEST_UTILS_H_ -#define LIB_TXT_TESTS_TXT_TEST_UTILS_H_ - -#include - -namespace txt { - -const std::string& GetFontDir(); - -void SetFontDir(const std::string& dir); - -} // namespace txt - -#endif // LIB_TXT_TESTS_TXT_TEST_UTILS_H_ diff --git a/engine/src/flutter/tools/licenses/lib/paths.dart b/engine/src/flutter/tools/licenses/lib/paths.dart index 4f31402dd3..d2434a5bc7 100644 --- a/engine/src/flutter/tools/licenses/lib/paths.dart +++ b/engine/src/flutter/tools/licenses/lib/paths.dart @@ -185,7 +185,6 @@ final Set skippedPaths = { r'flutter/third_party/stb', r'flutter/third_party/swiftshader/third_party', // See: https://github.com/flutter/flutter/issues/145726 r'flutter/third_party/test_shaders', // for tests only - r'flutter/third_party/txt/third_party/fonts', r'flutter/third_party/vulkan-deps/glslang/LICENSE', // excluded to make sure we don't accidentally apply it as a default license r'flutter/third_party/vulkan-deps/glslang/src/LICENSE.txt', // redundant with licenses inside files r'flutter/third_party/vulkan-deps/glslang/src/glslang/OSDependent/Web', // we only use glslang in impellerc, not in web apps @@ -221,6 +220,7 @@ final Set skippedPaths = { r'flutter/third_party/zlib/contrib/minizip/miniunz.c', // sample file r'flutter/third_party/zlib/contrib/minizip/minizip.c', // sample file r'flutter/tools', + r'flutter/txt/third_party/fonts', // only used on hosts for tests r'flutter/web_sdk', // this code is not linked into Flutter apps; it's only used by engine tests and tools r'fuchsia/sdk/linux/docs', r'fuchsia/sdk/linux/meta', diff --git a/engine/src/flutter/third_party/txt/.clang-format b/engine/src/flutter/txt/.clang-format similarity index 100% rename from engine/src/flutter/third_party/txt/.clang-format rename to engine/src/flutter/txt/.clang-format diff --git a/engine/src/flutter/third_party/txt/.gitattributes b/engine/src/flutter/txt/.gitattributes similarity index 100% rename from engine/src/flutter/third_party/txt/.gitattributes rename to engine/src/flutter/txt/.gitattributes diff --git a/engine/src/flutter/third_party/txt/.gitignore b/engine/src/flutter/txt/.gitignore similarity index 100% rename from engine/src/flutter/third_party/txt/.gitignore rename to engine/src/flutter/txt/.gitignore diff --git a/engine/src/flutter/third_party/txt/BUILD.gn b/engine/src/flutter/txt/BUILD.gn similarity index 88% rename from engine/src/flutter/third_party/txt/BUILD.gn rename to engine/src/flutter/txt/BUILD.gn index 4a3a3703ad..feb3d19797 100644 --- a/engine/src/flutter/third_party/txt/BUILD.gn +++ b/engine/src/flutter/txt/BUILD.gn @@ -1,16 +1,6 @@ -# Copyright 2017 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# 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. import("//flutter/common/config.gni") import("//flutter/testing/testing.gni") diff --git a/engine/src/flutter/third_party/txt/benchmarks/skparagraph_benchmarks.cc b/engine/src/flutter/txt/benchmarks/skparagraph_benchmarks.cc similarity index 86% rename from engine/src/flutter/third_party/txt/benchmarks/skparagraph_benchmarks.cc rename to engine/src/flutter/txt/benchmarks/skparagraph_benchmarks.cc index 7f9fd9520f..8ea8bfac67 100644 --- a/engine/src/flutter/third_party/txt/benchmarks/skparagraph_benchmarks.cc +++ b/engine/src/flutter/txt/benchmarks/skparagraph_benchmarks.cc @@ -1,24 +1,12 @@ -/* - * Copyright 2017 Google, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. #include #include "flutter/fml/command_line.h" #include "flutter/fml/logging.h" -#include "flutter/third_party/txt/tests/txt_test_utils.h" +#include "flutter/txt/tests/txt_test_utils.h" #include "third_party/benchmark/include/benchmark/benchmark.h" #include "third_party/icu/source/common/unicode/unistr.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -55,8 +43,8 @@ BENCHMARK_F(SkParagraphFixture, ShortLayout)(benchmark::State& state) { sktxt::TextStyle text_style; text_style.setFontFamilies({SkString("Roboto")}); text_style.setColor(SK_ColorBLACK); - auto builder = - sktxt::ParagraphBuilder::make(paragraph_style, font_collection_, SkUnicodes::ICU::Make()); + auto builder = sktxt::ParagraphBuilder::make( + paragraph_style, font_collection_, SkUnicodes::ICU::Make()); builder->pushStyle(text_style); builder->addText(text); builder->pop(); @@ -90,8 +78,8 @@ BENCHMARK_F(SkParagraphFixture, LongLayout)(benchmark::State& state) { sktxt::TextStyle text_style; text_style.setFontFamilies({SkString("Roboto")}); text_style.setColor(SK_ColorBLACK); - auto builder = - sktxt::ParagraphBuilder::make(paragraph_style, font_collection_, SkUnicodes::ICU::Make()); + auto builder = sktxt::ParagraphBuilder::make( + paragraph_style, font_collection_, SkUnicodes::ICU::Make()); builder->pushStyle(text_style); builder->addText(text); builder->pop(); @@ -126,8 +114,8 @@ BENCHMARK_F(SkParagraphFixture, JustifyLayout)(benchmark::State& state) { sktxt::TextStyle text_style; text_style.setFontFamilies({SkString("Roboto")}); text_style.setColor(SK_ColorBLACK); - auto builder = - sktxt::ParagraphBuilder::make(paragraph_style, font_collection_, SkUnicodes::ICU::Make()); + auto builder = sktxt::ParagraphBuilder::make( + paragraph_style, font_collection_, SkUnicodes::ICU::Make()); builder->pushStyle(text_style); builder->addText(text); builder->pop(); @@ -144,8 +132,8 @@ BENCHMARK_F(SkParagraphFixture, ManyStylesLayout)(benchmark::State& state) { sktxt::TextStyle text_style; text_style.setFontFamilies({SkString("Roboto")}); text_style.setColor(SK_ColorBLACK); - auto builder = - sktxt::ParagraphBuilder::make(paragraph_style, font_collection_, SkUnicodes::ICU::Make()); + auto builder = sktxt::ParagraphBuilder::make( + paragraph_style, font_collection_, SkUnicodes::ICU::Make()); for (int i = 0; i < 1000; ++i) { builder->pushStyle(text_style); builder->addText(text); @@ -167,8 +155,8 @@ BENCHMARK_DEFINE_F(SkParagraphFixture, TextBigO)(benchmark::State& state) { sktxt::TextStyle text_style; text_style.setFontFamilies({SkString("Roboto")}); text_style.setColor(SK_ColorBLACK); - auto builder = - sktxt::ParagraphBuilder::make(paragraph_style, font_collection_, SkUnicodes::ICU::Make()); + auto builder = sktxt::ParagraphBuilder::make( + paragraph_style, font_collection_, SkUnicodes::ICU::Make()); builder->pushStyle(text_style); builder->addText(u16_text); builder->pop(); @@ -191,8 +179,7 @@ BENCHMARK_DEFINE_F(SkParagraphFixture, StylesBigO)(benchmark::State& state) { text_style.setFontFamilies({SkString("Roboto")}); text_style.setColor(SK_ColorBLACK); auto builder = sktxt::ParagraphBuilder::make( - paragraph_style, - sk_make_sp(txt::GetFontDir()), + paragraph_style, sk_make_sp(txt::GetFontDir()), SkUnicodes::ICU::Make()); for (int i = 0; i < 1000; ++i) { builder->pushStyle(text_style); @@ -216,8 +203,8 @@ BENCHMARK_F(SkParagraphFixture, PaintSimple)(benchmark::State& state) { sktxt::TextStyle text_style; text_style.setFontFamilies({SkString("Roboto")}); text_style.setColor(SK_ColorBLACK); - auto builder = - sktxt::ParagraphBuilder::make(paragraph_style, font_collection_, SkUnicodes::ICU::Make()); + auto builder = sktxt::ParagraphBuilder::make( + paragraph_style, font_collection_, SkUnicodes::ICU::Make()); builder->pushStyle(text_style); builder->addText(text); builder->pop(); @@ -254,8 +241,8 @@ BENCHMARK_F(SkParagraphFixture, PaintLarge)(benchmark::State& state) { sktxt::TextStyle text_style; text_style.setFontFamilies({SkString("Roboto")}); text_style.setColor(SK_ColorBLACK); - auto builder = - sktxt::ParagraphBuilder::make(paragraph_style, font_collection_, SkUnicodes::ICU::Make()); + auto builder = sktxt::ParagraphBuilder::make( + paragraph_style, font_collection_, SkUnicodes::ICU::Make()); builder->pushStyle(text_style); builder->addText(text); builder->pop(); @@ -279,8 +266,8 @@ BENCHMARK_F(SkParagraphFixture, PaintDecoration)(benchmark::State& state) { text_style.setDecoration(static_cast( sktxt::TextDecoration::kLineThrough | sktxt::TextDecoration::kOverline | sktxt::TextDecoration::kUnderline)); - auto builder = - sktxt::ParagraphBuilder::make(paragraph_style, font_collection_, SkUnicodes::ICU::Make()); + auto builder = sktxt::ParagraphBuilder::make( + paragraph_style, font_collection_, SkUnicodes::ICU::Make()); text_style.setDecorationStyle(sktxt::TextDecorationStyle::kSolid); builder->pushStyle(text_style); builder->addText(text); @@ -309,8 +296,8 @@ BENCHMARK_F(SkParagraphFixture, SimpleBuilder)(benchmark::State& state) { text_style.setFontFamilies({SkString("Roboto")}); text_style.setColor(SK_ColorBLACK); while (state.KeepRunning()) { - auto builder = - sktxt::ParagraphBuilder::make(paragraph_style, font_collection_, SkUnicodes::ICU::Make()); + auto builder = sktxt::ParagraphBuilder::make( + paragraph_style, font_collection_, SkUnicodes::ICU::Make()); builder->pushStyle(text_style); builder->addText(text); builder->pop(); diff --git a/engine/src/flutter/third_party/txt/benchmarks/txt_run_all_benchmarks.cc b/engine/src/flutter/txt/benchmarks/txt_run_all_benchmarks.cc similarity index 56% rename from engine/src/flutter/third_party/txt/benchmarks/txt_run_all_benchmarks.cc rename to engine/src/flutter/txt/benchmarks/txt_run_all_benchmarks.cc index ac9df5ed9e..78e69b9c88 100644 --- a/engine/src/flutter/third_party/txt/benchmarks/txt_run_all_benchmarks.cc +++ b/engine/src/flutter/txt/benchmarks/txt_run_all_benchmarks.cc @@ -1,24 +1,12 @@ -/* - * Copyright 2017 Google, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. #include "flutter/fml/command_line.h" #include "flutter/fml/icu_util.h" #include "flutter/fml/logging.h" #include "flutter/testing/testing.h" -#include "flutter/third_party/txt/tests/txt_test_utils.h" +#include "flutter/txt/tests/txt_test_utils.h" #include "third_party/benchmark/include/benchmark/benchmark.h" // We will use a custom main to allow custom font directories for consistency. diff --git a/engine/src/flutter/third_party/txt/src/skia/paragraph_builder_skia.cc b/engine/src/flutter/txt/src/skia/paragraph_builder_skia.cc similarity index 92% rename from engine/src/flutter/third_party/txt/src/skia/paragraph_builder_skia.cc rename to engine/src/flutter/txt/src/skia/paragraph_builder_skia.cc index 6cba3ec34f..c7c8b1522f 100644 --- a/engine/src/flutter/third_party/txt/src/skia/paragraph_builder_skia.cc +++ b/engine/src/flutter/txt/src/skia/paragraph_builder_skia.cc @@ -1,18 +1,6 @@ -/* - * Copyright 2019 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. #include "paragraph_builder_skia.h" #include "paragraph_skia.h" @@ -47,7 +35,7 @@ SkFontStyle MakeSkFontStyle(txt::FontWeight font_weight, ParagraphBuilderSkia::ParagraphBuilderSkia( const ParagraphStyle& style, - std::shared_ptr font_collection, + const std::shared_ptr& font_collection, const bool impeller_enabled) : base_style_(style.GetTextStyle()), impeller_enabled_(impeller_enabled) { builder_ = skt::ParagraphBuilder::make( diff --git a/engine/src/flutter/third_party/txt/src/skia/paragraph_builder_skia.h b/engine/src/flutter/txt/src/skia/paragraph_builder_skia.h similarity index 71% rename from engine/src/flutter/third_party/txt/src/skia/paragraph_builder_skia.h rename to engine/src/flutter/txt/src/skia/paragraph_builder_skia.h index 54e703cddb..85223e0c23 100644 --- a/engine/src/flutter/third_party/txt/src/skia/paragraph_builder_skia.h +++ b/engine/src/flutter/txt/src/skia/paragraph_builder_skia.h @@ -1,21 +1,9 @@ -/* - * Copyright 2019 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. -#ifndef LIB_TXT_SRC_PARAGRAPH_BUILDER_SKIA_H_ -#define LIB_TXT_SRC_PARAGRAPH_BUILDER_SKIA_H_ +#ifndef FLUTTER_TXT_SRC_SKIA_PARAGRAPH_BUILDER_SKIA_H_ +#define FLUTTER_TXT_SRC_SKIA_PARAGRAPH_BUILDER_SKIA_H_ #include "txt/paragraph_builder.h" @@ -32,7 +20,7 @@ namespace txt { class ParagraphBuilderSkia : public ParagraphBuilder { public: ParagraphBuilderSkia(const ParagraphStyle& style, - std::shared_ptr font_collection, + const std::shared_ptr& font_collection, const bool impeller_enabled); virtual ~ParagraphBuilderSkia(); @@ -69,4 +57,4 @@ class ParagraphBuilderSkia : public ParagraphBuilder { } // namespace txt -#endif // LIB_TXT_SRC_PARAGRAPH_BUILDER_SKIA_H_ +#endif // FLUTTER_TXT_SRC_SKIA_PARAGRAPH_BUILDER_SKIA_H_ diff --git a/engine/src/flutter/third_party/txt/src/skia/paragraph_skia.cc b/engine/src/flutter/txt/src/skia/paragraph_skia.cc similarity index 96% rename from engine/src/flutter/third_party/txt/src/skia/paragraph_skia.cc rename to engine/src/flutter/txt/src/skia/paragraph_skia.cc index ab9604661f..7ba0c79bb7 100644 --- a/engine/src/flutter/third_party/txt/src/skia/paragraph_skia.cc +++ b/engine/src/flutter/txt/src/skia/paragraph_skia.cc @@ -1,18 +1,6 @@ -/* - * Copyright 2019 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. #include "paragraph_skia.h" @@ -318,6 +306,7 @@ std::vector ParagraphSkia::GetRectsForRange( static_cast(rect_width_style)); std::vector boxes; + boxes.reserve(skia_boxes.size()); for (const skt::TextBox& skia_box : skia_boxes) { boxes.emplace_back(skia_box.rect, static_cast(skia_box.direction)); @@ -330,6 +319,7 @@ std::vector ParagraphSkia::GetRectsForPlaceholders() { std::vector skia_boxes = paragraph_->getRectsForPlaceholders(); std::vector boxes; + boxes.reserve(skia_boxes.size()); for (const skt::TextBox& skia_box : skia_boxes) { boxes.emplace_back(skia_box.rect, static_cast(skia_box.direction)); diff --git a/engine/src/flutter/third_party/txt/src/skia/paragraph_skia.h b/engine/src/flutter/txt/src/skia/paragraph_skia.h similarity index 75% rename from engine/src/flutter/third_party/txt/src/skia/paragraph_skia.h rename to engine/src/flutter/txt/src/skia/paragraph_skia.h index a33c2de853..0d441452a1 100644 --- a/engine/src/flutter/third_party/txt/src/skia/paragraph_skia.h +++ b/engine/src/flutter/txt/src/skia/paragraph_skia.h @@ -1,21 +1,9 @@ -/* - * Copyright 2019 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. -#ifndef LIB_TXT_SRC_PARAGRAPH_SKIA_H_ -#define LIB_TXT_SRC_PARAGRAPH_SKIA_H_ +#ifndef FLUTTER_TXT_SRC_SKIA_PARAGRAPH_SKIA_H_ +#define FLUTTER_TXT_SRC_SKIA_PARAGRAPH_SKIA_H_ #include @@ -98,4 +86,4 @@ class ParagraphSkia : public Paragraph { } // namespace txt -#endif // LIB_TXT_SRC_PARAGRAPH_SKIA_H_ +#endif // FLUTTER_TXT_SRC_SKIA_PARAGRAPH_SKIA_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/asset_font_manager.cc b/engine/src/flutter/txt/src/txt/asset_font_manager.cc similarity index 79% rename from engine/src/flutter/third_party/txt/src/txt/asset_font_manager.cc rename to engine/src/flutter/txt/src/txt/asset_font_manager.cc index c9952e85e8..1a668dcdf4 100644 --- a/engine/src/flutter/third_party/txt/src/txt/asset_font_manager.cc +++ b/engine/src/flutter/txt/src/txt/asset_font_manager.cc @@ -1,18 +1,6 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. #include "txt/asset_font_manager.h" @@ -56,8 +44,9 @@ sk_sp AssetFontManager::onMatchFamilyStyle( const SkFontStyle& style) const { sk_sp font_style_set = font_provider_->MatchFamily(std::string(familyName)); - if (font_style_set == nullptr) + if (font_style_set == nullptr) { return nullptr; + } return font_style_set->matchStyle(style); } diff --git a/engine/src/flutter/third_party/txt/src/txt/asset_font_manager.h b/engine/src/flutter/txt/src/txt/asset_font_manager.h similarity index 76% rename from engine/src/flutter/third_party/txt/src/txt/asset_font_manager.h rename to engine/src/flutter/txt/src/txt/asset_font_manager.h index 4c1e34c17f..f0dd96a4e6 100644 --- a/engine/src/flutter/third_party/txt/src/txt/asset_font_manager.h +++ b/engine/src/flutter/txt/src/txt/asset_font_manager.h @@ -1,21 +1,9 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. -#ifndef TXT_ASSET_FONT_MANAGER_H_ -#define TXT_ASSET_FONT_MANAGER_H_ +#ifndef FLUTTER_TXT_SRC_TXT_ASSET_FONT_MANAGER_H_ +#define FLUTTER_TXT_SRC_TXT_ASSET_FONT_MANAGER_H_ #include #include @@ -96,4 +84,4 @@ class DynamicFontManager : public AssetFontManager { } // namespace txt -#endif // TXT_ASSET_FONT_MANAGER_H_ +#endif // FLUTTER_TXT_SRC_TXT_ASSET_FONT_MANAGER_H_ diff --git a/engine/src/flutter/txt/src/txt/font_asset_provider.cc b/engine/src/flutter/txt/src/txt/font_asset_provider.cc new file mode 100644 index 0000000000..c65b5406db --- /dev/null +++ b/engine/src/flutter/txt/src/txt/font_asset_provider.cc @@ -0,0 +1,24 @@ +// 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. + +#include +#include + +#include "txt/font_asset_provider.h" + +namespace txt { + +// Return a canonicalized version of a family name that is suitable for +// matching. +std::string FontAssetProvider::CanonicalFamilyName(std::string family_name) { + std::string result(family_name.length(), 0); + + // Convert ASCII characters to lower case. + std::transform(family_name.begin(), family_name.end(), result.begin(), + [](char c) { return (c & 0x80) ? c : ::tolower(c); }); + + return result; +} + +} // namespace txt diff --git a/engine/src/flutter/txt/src/txt/font_asset_provider.h b/engine/src/flutter/txt/src/txt/font_asset_provider.h new file mode 100644 index 0000000000..ccc9b347a7 --- /dev/null +++ b/engine/src/flutter/txt/src/txt/font_asset_provider.h @@ -0,0 +1,28 @@ +// 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. + +#ifndef FLUTTER_TXT_SRC_TXT_FONT_ASSET_PROVIDER_H_ +#define FLUTTER_TXT_SRC_TXT_FONT_ASSET_PROVIDER_H_ + +#include + +#include "third_party/skia/include/core/SkFontMgr.h" + +namespace txt { + +class FontAssetProvider { + public: + virtual ~FontAssetProvider() = default; + + virtual size_t GetFamilyCount() const = 0; + virtual std::string GetFamilyName(int index) const = 0; + virtual sk_sp MatchFamily(const std::string& family_name) = 0; + + protected: + static std::string CanonicalFamilyName(std::string family_name); +}; + +} // namespace txt + +#endif // FLUTTER_TXT_SRC_TXT_FONT_ASSET_PROVIDER_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/font_collection.cc b/engine/src/flutter/txt/src/txt/font_collection.cc similarity index 75% rename from engine/src/flutter/third_party/txt/src/txt/font_collection.cc rename to engine/src/flutter/txt/src/txt/font_collection.cc index 5cef503cb8..665ca01f0c 100644 --- a/engine/src/flutter/third_party/txt/src/txt/font_collection.cc +++ b/engine/src/flutter/txt/src/txt/font_collection.cc @@ -1,18 +1,6 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. #include "font_collection.h" @@ -50,36 +38,40 @@ void FontCollection::SetupDefaultFontManager( } void FontCollection::SetDefaultFontManager(sk_sp font_manager) { - default_font_manager_ = font_manager; + default_font_manager_ = std::move(font_manager); skt_collection_.reset(); } void FontCollection::SetAssetFontManager(sk_sp font_manager) { - asset_font_manager_ = font_manager; + asset_font_manager_ = std::move(font_manager); skt_collection_.reset(); } void FontCollection::SetDynamicFontManager(sk_sp font_manager) { - dynamic_font_manager_ = font_manager; + dynamic_font_manager_ = std::move(font_manager); skt_collection_.reset(); } void FontCollection::SetTestFontManager(sk_sp font_manager) { - test_font_manager_ = font_manager; + test_font_manager_ = std::move(font_manager); skt_collection_.reset(); } // Return the available font managers in the order they should be queried. std::vector> FontCollection::GetFontManagerOrder() const { std::vector> order; - if (dynamic_font_manager_) + if (dynamic_font_manager_) { order.push_back(dynamic_font_manager_); - if (asset_font_manager_) + } + if (asset_font_manager_) { order.push_back(asset_font_manager_); - if (test_font_manager_) + } + if (test_font_manager_) { order.push_back(test_font_manager_); - if (default_font_manager_) + } + if (default_font_manager_) { order.push_back(default_font_manager_); + } return order; } diff --git a/engine/src/flutter/third_party/txt/src/txt/font_collection.h b/engine/src/flutter/txt/src/txt/font_collection.h similarity index 71% rename from engine/src/flutter/third_party/txt/src/txt/font_collection.h rename to engine/src/flutter/txt/src/txt/font_collection.h index 08631bef8a..6727723cf3 100644 --- a/engine/src/flutter/third_party/txt/src/txt/font_collection.h +++ b/engine/src/flutter/txt/src/txt/font_collection.h @@ -1,21 +1,9 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. -#ifndef LIB_TXT_SRC_FONT_COLLECTION_H_ -#define LIB_TXT_SRC_FONT_COLLECTION_H_ +#ifndef FLUTTER_TXT_SRC_TXT_FONT_COLLECTION_H_ +#define FLUTTER_TXT_SRC_TXT_FONT_COLLECTION_H_ #include #include @@ -73,4 +61,4 @@ class FontCollection : public std::enable_shared_from_this { } // namespace txt -#endif // LIB_TXT_SRC_FONT_COLLECTION_H_ +#endif // FLUTTER_TXT_SRC_TXT_FONT_COLLECTION_H_ diff --git a/engine/src/flutter/txt/src/txt/font_features.cc b/engine/src/flutter/txt/src/txt/font_features.cc new file mode 100644 index 0000000000..c591923b3d --- /dev/null +++ b/engine/src/flutter/txt/src/txt/font_features.cc @@ -0,0 +1,44 @@ +// 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. + +#include "font_features.h" + +#include + +namespace txt { + +void FontFeatures::SetFeature(const std::string& tag, int value) { + feature_map_[tag] = value; +} + +std::string FontFeatures::GetFeatureSettings() const { + if (feature_map_.empty()) { + return ""; + } + + std::ostringstream stream; + + for (const auto& kv : feature_map_) { + if (stream.tellp()) { + stream << ','; + } + stream << kv.first << '=' << kv.second; + } + + return stream.str(); +} + +const std::map& FontFeatures::GetFontFeatures() const { + return feature_map_; +} + +void FontVariations::SetAxisValue(const std::string& tag, float value) { + axis_map_[tag] = value; +} + +const std::map& FontVariations::GetAxisValues() const { + return axis_map_; +} + +} // namespace txt diff --git a/engine/src/flutter/txt/src/txt/font_features.h b/engine/src/flutter/txt/src/txt/font_features.h new file mode 100644 index 0000000000..cb8e4dd520 --- /dev/null +++ b/engine/src/flutter/txt/src/txt/font_features.h @@ -0,0 +1,42 @@ +// 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. + +#ifndef FLUTTER_TXT_SRC_TXT_FONT_FEATURES_H_ +#define FLUTTER_TXT_SRC_TXT_FONT_FEATURES_H_ + +#include +#include +#include + +namespace txt { + +// Feature tags that can be applied in a text style to control how a font +// selects glyphs. +class FontFeatures { + public: + void SetFeature(const std::string& tag, int value); + + std::string GetFeatureSettings() const; + + const std::map& GetFontFeatures() const; + + private: + std::map feature_map_; +}; + +// Axis tags and values that can be applied in a text style to control the +// attributes of variable fonts. +class FontVariations { + public: + void SetAxisValue(const std::string& tag, float value); + + const std::map& GetAxisValues() const; + + private: + std::map axis_map_; +}; + +} // namespace txt + +#endif // FLUTTER_TXT_SRC_TXT_FONT_FEATURES_H_ diff --git a/engine/src/flutter/txt/src/txt/font_style.h b/engine/src/flutter/txt/src/txt/font_style.h new file mode 100644 index 0000000000..b3163ef1d0 --- /dev/null +++ b/engine/src/flutter/txt/src/txt/font_style.h @@ -0,0 +1,19 @@ +// 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. + +#ifndef FLUTTER_TXT_SRC_TXT_FONT_STYLE_H_ +#define FLUTTER_TXT_SRC_TXT_FONT_STYLE_H_ + +namespace txt { + +enum class FontStyle { + // NOLINTBEGIN(readability-identifier-naming) + normal, + italic, + // NOLINTEND(readability-identifier-naming) +}; + +} // namespace txt + +#endif // FLUTTER_TXT_SRC_TXT_FONT_STYLE_H_ diff --git a/engine/src/flutter/txt/src/txt/font_weight.h b/engine/src/flutter/txt/src/txt/font_weight.h new file mode 100644 index 0000000000..4664a42fbe --- /dev/null +++ b/engine/src/flutter/txt/src/txt/font_weight.h @@ -0,0 +1,26 @@ +// 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. + +#ifndef FLUTTER_TXT_SRC_TXT_FONT_WEIGHT_H_ +#define FLUTTER_TXT_SRC_TXT_FONT_WEIGHT_H_ + +namespace txt { + +enum class FontWeight { + // NOLINTBEGIN(readability-identifier-naming) + w100, // Thin + w200, // Extra-Light + w300, // Light + w400, // Normal/Regular + w500, // Medium + w600, // Semi-bold + w700, // Bold + w800, // Extra-Bold + w900, // Black + // NOLINTEND(readability-identifier-naming) +}; + +} // namespace txt + +#endif // FLUTTER_TXT_SRC_TXT_FONT_WEIGHT_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/line_metrics.h b/engine/src/flutter/txt/src/txt/line_metrics.h similarity index 75% rename from engine/src/flutter/third_party/txt/src/txt/line_metrics.h rename to engine/src/flutter/txt/src/txt/line_metrics.h index 2efd538c71..1dc77900f0 100644 --- a/engine/src/flutter/third_party/txt/src/txt/line_metrics.h +++ b/engine/src/flutter/txt/src/txt/line_metrics.h @@ -1,21 +1,9 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. -#ifndef LIB_TXT_SRC_LINE_METRICS_H_ -#define LIB_TXT_SRC_LINE_METRICS_H_ +#ifndef FLUTTER_TXT_SRC_TXT_LINE_METRICS_H_ +#define FLUTTER_TXT_SRC_TXT_LINE_METRICS_H_ #include #include @@ -83,4 +71,4 @@ class LineMetrics { } // namespace txt -#endif // LIB_TXT_SRC_LINE_METRICS_H_ +#endif // FLUTTER_TXT_SRC_TXT_LINE_METRICS_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/paragraph.h b/engine/src/flutter/txt/src/txt/paragraph.h similarity index 90% rename from engine/src/flutter/third_party/txt/src/txt/paragraph.h rename to engine/src/flutter/txt/src/txt/paragraph.h index 4655ca219e..bf0f2385e3 100644 --- a/engine/src/flutter/third_party/txt/src/txt/paragraph.h +++ b/engine/src/flutter/txt/src/txt/paragraph.h @@ -1,22 +1,9 @@ +// 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. -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef LIB_TXT_SRC_PARAGRAPH_H_ -#define LIB_TXT_SRC_PARAGRAPH_H_ +#ifndef FLUTTER_TXT_SRC_TXT_PARAGRAPH_H_ +#define FLUTTER_TXT_SRC_TXT_PARAGRAPH_H_ #include "flutter/display_list/dl_builder.h" #include "line_metrics.h" @@ -34,6 +21,7 @@ namespace txt { // Skia's SkShaper/SkParagraph text layout module. class Paragraph { public: + // NOLINTNEXTLINE(readability-identifier-naming) enum Affinity { UPSTREAM, DOWNSTREAM }; // Options for various types of bounding boxes provided by @@ -210,4 +198,4 @@ class Paragraph { } // namespace txt -#endif // LIB_TXT_SRC_PARAGRAPH_H_ +#endif // FLUTTER_TXT_SRC_TXT_PARAGRAPH_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/paragraph_builder.cc b/engine/src/flutter/txt/src/txt/paragraph_builder.cc similarity index 53% rename from engine/src/flutter/third_party/txt/src/txt/paragraph_builder.cc rename to engine/src/flutter/txt/src/txt/paragraph_builder.cc index 41dd9b1a89..e2d5b6adbc 100644 --- a/engine/src/flutter/third_party/txt/src/txt/paragraph_builder.cc +++ b/engine/src/flutter/txt/src/txt/paragraph_builder.cc @@ -1,22 +1,10 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. #include "paragraph_builder.h" -#include "flutter/third_party/txt/src/skia/paragraph_builder_skia.h" +#include "flutter/txt/src/skia/paragraph_builder_skia.h" #include "paragraph_style.h" #include "third_party/icu/source/common/unicode/unistr.h" @@ -30,7 +18,7 @@ namespace txt { /// @param[in] impeller_enabled Whether Impeller is enabled in the runtime. std::unique_ptr ParagraphBuilder::CreateSkiaBuilder( const ParagraphStyle& style, - std::shared_ptr font_collection, + const std::shared_ptr& font_collection, const bool impeller_enabled) { return std::make_unique(style, font_collection, impeller_enabled); diff --git a/engine/src/flutter/third_party/txt/src/txt/paragraph_builder.h b/engine/src/flutter/txt/src/txt/paragraph_builder.h similarity index 73% rename from engine/src/flutter/third_party/txt/src/txt/paragraph_builder.h rename to engine/src/flutter/txt/src/txt/paragraph_builder.h index 573f9b218b..ff077f4b68 100644 --- a/engine/src/flutter/third_party/txt/src/txt/paragraph_builder.h +++ b/engine/src/flutter/txt/src/txt/paragraph_builder.h @@ -1,21 +1,9 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. -#ifndef LIB_TXT_SRC_PARAGRAPH_BUILDER_H_ -#define LIB_TXT_SRC_PARAGRAPH_BUILDER_H_ +#ifndef FLUTTER_TXT_SRC_TXT_PARAGRAPH_BUILDER_H_ +#define FLUTTER_TXT_SRC_TXT_PARAGRAPH_BUILDER_H_ #include #include @@ -33,7 +21,7 @@ class ParagraphBuilder { public: static std::unique_ptr CreateSkiaBuilder( const ParagraphStyle& style, - std::shared_ptr font_collection, + const std::shared_ptr& font_collection, const bool impeller_enabled); virtual ~ParagraphBuilder() = default; @@ -89,4 +77,4 @@ class ParagraphBuilder { } // namespace txt -#endif // LIB_TXT_SRC_PARAGRAPH_BUILDER_H_ +#endif // FLUTTER_TXT_SRC_TXT_PARAGRAPH_BUILDER_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/paragraph_style.cc b/engine/src/flutter/txt/src/txt/paragraph_style.cc similarity index 65% rename from engine/src/flutter/third_party/txt/src/txt/paragraph_style.cc rename to engine/src/flutter/txt/src/txt/paragraph_style.cc index 06a4feca71..54fc7a326a 100644 --- a/engine/src/flutter/third_party/txt/src/txt/paragraph_style.cc +++ b/engine/src/flutter/txt/src/txt/paragraph_style.cc @@ -1,18 +1,6 @@ -/* - * Copyright 2017 Google, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. #include "paragraph_style.h" diff --git a/engine/src/flutter/third_party/txt/src/txt/paragraph_style.h b/engine/src/flutter/txt/src/txt/paragraph_style.h similarity index 78% rename from engine/src/flutter/third_party/txt/src/txt/paragraph_style.h rename to engine/src/flutter/txt/src/txt/paragraph_style.h index 7c3043b8ad..4f319a53bc 100644 --- a/engine/src/flutter/third_party/txt/src/txt/paragraph_style.h +++ b/engine/src/flutter/txt/src/txt/paragraph_style.h @@ -1,21 +1,9 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. -#ifndef LIB_TXT_SRC_PARAGRAPH_STYLE_H_ -#define LIB_TXT_SRC_PARAGRAPH_STYLE_H_ +#ifndef FLUTTER_TXT_SRC_TXT_PARAGRAPH_STYLE_H_ +#define FLUTTER_TXT_SRC_TXT_PARAGRAPH_STYLE_H_ #include #include @@ -27,17 +15,21 @@ namespace txt { enum class TextAlign { + // NOLINTBEGIN(readability-identifier-naming) left, right, center, justify, start, end, + // NOLINTEND(readability-identifier-naming) }; enum class TextDirection { + // NOLINTBEGIN(readability-identifier-naming) rtl, ltr, + // NOLINTEND(readability-identifier-naming) }; // Adjusts the leading over and under text. @@ -106,4 +98,4 @@ class ParagraphStyle { } // namespace txt -#endif // LIB_TXT_SRC_PARAGRAPH_STYLE_H_ +#endif // FLUTTER_TXT_SRC_TXT_PARAGRAPH_STYLE_H_ diff --git a/engine/src/flutter/txt/src/txt/placeholder_run.cc b/engine/src/flutter/txt/src/txt/placeholder_run.cc new file mode 100644 index 0000000000..4fddcb528c --- /dev/null +++ b/engine/src/flutter/txt/src/txt/placeholder_run.cc @@ -0,0 +1,22 @@ +// 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. + +#include "placeholder_run.h" + +namespace txt { + +PlaceholderRun::PlaceholderRun() {} + +PlaceholderRun::PlaceholderRun(double width, + double height, + PlaceholderAlignment alignment, + TextBaseline baseline, + double baseline_offset) + : width(width), + height(height), + alignment(alignment), + baseline(baseline), + baseline_offset(baseline_offset) {} + +} // namespace txt diff --git a/engine/src/flutter/third_party/txt/src/txt/placeholder_run.h b/engine/src/flutter/txt/src/txt/placeholder_run.h similarity index 76% rename from engine/src/flutter/third_party/txt/src/txt/placeholder_run.h rename to engine/src/flutter/txt/src/txt/placeholder_run.h index ed0c5de123..d8cdc0750c 100644 --- a/engine/src/flutter/third_party/txt/src/txt/placeholder_run.h +++ b/engine/src/flutter/txt/src/txt/placeholder_run.h @@ -1,21 +1,9 @@ -/* - * Copyright 2019 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. -#ifndef LIB_TXT_SRC_PLACEHOLDER_RUN_H_ -#define LIB_TXT_SRC_PLACEHOLDER_RUN_H_ +#ifndef FLUTTER_TXT_SRC_TXT_PLACEHOLDER_RUN_H_ +#define FLUTTER_TXT_SRC_TXT_PLACEHOLDER_RUN_H_ #include "text_baseline.h" @@ -86,4 +74,4 @@ class PlaceholderRun { } // namespace txt -#endif // LIB_TXT_SRC_PLACEHOLDER_RUN_H_ +#endif // FLUTTER_TXT_SRC_TXT_PLACEHOLDER_RUN_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/platform.cc b/engine/src/flutter/txt/src/txt/platform.cc similarity index 100% rename from engine/src/flutter/third_party/txt/src/txt/platform.cc rename to engine/src/flutter/txt/src/txt/platform.cc diff --git a/engine/src/flutter/third_party/txt/src/txt/platform.h b/engine/src/flutter/txt/src/txt/platform.h similarity index 78% rename from engine/src/flutter/third_party/txt/src/txt/platform.h rename to engine/src/flutter/txt/src/txt/platform.h index 7ce2dd2e1c..8351a9b1a9 100644 --- a/engine/src/flutter/third_party/txt/src/txt/platform.h +++ b/engine/src/flutter/txt/src/txt/platform.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef TXT_PLATFORM_H_ -#define TXT_PLATFORM_H_ +#ifndef FLUTTER_TXT_SRC_TXT_PLATFORM_H_ +#define FLUTTER_TXT_SRC_TXT_PLATFORM_H_ #include #include @@ -19,4 +19,4 @@ sk_sp GetDefaultFontManager(uint32_t font_initialization_data = 0); } // namespace txt -#endif // TXT_PLATFORM_H_ +#endif // FLUTTER_TXT_SRC_TXT_PLATFORM_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/platform_android.cc b/engine/src/flutter/txt/src/txt/platform_android.cc similarity index 100% rename from engine/src/flutter/third_party/txt/src/txt/platform_android.cc rename to engine/src/flutter/txt/src/txt/platform_android.cc diff --git a/engine/src/flutter/third_party/txt/src/txt/platform_fuchsia.cc b/engine/src/flutter/txt/src/txt/platform_fuchsia.cc similarity index 100% rename from engine/src/flutter/third_party/txt/src/txt/platform_fuchsia.cc rename to engine/src/flutter/txt/src/txt/platform_fuchsia.cc diff --git a/engine/src/flutter/third_party/txt/src/txt/platform_linux.cc b/engine/src/flutter/txt/src/txt/platform_linux.cc similarity index 100% rename from engine/src/flutter/third_party/txt/src/txt/platform_linux.cc rename to engine/src/flutter/txt/src/txt/platform_linux.cc diff --git a/engine/src/flutter/third_party/txt/src/txt/platform_mac.h b/engine/src/flutter/txt/src/txt/platform_mac.h similarity index 73% rename from engine/src/flutter/third_party/txt/src/txt/platform_mac.h rename to engine/src/flutter/txt/src/txt/platform_mac.h index 7ff2e0d391..f24f9fb59b 100644 --- a/engine/src/flutter/third_party/txt/src/txt/platform_mac.h +++ b/engine/src/flutter/txt/src/txt/platform_mac.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef TXT_PLATFORM_MAC_H_ -#define TXT_PLATFORM_MAC_H_ +#ifndef FLUTTER_TXT_SRC_TXT_PLATFORM_MAC_H_ +#define FLUTTER_TXT_SRC_TXT_PLATFORM_MAC_H_ #include "txt/asset_font_manager.h" @@ -14,4 +14,4 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager); } // namespace txt -#endif // TXT_PLATFORM_MAC_H_ +#endif // FLUTTER_TXT_SRC_TXT_PLATFORM_MAC_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/platform_mac.mm b/engine/src/flutter/txt/src/txt/platform_mac.mm similarity index 100% rename from engine/src/flutter/third_party/txt/src/txt/platform_mac.mm rename to engine/src/flutter/txt/src/txt/platform_mac.mm diff --git a/engine/src/flutter/third_party/txt/src/txt/platform_windows.cc b/engine/src/flutter/txt/src/txt/platform_windows.cc similarity index 100% rename from engine/src/flutter/third_party/txt/src/txt/platform_windows.cc rename to engine/src/flutter/txt/src/txt/platform_windows.cc diff --git a/engine/src/flutter/third_party/txt/src/txt/run_metrics.h b/engine/src/flutter/txt/src/txt/run_metrics.h similarity index 65% rename from engine/src/flutter/third_party/txt/src/txt/run_metrics.h rename to engine/src/flutter/txt/src/txt/run_metrics.h index aa43793208..99bc2c000b 100644 --- a/engine/src/flutter/third_party/txt/src/txt/run_metrics.h +++ b/engine/src/flutter/txt/src/txt/run_metrics.h @@ -1,21 +1,9 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. -#ifndef LIB_TXT_SRC_RUN_METRICS_H_ -#define LIB_TXT_SRC_RUN_METRICS_H_ +#ifndef FLUTTER_TXT_SRC_TXT_RUN_METRICS_H_ +#define FLUTTER_TXT_SRC_TXT_RUN_METRICS_H_ #include "text_style.h" #include "third_party/skia/include/core/SkFontMetrics.h" @@ -54,4 +42,4 @@ class RunMetrics { } // namespace txt -#endif // LIB_TXT_SRC_RUN_METRICS_H_ +#endif // FLUTTER_TXT_SRC_TXT_RUN_METRICS_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/test_font_manager.cc b/engine/src/flutter/txt/src/txt/test_font_manager.cc similarity index 57% rename from engine/src/flutter/third_party/txt/src/txt/test_font_manager.cc rename to engine/src/flutter/txt/src/txt/test_font_manager.cc index 4fe5e33e0e..456a05ed4d 100644 --- a/engine/src/flutter/third_party/txt/src/txt/test_font_manager.cc +++ b/engine/src/flutter/txt/src/txt/test_font_manager.cc @@ -1,18 +1,6 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. #include "txt/test_font_manager.h" #include "flutter/fml/logging.h" @@ -23,7 +11,7 @@ TestFontManager::TestFontManager( std::unique_ptr font_provider, std::vector test_font_family_names) : AssetFontManager(std::move(font_provider)), - test_font_family_names_(test_font_family_names) {} + test_font_family_names_(std::move(test_font_family_names)) {} TestFontManager::~TestFontManager() = default; diff --git a/engine/src/flutter/third_party/txt/src/txt/test_font_manager.h b/engine/src/flutter/txt/src/txt/test_font_manager.h similarity index 52% rename from engine/src/flutter/third_party/txt/src/txt/test_font_manager.h rename to engine/src/flutter/txt/src/txt/test_font_manager.h index ffd1d56660..18b33b69b0 100644 --- a/engine/src/flutter/third_party/txt/src/txt/test_font_manager.h +++ b/engine/src/flutter/txt/src/txt/test_font_manager.h @@ -1,21 +1,9 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. -#ifndef TXT_TEST_FONT_MANAGER_H_ -#define TXT_TEST_FONT_MANAGER_H_ +#ifndef FLUTTER_TXT_SRC_TXT_TEST_FONT_MANAGER_H_ +#define FLUTTER_TXT_SRC_TXT_TEST_FONT_MANAGER_H_ #include #include @@ -47,4 +35,4 @@ class TestFontManager : public AssetFontManager { } // namespace txt -#endif // TXT_TEST_FONT_MANAGER_H_ +#endif // FLUTTER_TXT_SRC_TXT_TEST_FONT_MANAGER_H_ diff --git a/engine/src/flutter/txt/src/txt/text_baseline.h b/engine/src/flutter/txt/src/txt/text_baseline.h new file mode 100644 index 0000000000..edb1ae7c65 --- /dev/null +++ b/engine/src/flutter/txt/src/txt/text_baseline.h @@ -0,0 +1,17 @@ +// 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. + +#ifndef FLUTTER_TXT_SRC_TXT_TEXT_BASELINE_H_ +#define FLUTTER_TXT_SRC_TXT_TEXT_BASELINE_H_ + +namespace txt { + +enum TextBaseline { + kAlphabetic, + kIdeographic, +}; + +} // namespace txt + +#endif // FLUTTER_TXT_SRC_TXT_TEXT_BASELINE_H_ diff --git a/engine/src/flutter/txt/src/txt/text_decoration.cc b/engine/src/flutter/txt/src/txt/text_decoration.cc new file mode 100644 index 0000000000..37b0d0ce7d --- /dev/null +++ b/engine/src/flutter/txt/src/txt/text_decoration.cc @@ -0,0 +1,14 @@ +// 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. + +#include +#include + +#include "text_decoration.h" + +namespace txt { + +// + +} // namespace txt diff --git a/engine/src/flutter/txt/src/txt/text_decoration.h b/engine/src/flutter/txt/src/txt/text_decoration.h new file mode 100644 index 0000000000..0b4d578579 --- /dev/null +++ b/engine/src/flutter/txt/src/txt/text_decoration.h @@ -0,0 +1,23 @@ +// 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. + +#ifndef FLUTTER_TXT_SRC_TXT_TEXT_DECORATION_H_ +#define FLUTTER_TXT_SRC_TXT_TEXT_DECORATION_H_ + +namespace txt { + +// Multiple decorations can be applied at once. Ex: Underline and overline is +// (0x1 | 0x2) +enum TextDecoration { + kNone = 0x0, + kUnderline = 0x1, + kOverline = 0x2, + kLineThrough = 0x4, +}; + +enum TextDecorationStyle { kSolid, kDouble, kDotted, kDashed, kWavy }; + +} // namespace txt + +#endif // FLUTTER_TXT_SRC_TXT_TEXT_DECORATION_H_ diff --git a/engine/src/flutter/txt/src/txt/text_shadow.cc b/engine/src/flutter/txt/src/txt/text_shadow.cc new file mode 100644 index 0000000000..7c4c317734 --- /dev/null +++ b/engine/src/flutter/txt/src/txt/text_shadow.cc @@ -0,0 +1,43 @@ +// 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. + +#include "text_shadow.h" +#include "third_party/skia/include/core/SkColor.h" + +namespace txt { + +TextShadow::TextShadow() {} +TextShadow::TextShadow(SkColor color, SkPoint offset, double blur_sigma) + : color(color), offset(offset), blur_sigma(blur_sigma) {} + +bool TextShadow::operator==(const TextShadow& other) const { + if (color != other.color) { + return false; + } + if (offset != other.offset) { + return false; + } + if (blur_sigma != other.blur_sigma) { + return false; + } + + return true; +} + +bool TextShadow::operator!=(const TextShadow& other) const { + return !(*this == other); +} + +bool TextShadow::hasShadow() const { + if (!offset.isZero()) { + return true; + } + if (blur_sigma > 0.5) { + return true; + } + + return false; +} + +} // namespace txt diff --git a/engine/src/flutter/txt/src/txt/text_shadow.h b/engine/src/flutter/txt/src/txt/text_shadow.h new file mode 100644 index 0000000000..1bce21074b --- /dev/null +++ b/engine/src/flutter/txt/src/txt/text_shadow.h @@ -0,0 +1,32 @@ +// 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. + +#ifndef FLUTTER_TXT_SRC_TXT_TEXT_SHADOW_H_ +#define FLUTTER_TXT_SRC_TXT_TEXT_SHADOW_H_ + +#include "third_party/skia/include/core/SkColor.h" +#include "third_party/skia/include/core/SkPoint.h" + +namespace txt { + +class TextShadow { + public: + SkColor color = SK_ColorBLACK; + SkPoint offset; + double blur_sigma = 0.0; + + TextShadow(); + + TextShadow(SkColor color, SkPoint offset, double blur_sigma); + + bool operator==(const TextShadow& other) const; + + bool operator!=(const TextShadow& other) const; + + bool hasShadow() const; +}; + +} // namespace txt + +#endif // FLUTTER_TXT_SRC_TXT_TEXT_SHADOW_H_ diff --git a/engine/src/flutter/txt/src/txt/text_style.cc b/engine/src/flutter/txt/src/txt/text_style.cc new file mode 100644 index 0000000000..1ca8299239 --- /dev/null +++ b/engine/src/flutter/txt/src/txt/text_style.cc @@ -0,0 +1,81 @@ +// 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. + +#include "text_style.h" + +#include "font_style.h" +#include "font_weight.h" +#include "third_party/skia/include/core/SkColor.h" +#include "txt/platform.h" + +namespace txt { + +TextStyle::TextStyle() : font_families(GetDefaultFontFamilies()) {} + +bool TextStyle::equals(const TextStyle& other) const { + if (color != other.color) { + return false; + } + if (decoration != other.decoration) { + return false; + } + if (decoration_color != other.decoration_color) { + return false; + } + if (decoration_style != other.decoration_style) { + return false; + } + if (decoration_thickness_multiplier != + other.decoration_thickness_multiplier) { + return false; + } + if (font_weight != other.font_weight) { + return false; + } + if (font_style != other.font_style) { + return false; + } + if (letter_spacing != other.letter_spacing) { + return false; + } + if (word_spacing != other.word_spacing) { + return false; + } + if (height != other.height) { + return false; + } + if (has_height_override != other.has_height_override) { + return false; + } + if (half_leading != other.half_leading) { + return false; + } + if (locale != other.locale) { + return false; + } + if (foreground != other.foreground) { + return false; + } + if (font_families.size() != other.font_families.size()) { + return false; + } + if (text_shadows.size() != other.text_shadows.size()) { + return false; + } + for (size_t font_index = 0; font_index < font_families.size(); ++font_index) { + if (font_families[font_index] != other.font_families[font_index]) { + return false; + } + } + for (size_t shadow_index = 0; shadow_index < text_shadows.size(); + ++shadow_index) { + if (text_shadows[shadow_index] != other.text_shadows[shadow_index]) { + return false; + } + } + + return true; +} + +} // namespace txt diff --git a/engine/src/flutter/third_party/txt/src/txt/text_style.h b/engine/src/flutter/txt/src/txt/text_style.h similarity index 71% rename from engine/src/flutter/third_party/txt/src/txt/text_style.h rename to engine/src/flutter/txt/src/txt/text_style.h index fc448f9241..285d13ebb1 100644 --- a/engine/src/flutter/third_party/txt/src/txt/text_style.h +++ b/engine/src/flutter/txt/src/txt/text_style.h @@ -1,21 +1,9 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. -#ifndef LIB_TXT_SRC_TEXT_STYLE_H_ -#define LIB_TXT_SRC_TEXT_STYLE_H_ +#ifndef FLUTTER_TXT_SRC_TXT_TEXT_STYLE_H_ +#define FLUTTER_TXT_SRC_TXT_TEXT_STYLE_H_ #include #include @@ -71,4 +59,4 @@ class TextStyle { } // namespace txt -#endif // LIB_TXT_SRC_TEXT_STYLE_H_ +#endif // FLUTTER_TXT_SRC_TXT_TEXT_STYLE_H_ diff --git a/engine/src/flutter/third_party/txt/src/txt/typeface_font_asset_provider.cc b/engine/src/flutter/txt/src/txt/typeface_font_asset_provider.cc similarity index 79% rename from engine/src/flutter/third_party/txt/src/txt/typeface_font_asset_provider.cc rename to engine/src/flutter/txt/src/txt/typeface_font_asset_provider.cc index a43acdd60b..de16a6ed24 100644 --- a/engine/src/flutter/third_party/txt/src/txt/typeface_font_asset_provider.cc +++ b/engine/src/flutter/txt/src/txt/typeface_font_asset_provider.cc @@ -1,18 +1,6 @@ -/* - * Copyright 2018 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. #include "txt/typeface_font_asset_provider.h" @@ -55,12 +43,12 @@ void TypefaceFontAssetProvider::RegisterTypeface(sk_sp typeface) { typeface->getFamilyName(&sk_family_name); std::string family_name(sk_family_name.c_str(), sk_family_name.size()); - RegisterTypeface(std::move(typeface), std::move(family_name)); + RegisterTypeface(std::move(typeface), family_name); } void TypefaceFontAssetProvider::RegisterTypeface( sk_sp typeface, - std::string family_name_alias) { + const std::string& family_name_alias) { if (family_name_alias.empty()) { return; } diff --git a/engine/src/flutter/third_party/txt/src/txt/typeface_font_asset_provider.h b/engine/src/flutter/txt/src/txt/typeface_font_asset_provider.h similarity index 66% rename from engine/src/flutter/third_party/txt/src/txt/typeface_font_asset_provider.h rename to engine/src/flutter/txt/src/txt/typeface_font_asset_provider.h index 6421ad6abf..70aa1f592a 100644 --- a/engine/src/flutter/third_party/txt/src/txt/typeface_font_asset_provider.h +++ b/engine/src/flutter/txt/src/txt/typeface_font_asset_provider.h @@ -1,21 +1,9 @@ -/* - * Copyright 2018 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. -#ifndef TXT_TYPEFACE_FONT_ASSET_PROVIDER_H_ -#define TXT_TYPEFACE_FONT_ASSET_PROVIDER_H_ +#ifndef FLUTTER_TXT_SRC_TXT_TYPEFACE_FONT_ASSET_PROVIDER_H_ +#define FLUTTER_TXT_SRC_TXT_TYPEFACE_FONT_ASSET_PROVIDER_H_ #include #include @@ -61,7 +49,7 @@ class TypefaceFontAssetProvider : public FontAssetProvider { void RegisterTypeface(sk_sp typeface); void RegisterTypeface(sk_sp typeface, - std::string family_name_alias); + const std::string& family_name_alias); // |FontAssetProvider| size_t GetFamilyCount() const override; @@ -82,4 +70,4 @@ class TypefaceFontAssetProvider : public FontAssetProvider { } // namespace txt -#endif // TXT_TYPEFACE_FONT_ASSET_PROVIDER_H_ +#endif // FLUTTER_TXT_SRC_TXT_TYPEFACE_FONT_ASSET_PROVIDER_H_ diff --git a/engine/src/flutter/third_party/txt/tests/font_collection_tests.cc b/engine/src/flutter/txt/tests/font_collection_tests.cc similarity index 55% rename from engine/src/flutter/third_party/txt/tests/font_collection_tests.cc rename to engine/src/flutter/txt/tests/font_collection_tests.cc index 051d378de1..af146bdafd 100644 --- a/engine/src/flutter/third_party/txt/tests/font_collection_tests.cc +++ b/engine/src/flutter/txt/tests/font_collection_tests.cc @@ -1,18 +1,6 @@ -/* - * Copyright 2017 Google, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. #include "gtest/gtest.h" diff --git a/engine/src/flutter/third_party/txt/tests/paragraph_builder_skia_tests.cc b/engine/src/flutter/txt/tests/paragraph_builder_skia_tests.cc similarity index 56% rename from engine/src/flutter/third_party/txt/tests/paragraph_builder_skia_tests.cc rename to engine/src/flutter/txt/tests/paragraph_builder_skia_tests.cc index 3131624be0..0250e2f4b7 100644 --- a/engine/src/flutter/third_party/txt/tests/paragraph_builder_skia_tests.cc +++ b/engine/src/flutter/txt/tests/paragraph_builder_skia_tests.cc @@ -1,18 +1,6 @@ -/* - * Copyright 2017 Google, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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. #include "gtest/gtest.h" diff --git a/engine/src/flutter/third_party/txt/tests/paragraph_unittests.cc b/engine/src/flutter/txt/tests/paragraph_unittests.cc similarity index 97% rename from engine/src/flutter/third_party/txt/tests/paragraph_unittests.cc rename to engine/src/flutter/txt/tests/paragraph_unittests.cc index 7a7385db1e..82af0b3b69 100644 --- a/engine/src/flutter/third_party/txt/tests/paragraph_unittests.cc +++ b/engine/src/flutter/txt/tests/paragraph_unittests.cc @@ -33,7 +33,6 @@ static const std::string kEmojiFontName = "Noto Color Emoji"; #endif - //------------------------------------------------------------------------------ /// @brief A custom |DlOpReceiver| that records some |DlOps| it receives. class DlOpRecorder final : public virtual DlOpReceiver, @@ -163,7 +162,7 @@ class PainterTestBase : public CanvasTestBase { auto c_font_fixture = std::string(kEmojiFontFile); auto mapping = flutter::testing::OpenFixtureAsSkData(c_font_fixture.c_str()); - auto typeface = txt::GetDefaultFontManager()->makeFromData(mapping); + auto typeface = txt::GetDefaultFontManager()->makeFromData(mapping); font_provider->RegisterTypeface(typeface); } @@ -285,8 +284,8 @@ TEST_F(PainterTest, DrawTextWithGradientImpeller) { std::vector colors = {DlColor::kRed(), DlColor::kCyan()}; std::vector stops = {0.0, 1.0}; foreground.setColorSource(DlColorSource::MakeLinear( - DlPoint(0, 0), DlPoint(100, 100), 2, colors.data(), - stops.data(), DlTileMode::kClamp)); + DlPoint(0, 0), DlPoint(100, 100), 2, colors.data(), stops.data(), + DlTileMode::kClamp)); style.foreground = foreground; auto recorder = DlOpRecorder(); @@ -306,8 +305,8 @@ TEST_F(PainterTest, DrawEmojiTextWithGradientImpeller) { std::vector colors = {DlColor::kRed(), DlColor::kCyan()}; std::vector stops = {0.0, 1.0}; foreground.setColorSource(DlColorSource::MakeLinear( - DlPoint(0, 0), DlPoint(100, 100), 2, colors.data(), - stops.data(), DlTileMode::kClamp)); + DlPoint(0, 0), DlPoint(100, 100), 2, colors.data(), stops.data(), + DlTileMode::kClamp)); style.foreground = foreground; auto recorder = DlOpRecorder(); diff --git a/engine/src/flutter/third_party/txt/tests/platform_mac_tests.cc b/engine/src/flutter/txt/tests/platform_mac_tests.cc similarity index 100% rename from engine/src/flutter/third_party/txt/tests/platform_mac_tests.cc rename to engine/src/flutter/txt/tests/platform_mac_tests.cc diff --git a/engine/src/flutter/txt/tests/txt_run_all_unittests.cc b/engine/src/flutter/txt/tests/txt_run_all_unittests.cc new file mode 100644 index 0000000000..6e4b56465d --- /dev/null +++ b/engine/src/flutter/txt/tests/txt_run_all_unittests.cc @@ -0,0 +1,12 @@ +// 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. + +#include "flutter/fml/backtrace.h" +#include "flutter/testing/testing.h" + +int main(int argc, char** argv) { + fml::InstallCrashHandler(); + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/engine/src/flutter/txt/tests/txt_test_utils.cc b/engine/src/flutter/txt/tests/txt_test_utils.cc new file mode 100644 index 0000000000..e06268d592 --- /dev/null +++ b/engine/src/flutter/txt/tests/txt_test_utils.cc @@ -0,0 +1,19 @@ +// 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. + +#include "txt_test_utils.h" + +namespace txt { + +static std::string gFontDir; + +const std::string& GetFontDir() { + return gFontDir; +} + +void SetFontDir(const std::string& dir) { + gFontDir = dir; +} + +} // namespace txt diff --git a/engine/src/flutter/txt/tests/txt_test_utils.h b/engine/src/flutter/txt/tests/txt_test_utils.h new file mode 100644 index 0000000000..90c0fb8e2b --- /dev/null +++ b/engine/src/flutter/txt/tests/txt_test_utils.h @@ -0,0 +1,18 @@ +// 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. + +#ifndef FLUTTER_TXT_TESTS_TXT_TEST_UTILS_H_ +#define FLUTTER_TXT_TESTS_TXT_TEST_UTILS_H_ + +#include + +namespace txt { + +const std::string& GetFontDir(); + +void SetFontDir(const std::string& dir); + +} // namespace txt + +#endif // FLUTTER_TXT_TESTS_TXT_TEST_UTILS_H_ diff --git a/engine/src/flutter/third_party/txt/third_party/fonts/HomemadeApple.ttf b/engine/src/flutter/txt/third_party/fonts/HomemadeApple.ttf similarity index 100% rename from engine/src/flutter/third_party/txt/third_party/fonts/HomemadeApple.ttf rename to engine/src/flutter/txt/third_party/fonts/HomemadeApple.ttf diff --git a/engine/src/flutter/third_party/txt/third_party/fonts/NotoColorEmoji.ttf b/engine/src/flutter/txt/third_party/fonts/NotoColorEmoji.ttf similarity index 100% rename from engine/src/flutter/third_party/txt/third_party/fonts/NotoColorEmoji.ttf rename to engine/src/flutter/txt/third_party/fonts/NotoColorEmoji.ttf diff --git a/engine/src/flutter/third_party/txt/third_party/fonts/NotoNaskhArabic-Regular.ttf b/engine/src/flutter/txt/third_party/fonts/NotoNaskhArabic-Regular.ttf similarity index 100% rename from engine/src/flutter/third_party/txt/third_party/fonts/NotoNaskhArabic-Regular.ttf rename to engine/src/flutter/txt/third_party/fonts/NotoNaskhArabic-Regular.ttf diff --git a/engine/src/flutter/third_party/txt/third_party/fonts/Roboto-Medium.ttf b/engine/src/flutter/txt/third_party/fonts/Roboto-Medium.ttf similarity index 100% rename from engine/src/flutter/third_party/txt/third_party/fonts/Roboto-Medium.ttf rename to engine/src/flutter/txt/third_party/fonts/Roboto-Medium.ttf diff --git a/engine/src/flutter/third_party/txt/third_party/fonts/Roboto-Regular.ttf b/engine/src/flutter/txt/third_party/fonts/Roboto-Regular.ttf similarity index 100% rename from engine/src/flutter/third_party/txt/third_party/fonts/Roboto-Regular.ttf rename to engine/src/flutter/txt/third_party/fonts/Roboto-Regular.ttf diff --git a/engine/src/flutter/third_party/txt/third_party/fonts/RobotoSlab-VariableFont_wght.ttf b/engine/src/flutter/txt/third_party/fonts/RobotoSlab-VariableFont_wght.ttf similarity index 100% rename from engine/src/flutter/third_party/txt/third_party/fonts/RobotoSlab-VariableFont_wght.ttf rename to engine/src/flutter/txt/third_party/fonts/RobotoSlab-VariableFont_wght.ttf diff --git a/engine/src/flutter/third_party/txt/third_party/fonts/ahem.ttf b/engine/src/flutter/txt/third_party/fonts/ahem.ttf similarity index 100% rename from engine/src/flutter/third_party/txt/third_party/fonts/ahem.ttf rename to engine/src/flutter/txt/third_party/fonts/ahem.ttf