532 Commits

Author SHA1 Message Date
Colin Cross
fb9df9cc93 Export libicuuc headers from libminikin am: 6e0a223dbb am: 6d142f28d3
am: 4a43ef5fa8

Change-Id: Ied63cff24c4aaf0a2e99f8d55704350855ae6720
2017-05-03 02:43:13 +00:00
Colin Cross
4a43ef5fa8 Export libicuuc headers from libminikin am: 6e0a223dbb
am: 6d142f28d3

Change-Id: I64f9ef06af9b995cb87c832b8bf8d666a723f012
2017-05-03 02:40:43 +00:00
Colin Cross
6d142f28d3 Export libicuuc headers from libminikin
am: 6e0a223dbb

Change-Id: Iaf283ac61f0985bea25d0109918a05f0b8600045
2017-05-03 02:38:43 +00:00
Colin Cross
6e0a223dbb Export libicuuc headers from libminikin
Test: m -j checkbuild
Change-Id: Ibecebc8a1bd4028c083424476dd379c0ce0149a1
2017-05-02 17:18:48 -07:00
Fredrik Roubert
f0192ff7f2 Let mk_hyb_file.py replace SS in .chr.txt files with . am: fcb08dbdee am: 676a881f8f
am: 3bfee08b16

Change-Id: Ic360ebf8bc82e7ff9fd6d76d84a0257fda9ed136
2017-04-27 14:55:29 +00:00
Fredrik Roubert
3bfee08b16 Let mk_hyb_file.py replace SS in .chr.txt files with . am: fcb08dbdee
am: 676a881f8f

Change-Id: Ibdd3ccabf5dd4d8f5d0fe0f119027835bfd72443
2017-04-27 14:52:58 +00:00
Fredrik Roubert
676a881f8f Let mk_hyb_file.py replace SS in .chr.txt files with .
am: fcb08dbdee

Change-Id: I1c15bc7734bb78d1b5042d7080dfaf3b2cd3e6d8
2017-04-27 14:50:28 +00:00
Fredrik Roubert
fcb08dbdee Let mk_hyb_file.py replace ßSS in .chr.txt files with ßẞ.
Here these mappings are used to convert from uppercase to lowercase,
and mk_hyb_file.py doesn't handle multi-character uppercase sequences.
Therefore, in case the sequence ßSS is encountered in a .chr.txt,
replace it internally with ßẞ.

Test: make -j
Change-Id: I8f678aad9298784f70645c453ec07da5bf43cb66
2017-04-27 15:18:56 +02:00
Colin Cross
f3ba5a36bf Convert frameworks/minikin to Android.bp
See build/soong/README.md for more information.

Test: m -j checkbuild
Change-Id: I71d3406054b35dd4e8ae30f46eec6cef77eef160
(cherry picked from commit 716f07be94544d97039fbcb01df876e092d61d37)
2017-04-25 18:04:46 +00:00
Colin Cross
2ecf573f70 Convert frameworks/minikin to Android.bp am: befc483dfb am: 3767e39500
am: 5ebd9445c7  -s ours

Change-Id: I7bf4d9aed6132ff9073a7e6efe5b726958581575
2017-04-25 01:42:28 +00:00
Colin Cross
5ebd9445c7 Convert frameworks/minikin to Android.bp am: befc483dfb
am: 3767e39500

Change-Id: I21dd4bc68c78649974497a6b14b1d89fc4e1bf77
2017-04-25 01:26:51 +00:00
Colin Cross
3767e39500 Convert frameworks/minikin to Android.bp
am: befc483dfb

Change-Id: I622bfc09bab45aaaa7e621b1c10ff0ed5bd499a9
2017-04-25 01:24:56 +00:00
Colin Cross
befc483dfb Convert frameworks/minikin to Android.bp
See build/soong/README.md for more information.

Test: m -j checkbuild
Change-Id: I71d3406054b35dd4e8ae30f46eec6cef77eef160
Merged-In: I71d3406054b35dd4e8ae30f46eec6cef77eef160
2017-04-24 17:10:04 -07:00
Seigo Nonaka
e1ae48dec9 Reduce heap memory in minikin.
am: 97ee89d605

Change-Id: Ifb5bbba4ce7d452d844693409ac0ecad3168ed29
2017-04-15 00:59:39 +00:00
Seigo Nonaka
97ee89d605 Reduce heap memory in minikin.
This patch reduces about 73 kB memory.
The original SparseBitSet could contain full 32bit integers, but all of
that is not necessary for Unicode code points. By reducing the supported
range to up to Unicode maximum, U+10FFFF, we can save extra memory.

SparseBitSet holds 256-bit sliced pages and indices of them.
Previously, we needed to hold up to 2^24-1 pages for keeping 32-bit
integers.

This CL limits the number of pages to 2^16-1 (65535), so that
SparseBitSet only supports 24-bit integers now, but this is sufficient
for keeping all Unicode code points. With this change, we can change the
index integer type from uint32_t to uint16_t.

Bug: 37357593
Test: minikin_tests passes
Change-Id: I462cc27927752c942ac5da0bf303a5afb81b87a3
2017-04-14 22:54:27 +00:00
Seigo Nonaka
60d6553199 Support cmap tables with platform ID == 0
am: cc8f7117d3

Change-Id: I131af63678b32171b96299d8ded17baa7b6b09c4
2017-04-04 16:58:29 +00:00
Seigo Nonaka
cc8f7117d3 Support cmap tables with platform ID == 0
Some fonts don't have cmap subtables of Microsoft Platform ID (3) and
only have cmap subtables of Unicode Platform ID (0).

Bug: 32505843
Test: minikin_unittest passed
Test: android.graphics.cts.TypefaceTest passed
Change-Id: I24aa49860790c0ae8d8e578efd728b95ec0f93ae
2017-04-03 14:57:19 -07:00
Roozbeh Pournader
a6cf123565 Override the bidi properties of new emojis
am: d01462f7a1

Change-Id: Ic24100663716142a547fd2e2f2b6fcb551f7bdd0
2017-04-03 00:27:44 +00:00
Roozbeh Pournader
d01462f7a1 Override the bidi properties of new emojis
Test: new Minikin tests are added, and pass
Bug: 32952475
Change-Id: Ibcae60d18d0cd5efd7556aaf58a716b6b59c8ee0
2017-04-02 15:30:21 -07:00
Roozbeh Pournader
dba486668d Remove unused classes and methods
am: 7708c89648

Change-Id: I9d0e82f8f6cf4889c9e4bd0c229c77e66089a8b9
2017-03-31 03:09:32 +00:00
Roozbeh Pournader
7708c89648 Remove unused classes and methods
Removed Bitmap and MinikinFontFreeType classes, as well
as the Layout::draw() method.

The code was there for debugging purposes and for potential
third-party users. We no longer support third-party uses of
Minikin, since we don't know of any.

Test: mmma -j frameworks/minikin builds with no errors
Change-Id: Iddc9e8d35334053bd5255bccf3dbe5ba1eecf814
2017-03-30 17:52:56 -07:00
Seigo Nonaka
6a5534a437 Remove unused functions.
This CL is essentially reverting following changes:
- "Serialize and deserialize supported axes."
  I4086fb887e13f872390b533584bce6f1d5598ea0
- "Make SparseBitSet serializable."
  I0463138adcf234739bb3ce1cdadf382021921f3e

Bug: 36232655
Test: N/A
Change-Id: I25c701e1805e92b01034142147a9925f86533819
2017-03-22 16:00:35 -07:00
TreeHugger Robot
ad55a59727 Merge "Expose supportedAxes to frameworks/base" 2017-03-20 17:37:07 +00:00
Roozbeh Pournader
aa928e61b7 Relax requirement for text variation sequences
Previously, we insisted that in order for us to claim that a text variation
sequence is supported or to display it, it needs to be standardized already.
Now we accept any character as the base of a text variation sequence and
support it as far the font used to display it is not an emoji font.

Also fix a typo in a font name.

Test: Unit tests are updated and pass.

Bug: 30874706
Change-Id: I9660ec43aeee84303cfb825352a7f5029d036dd6
2017-03-17 17:25:37 -07:00
Roozbeh Pournader
8eb2df1a8e Remove workaround for line breaks around currency symbols
This is now done properly in ICU so we no longer need to do it ourselves.

Also updated some comments about emoji line-breaking.

Test: Existings tests for this in Minikin continue to pass.
Bug: 24959657
Bug: 27365282
Change-Id: I865ea9ba1e79a64409d84d2d30c121f740e35ad6
2017-03-17 15:42:49 -07:00
Roozbeh Pournader
215f7ff8d0 Update Minikin to use ICU's emoji data
Certain differences are still needed, since ICU appears to support
Emoji 4.0 only, while we need Emoji 5.0. But the bulk of the data is
now carried by ICU.

We no longer need the script that generates the tables, so that's
also removed.

Test: Comprehensive unit tests added.
Bug: 27365282
Bug: 30874706
Change-Id: I011443fbca9bb202deff7fffb40043f89e1f1fb1
2017-03-17 14:58:01 -07:00
TreeHugger Robot
a5b935ff67 Merge "Introduce FontCollection construct perf test" 2017-03-17 19:33:45 +00:00
Seigo Nonaka
2d0bfff203 Introduce FontCollection construct perf test
Test: ran minikin_perftest
Bug: 36232655
Change-Id: Ic4d88663d522be17540e2ac17c9b7ae64210275f
2017-03-17 07:42:21 -07:00
TreeHugger Robot
e4e4ea1ede Merge "Update emoji character data in Minikin" 2017-03-17 03:20:24 +00:00
Roozbeh Pournader
3d10a1ed4f Update emoji character data in Minikin
Update emoji character data to Unicode 10.0 / Emoji 5.0 (which also
removes U+1F93B MODERN PENATHLON from the emoji base letters).

Also add unit tests for line breaking for new characters (based on
earlier work by Seigo Nonaka).

Test: All new and existing unit tests pass;
Test: Manually tested line breaking of new emojis in TextView.

Bug: 28364892
Bug: 28678294
Bug: 30874706
Change-Id: I367cdab09187dc08a66a3112a5181a2b7fb338a5
2017-03-16 18:29:01 -07:00
TreeHugger Robot
bbc4943973 Merge "Update emoji grapheme breaking rules" 2017-03-16 22:54:13 +00:00
TreeHugger Robot
61bb3fbc81 Merge "Refactor WordBreaker" 2017-03-16 21:20:15 +00:00
Roozbeh Pournader
f2fd20ec54 Update emoji grapheme breaking rules
The rules are updated to the latest UAX #29, with tailorings based on
the font in use: we can now use the clustering information
calculated by Layout, so we will only disallow a grapheme break if an
emoji ligature is actually formed.

Test: Unit tests have been updated and pass.
Bug: 30917298
Bug: 34211654
Change-Id: Idc0ef9f1f4f45dc45a50ed69e45c43ebfaea0306
2017-03-16 13:34:52 -07:00
Roozbeh Pournader
f3399b503e Refactor WordBreaker
Refactor WordBreaker to make it ready for more complex behavior.

Test: existing unit tests continue to pass
Change-Id: Ife758f3e2cf48922ab56109e6c5d3cffa3673feb
2017-03-16 12:23:08 -07:00
TreeHugger Robot
464d63f0d8 Merge "Introduce minikin_stress_tests to find race condition." 2017-03-16 00:50:50 +00:00
TreeHugger Robot
4b613e361b Merge "Serialize and deserialize supported axes." 2017-03-15 23:30:30 +00:00
Seigo Nonaka
e64e9b2176 Introduce minikin_stress_tests to find race condition.
This is designed for catching race condition.
The stress_tests is splited from unit test binary since this takes
30 seconds on angler.

Bug: 36223724
Bug: 36208043
Test: ran minikin_stress_tests
Change-Id: I1bf4ba43e6e97cd04e7d6dd42d388dd17ce64c7b
2017-03-15 16:11:33 -07:00
TreeHugger Robot
0c8d074c0c Merge "Fallback from script-specific hyphens to normal hyphen first" 2017-03-15 22:45:31 +00:00
TreeHugger Robot
c044fd4ed7 Merge "In greedy line breaking, repeat breaks until the line fits" 2017-03-15 22:29:13 +00:00
Seigo Nonaka
ca8ac8a924 Serialize and deserialize supported axes.
To avoid reading font files during FontFamily construction, serialize
and deserialize supported axes and cmap coverage at the same time.

Bug: 36232655
Test: ran minikin_tests
Change-Id: I4086fb887e13f872390b533584bce6f1d5598ea0
2017-03-15 14:18:13 -07:00
Roozbeh Pournader
aae6468815 Fallback from script-specific hyphens to normal hyphen first
The previous code fell back directly from a script-specific hyphen to
the ASCII hyphen-minus if the font didn't support the script-specific
hyphen. Now we try the Unicode hyphen (U+2010) first before trying
the ASCII hyphen-minus.

Bug: 36201363
Test: Not needed
Change-Id: I374234fd73fab7edd990ea86f8937c38761c90bf
2017-03-15 14:15:46 -07:00
Roozbeh Pournader
d2aaf3394a In greedy line breaking, repeat breaks until the line fits
Previously, in greedy line breaking, when a line overflowed, we found
the best line breaking candidate before it and broke the line there.
But we didn't check to see if the remaining part now fits in a line.

With this change, we now repeat checking for overflows, and break
again until we have no breaking opportunity or the remaining text now
fits in a line.

Also found an issue with greedy line breaking and keeping the
hyphenation edit for the next line which is now fixed.

Test: Manual. The issue reported in the bug is now fixed.
Bug: 34185255
Bug: https://code.google.com/p/android/issues/detail?id=231437
Bug: 33560754
Change-Id: I93bdd341e4f8e1257710e453e4938f224cb2a1ff
2017-03-15 13:52:21 -07:00
TreeHugger Robot
fde7453c82 Merge "Break grapheme clusters after viramas if they end a cluster" 2017-03-15 19:53:12 +00:00
Seigo Nonaka
3165aebe3b Do not keep FontCollection reference in Layout.
LayoutCache only keeps result of layout and can live after
FontCollection is destructed by GC.

This kind of failure will be captured by minikin_stress_tests in the
subsequent CL (I1bf4ba43e6e97cd04e7d6dd42d388dd17ce64c7b)

Test: ran minikin_tests
Bug: 36223724
Change-Id: I639b73c0f1041549158c43212a901c82df4b02db
2017-03-15 15:17:43 +00:00
Seigo Nonaka
8d9c9d7f20 Expose supportedAxes to frameworks/base
The list of supportedAxes are necessary for returning value of
setFontVariationSettings.

Bug: 35764323
Test: ran TextViewTest and PaintTest in cts
Change-Id: I52f244146ea0ce335df02c841f89285be2ed746e
2017-03-15 14:32:08 +00:00
Roozbeh Pournader
f4c0bd2e1b Break grapheme clusters after viramas if they end a cluster
Previously, we stayed on the conservative side and disallowed any
grapheme breaks (and thus cursoring) where a virama was followed by a
letter, since we did not know if the virama would be forming a
cluster with the letter or not. This created problems with Indic
languages with infrequent conjuncts, such as Tamil.

Now we use the information in calculated advances to find if a
cluster is formed. If there is no cluster, we break the grapheme and
allow cursoring after the virama.

Test: Unit tests added to GraphemeBreakTests and MeasurementTests.
Test: Also manually tested Tamil sequences.
Bug: 35721792
Change-Id: Ib159edb94b3ad6f693f0d3dad016b332b2cef447
2017-03-14 21:41:49 -07:00
Seigo Nonaka
44914ce013 Revert "Use std::mutex instead of android::Mutex"
This reverts commit 0eac702718a070e8ee226e63b5f540510b425e9a.

Bug: 36208043
Test: N/A

Change-Id: I165ab7a0718ea50a8034adb6277809e271fd762c
2017-03-14 10:48:42 -07:00
Seigo Nonaka
7945b2d019 Fix build failure due to unexpected merge.
FontLanguageListCache::kEmptyListId is gone, use kEmptyLanguageListId
instead.

Test: N/A
Change-Id: I96075849c53f23fbce8dbc180a51d8f97e45f316
2017-03-13 16:42:46 -07:00
TreeHugger Robot
aed4ec33ad Merge "Make SparseBitSet serializable." 2017-03-13 23:07:04 +00:00
Seigo Nonaka
ff9a6740ed Make SparseBitSet serializable.
To share the calculated coverage information across the processes, make
SparseBitSet serializable.

Bug: 34042446
Test: minikin_tests passes
Change-Id: I0463138adcf234739bb3ce1cdadf382021921f3e
2017-03-13 14:07:55 -07:00