From 4ab2db5307dd7382471592f22dfd6103ac9105e5 Mon Sep 17 00:00:00 2001 From: Swift Kim Date: Wed, 10 Feb 2021 09:01:27 +0900 Subject: [PATCH] Enable FontConfig to improve font fallbacks (#40) * Use LANG instead of LC_TIME to get default locale To make compatible with Tizen 4.0 * Enable FontConfig to improve font fallback * Copy icudtl.dat directly from third_party/icu For reduced size (878 KB, previously 11 MB) --- azure-pipelines.yml | 9 ++++----- shell/platform/tizen/channels/localization_channel.cc | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 81bb6b7b63e12..8e4dbb1f6e60b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -53,6 +53,7 @@ jobs: --target-sysroot `pwd`/tizen_tools/sysroot/$(arch) \ --target-triple $(targetTriple) \ --runtime-mode $(mode) \ + --enable-fontconfig \ --embedder-for-target \ --disable-desktop-embeddings \ --build-tizen-shell \ @@ -69,6 +70,7 @@ jobs: --target-sysroot `pwd`/tizen_tools/sysroot/$(arch)_40 \ --target-triple $(targetTriple) \ --runtime-mode $(mode) \ + --enable-fontconfig \ --embedder-for-target \ --disable-desktop-embeddings \ --build-tizen-shell \ @@ -83,9 +85,6 @@ jobs: cp default/out/linux_$(mode)_$(arch)/libflutter_tizen.so $OUTDIR cp tizen40/out/linux_$(mode)_$(arch)/libflutter_tizen.so $OUTDIR/libflutter_tizen40.so cp tizen40/out/linux_$(mode)_$(arch)/libflutter_engine.so $OUTDIR - if [ "$(System.JobName)" = "tizen-arm-release" ]; then - cp default/out/linux_$(mode)_$(arch)/icudtl.dat $OUTDIR - fi displayName: Copy artifacts workingDirectory: $(buildroot)/output failOnStderr: true @@ -115,12 +114,12 @@ jobs: cp -r $ROOT/common/cpp/client_wrapper/include common/client_wrapper cp $ROOT/tizen/public/*.h common/public cp $ROOT/tizen/LICENSE . - displayName: Copy peripherals + displayName: Copy headers workingDirectory: $(Build.BinariesDirectory) failOnStderr: true - bash: | + cp $(Pipeline.Workspace)/src/third_party/icu/flutter/icudtl.dat common mv $(Pipeline.Workspace)/tizen-* . - mv tizen-arm-release/icudtl.dat common for platform in linux windows darwin; do for mode in release profile; do curl -o tmp.zip https://storage.googleapis.com/flutter_infra/flutter/$(upstreamVersion)/android-arm-$mode/$platform-x64.zip 2> /dev/null diff --git a/shell/platform/tizen/channels/localization_channel.cc b/shell/platform/tizen/channels/localization_channel.cc index d1fd1672173fe..fcd2d146dfba8 100644 --- a/shell/platform/tizen/channels/localization_channel.cc +++ b/shell/platform/tizen/channels/localization_channel.cc @@ -25,7 +25,7 @@ void LocalizationChannel::SendLocales() { FlutterLocale* flutter_locale = nullptr; std::vector flutter_locales; - int ret = i18n_ulocale_set_default(getenv("LC_TIME")); + int ret = i18n_ulocale_set_default(getenv("LANG")); ret = i18n_ulocale_get_default(&defualt_locale); if (ret != I18N_ERROR_NONE) { FT_LOGE("i18n_ulocale_get_default() failed.");