diff --git a/flutter/README.md b/flutter/README.md new file mode 100644 index 0000000000000000000000000000000000000000..753ef026fd617de5d9f68f7bd0f2ab72e28f55e5 --- /dev/null +++ b/flutter/README.md @@ -0,0 +1,23 @@ +# ICU Data for Flutter + +This directory contains the minimal ICU data configuration for the Flutter +framework (https://flutter.io). It is based on Chromium's iOS configuration +(see `../ios`) with additional data stripped out to reduce size: + + * All resources mentioned in `flutter-removed-resources.txt` are stripped out. + * Additionally, `brkitr.patch` removes the break iterators for sentence and + title breaks as well as the CSS specific line break iterators. + +## Included Resources + + * Break iterators (and related dictionaries) for: + * Characters + * Words + * Lines + * Unicode Normalization Form KC (NFKC) + * Likely Subtags + + +## Known Issues + + * https://github.com/flutter/flutter/issues/19584 diff --git a/flutter/brkitr.patch b/flutter/brkitr.patch new file mode 100644 index 0000000000000000000000000000000000000000..02cc1995561023b1e0df80687700c2a5215e3e1e --- /dev/null +++ b/flutter/brkitr.patch @@ -0,0 +1,66 @@ +diff --git a/source/data/brkitr/brklocal.mk b/source/data/brkitr/brklocal.mk +index ea12e27f..462a2551 100644 +--- a/source/data/brkitr/brklocal.mk ++++ b/source/data/brkitr/brklocal.mk +@@ -39,14 +39,11 @@ BRK_DICT_SOURCE = burmesedict.txt khmerdict.txt laodict.txt\ + + + # List of break iterator files (brk). +-BRK_SOURCE = char.txt line.txt\ +- line_normal.txt line_normal_cj.txt line_normal_fi.txt\ +- line_loose_cj.txt\ +- sent.txt sent_el.txt title.txt word.txt word_ja.txt ++BRK_SOURCE = char.txt\ ++ line_normal.txt line_normal_fi.txt\ ++ word.txt word_ja.txt + + + # Ordinary resources +-BRK_RES_SOURCE = de.txt el.txt en.txt en_US.txt\ +- es.txt fi.txt fr.txt it.txt ja.txt\ +- pt.txt ru.txt zh.txt zh_Hant.txt ++BRK_RES_SOURCE =fi.txt ja.txt + +diff --git a/source/data/brkitr/fi.txt b/source/data/brkitr/fi.txt +index 72029ee4..633862a7 100644 +--- a/source/data/brkitr/fi.txt ++++ b/source/data/brkitr/fi.txt +@@ -4,8 +4,5 @@ fi{ + Version{"2.1.19.14"} + boundaries{ + line:process(dependency){"line_normal_fi.brk"} +- line_loose:process(dependency){"line_normal_fi.brk"} +- line_normal:process(dependency){"line_normal_fi.brk"} +- line_strict:process(dependency){"line_normal_fi.brk"} + } + } +diff --git a/source/data/brkitr/ja.txt b/source/data/brkitr/ja.txt +index cb732a76..73ebc6f8 100644 +--- a/source/data/brkitr/ja.txt ++++ b/source/data/brkitr/ja.txt +@@ -4,9 +4,6 @@ ja{ + Version{"2.1.29.25"} + boundaries{ + line:process(dependency){"line_normal.brk"} +- line_loose:process(dependency){"line_loose_cj.brk"} +- line_normal:process(dependency){"line_normal_cj.brk"} +- line_strict:process(dependency){"line.brk"} + word:process(dependency){"word_ja.brk"} + } + } +diff --git a/source/data/brkitr/root.txt b/source/data/brkitr/root.txt +index f1fa4e08..4071947a 100644 +--- a/source/data/brkitr/root.txt ++++ b/source/data/brkitr/root.txt +@@ -5,11 +5,6 @@ root{ + boundaries{ + grapheme:process(dependency){"char.brk"} + line:process(dependency){"line_normal.brk"} +- line_loose:process(dependency){"line_normal.brk"} +- line_normal:process(dependency){"line_normal.brk"} +- line_strict:process(dependency){"line.brk"} +- sentence:process(dependency){"sent.brk"} +- title:process(dependency){"title.brk"} + word:process(dependency){"word.brk"} + } + dictionaries{ diff --git a/flutter/flutter-removed-resources.txt b/flutter/flutter-removed-resources.txt index b600da1c9652d8cb2847d70d501c4111a9fdb242..fd8925011777d5c82759255b7a99817c9f5111c0 100644 --- a/flutter/flutter-removed-resources.txt +++ b/flutter/flutter-removed-resources.txt @@ -388,8 +388,9 @@ timezoneTypes.res windowsZones.res zoneinfo64.res -# *.cnv +# mappings/* big5-html.cnv +cnvalias.icu euc-jp-html.cnv euc-kr-html.cnv gb18030.cnv @@ -425,3 +426,5 @@ x-mac-cyrillic-html.cnv # other confusables.cfu +uts46.nrm +nfkc_cf.nrm diff --git a/flutter/icudtl.dat b/flutter/icudtl.dat index 91d0b16fcfdcd40cf333468f890e25e7a8fd2993..d9677abf8caf4eff7f2e679eafb6cc8c243e41dc 100644 Binary files a/flutter/icudtl.dat and b/flutter/icudtl.dat differ diff --git a/flutter/patch_brkitr.sh b/flutter/patch_brkitr.sh new file mode 100755 index 0000000000000000000000000000000000000000..c2246b662582802e9cae208a228b321aa9846771 --- /dev/null +++ b/flutter/patch_brkitr.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# Copyright (c) 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +treeroot="$(dirname "$0")/.." +cd "${treeroot}" + +echo "Applying brkitr.patch" +patch -p1 < flutter/brkitr.patch || { echo "failed to patch" >&2; exit 1; } diff --git a/scripts/make_data_all.sh b/scripts/make_data_all.sh index a1c2bcc83b8be1fff1575b18b9898f51ae2364d0..c7ac8696e8da0f0ac182ccbf3bb478fbb9702169 100755 --- a/scripts/make_data_all.sh +++ b/scripts/make_data_all.sh @@ -16,6 +16,8 @@ $ICUROOT/scripts/copy_data.sh android $ICUROOT/ios/patch_locale.sh $ICUROOT/scripts/make_data.sh $ICUROOT/scripts/copy_data.sh ios +$ICUROOT/flutter/patch_brkitr.sh +$ICUROOT/scripts/make_data.sh $ICUROOT/scripts/copy_data.sh flutter $ICUROOT/scripts/clean_up_data_source.sh