55 Commits

Author SHA1 Message Date
Seigo Nonaka
458f1dd71c Extract flag font from NotoColorEmoji
Bug: 188926991
Bug: 188779144
Test: m fontchain_lint
Change-Id: Ie807e31abb407f5b58665d4d2941bc75186d5c42
Merged-In: Ie807e31abb407f5b58665d4d2941bc75186d5c42
2021-06-24 18:46:08 +00:00
Seigo Nonaka
2e9e792e6e Update fontchain_linter.py to be compatible with Compat font
Bug: 186700756
Test: m fontchain_lint
Change-Id: Ibfe33f29f3db998fdc0db1bbf35851841ca73d9a
2021-05-04 17:12:35 -07:00
Bob Badour
1cdaca9f84 [LSC] Add LOCAL_LICENSE_KINDS to frameworks/base
Added SPDX-license-identifier-Apache-2.0 to:
  core/tests/hosttests/test-apps/DownloadManagerTestApp/Android.mk
  core/tests/hosttests/test-apps/MultiDexLegacyAndException/Android.mk
  core/tests/hosttests/test-apps/MultiDexLegacyTestApp/Android.mk
  core/tests/hosttests/test-apps/MultiDexLegacyTestAppTests/Android.mk
  core/tests/hosttests/test-apps/MultiDexLegacyTestAppTests2/Android.mk
  core/tests/hosttests/test-apps/MultiDexLegacyTestAppWithCorruptedDex/Android.mk
  core/tests/hosttests/test-apps/MultiDexLegacyTestServices/Android.mk
  core/tests/hosttests/test-apps/MultiDexLegacyTestServicesTests2/Android.mk
  core/tests/hosttests/test-apps/MultiDexLegacyVersionedTestApp_v1/Android.mk
  core/tests/hosttests/test-apps/MultiDexLegacyVersionedTestApp_v2/Android.mk
  core/tests/hosttests/test-apps/MultiDexLegacyVersionedTestApp_v3/Android.mk
  core/tests/overlaytests/host/test-apps/SignatureOverlay/Android.mk
  core/tests/overlaytests/host/test-apps/UpdateOverlay/Android.mk
  packages/Android.bp
  packages/SystemUI/tests/Android.mk
  services/tests/servicestests/test-apps/PackageParsingTestManifests/Android.bp
  tests/Camera2Tests/CameraToo/Android.mk
  tests/Camera2Tests/CameraToo/tests/Android.mk
  tests/Camera2Tests/SmartCamera/SimpleCamera/Android.mk
  tests/Camera2Tests/SmartCamera/SimpleCamera/tests/Android.mk
  tests/CanvasCompare/Android.mk
  tests/FlickerTests/test-apps/Android.bp
  tests/LockTaskTests/Android.mk
  tests/SoundTriggerTests/Android.mk
  tools/aapt2/integration-tests/MergeOnlyTest/App/Android.mk
  tools/aapt2/integration-tests/NamespaceTest/App/Android.mk
  tools/aapt2/integration-tests/NamespaceTest/Split/Android.mk
  tools/fonts/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Ic480b653df5da840f5e65b818af3de5c8417ab4a
2021-04-21 14:42:18 -07:00
Seigo Nonaka
5681124abb Add FontConfig.Font.getPostScriptName API
Bug: 184003133
Bug: 185508395
Test: atest FontManagerTest#fontManager_PostScriptName
Change-Id: Ie44e0d500c61b37035a0b39039891da13cd6a5ce
2021-04-17 00:46:04 -07:00
Anton Hansson
9f9f90b260 Move font tool build rules to subdir
The top-level Android.bp file is very large, so move modules that can be
in subdirs.

Also rename the vague "base_defaults" module to something more suitable.

Bug: 185128417
Test: m
Change-Id: I5f3106b74edb91ac9db5b3e66cc61566d0f16e9b
2021-04-12 18:08:45 +01:00
Seigo Nonaka
a1245b1c7c Revert font file rename.
This reverts commit f31ac94a03092d33c86d3edd8fd9d93dd87e4e8a.
This reverts commit 2f0674a7fa6c54d57c231467e0a88232669bad2a.

Bug: 184003133
Test: N/A
Change-Id: I6bd807ce0df6cd81e44bf89918ac4b7b01c27ae1
2021-03-30 23:34:28 -07:00
Seigo Nonaka
f31ac94a03 Rename DancingScript and CutiveMono
Bug: 179952916
Test: atest CtsTextTestCases CtsGraphicsTestCases
Test: atest SystemFontsCanonicalNameTest
Change-Id: Ia976e2182e5635d8431a84653908483de1c26ca3
2021-02-25 18:29:31 -08:00
Seigo Nonaka
2f0674a7fa Rename the font file with PostScript name based file name
This CL also adds lint rules for matching the file name and PostScript
name.

Bug: 179952916
Test: m fontchain_lint
Change-Id: I829840299b5d138cfec8924ce8f77e1371524a70
2021-02-10 20:27:31 -08:00
Kohsuke Yatoh
bc7182206b Integration test for updatable system font.
This test:
(1) signs a font file with the test key.
(2) side-loads the test cert to the device under test.
(3) verifies that the signed font file can be installed.

The device must be rootable for doing step (2).

Bug: 176939176
Test: atest UpdatableSystemFontTest
Change-Id: I7a9b614aa3c77589c3495b663cb76056ba657006
2021-02-01 13:57:19 -08:00
Jeff Sharkey
0ab7007631 resolve merge conflicts of 358f0d4fc8c248498cf113c41e043877a14e89a1 to master
Bug: 174932174
Test: I solemnly swear I tested this conflict resolution.
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Change-Id: I9262a08ffc1ccede8e519d0eed90ed2bfcf0232c
2020-12-08 11:01:05 -07:00
Jeff Sharkey
52b9862f87 Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script that
identifies relevant "include" directives.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
Change-Id: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
2020-12-08 08:36:28 -07:00
Rod S
e34a19d7a6 Update fontchain_lint to print all coverage errors, not just first.
Test: m fontchain_lint
Change-Id: Ib6c462b91cbb70cc45701efbadd7b1ac63715c09
2020-03-16 00:01:15 -07:00
Haibo Huang
715857dbda Uses python3 for fontTools
Change-Id: I33bb8881823278c990faeb1a0e119f855c9948b9
2020-03-07 02:02:19 +00:00
Qingqing Deng
0b5f272162 Update fontchain_linter.py to support more flags.
Android Q will support all region flags in UNSUPPORTED_FLAGS list.
BL - Saint Barthélemy
BQ - Caribbean Netherlands
MQ - Martinique
RE - Réunion
TF - French Southern Territories

Bug: 127811703
Test: Verified on device.
Test: m fontchain_lint
Test: minikin_tests --gtest_filter=EmojiTest.cpp
Test: atest cts/tests/tests/text/src/android/text/cts/EmojiTest.java
Test: atest frameworks/base/core/tests/coretests/src/android/text/EmojiTest.java
Change-Id: Ice1fb10af35dc4e180735d9712167b71635920da
2019-05-15 17:17:34 -07:00
Qingqing Deng
5e98771093 Modify fontchain_linter.py for Unicode 12.0 .
Bug:127811703
Test: m fontchain_lint

Change-Id: I36e5804388b70d98a507a719741cae6bc73b727f
2019-03-26 16:23:02 -07:00
Seigo Nonaka
3328d1ce55 Introduce OEM customization XML parser
As the initial version of the OEM customization XML, support
new-named-family customization. This allows OEMs to add new named
family.

Bug: 111544833
Test: atest FrameworksCoreTests:android.graphics
Change-Id: If58711fc038898175fcad0ae095865312bd738e2
2018-09-28 15:59:15 -07:00
Siyamed Sinir
77a1b14910 Remove requirement for kiss emoji should have gender
Test: m fontchain_lint
Test: m
Test: Visual test on device after full build 

Bug: 110037531
Change-Id: Iac26c7c7c0e1a8a500a93f19d99831113529b201
2018-07-12 12:02:18 -07:00
Seigo Nonaka
c18086310b Update font chain linter to match latest font file
- FAMILY emoji now has own gender neutral emoji
- Some flags are newly supported
- Some regions may have the same flags.

Bug: 77148691
Test: m fontchain_lint
Change-Id: If1a69974230f025d35503eb49bea105923593e87
2018-05-15 16:09:48 +00:00
Siyamed Sinir
d97df5a280 Update fontchain_linter for emoji 11
* Add default genders for super villain and super hero.
* Read capability to read from emoji exclusions file.
* Update lint rule to use different glyphs for couple with heart.

Test: m fontchain_lint
Test: Visual test with a build and sample app
Bug: 77148691
Change-Id: Icd92f0455709625b3998fc8eef1d448e17a5d71f
Merged-In: Icd92f0455709625b3998fc8eef1d448e17a5d71f
Merged-In: I56dd3c1e1258bab2fcbdf42e5c42587e45dd92fe
(cherry picked from commit e853efc0817ef38f6ba561ea768d49caf1e53dba)
2018-04-19 12:10:16 -07:00
Seigo Nonaka
1403ff2b0b Ignore missing font in fontchain_linter.py
It is totally valid if the font is missing even if the font is listed in
fonts.xml. Android Watch has less fonts and OEM vendor may reduce the
font files.

Bug: 72159040
Test: m fontchain_lint
Change-Id: I22bdf7bfeb6d80a2a338ebf7536c8eaf193b03c5
2018-01-18 17:24:31 -08:00
Seigo Nonaka
99a7b60e51 Use serif fonts for serif fallback.
Bug: 31491668
Test: m -j1024 fontchain_lint
Change-Id: Ic1d356aa684f2284b0b0fc8de5d0e36380eb44bc
2017-11-20 14:46:31 -08:00
Nan Zhang
24c9924797 Merge "Build fontchain_lint using python_binary_host" am: 7ecac139ea am: 7ade558ad2
am: 67695d3aff

Change-Id: I850304f79c1c35bfeb6951307b8ca2365da0330b
2017-11-17 22:30:37 +00:00
Nan Zhang
2db709de30 Build fontchain_lint using python_binary_host
Test: out/host/linux-x86/bin/fontchain_lint
out/target/product/generic/system true external/unicode
Bug: b/27727331

Change-Id: Ib9353d2338c3b939027069f49e3e847c65526581
2017-11-17 09:22:12 -08:00
Roozbeh Pournader
7e04dd1859 Enable patterns for Belarusian and Latin languages
The native frameworks code now knows about Belarusian and Latin
patterns.

Also, the fontchain_lint tool needed to know the script for any
hyphenation patterns added, and now it does.

Bug: 65626527
Test: make -j fontchain_lint
Change-Id: I747cbb5ea3d36ca63335bfe6b337fad1e75ee79b
2017-10-17 09:19:48 -07:00
TreeHugger Robot
49449579d2 Merge "Create fonts.xml module for adding fonts.xml to system/etc" 2017-05-31 01:29:01 +00:00
Andrew Sapperstein
7459bc49b0 Create fonts.xml module for adding fonts.xml to system/etc
Previously, we used PRODUCT_COPY_FILES. However, that does not allow
overriding the file to use a different one on a per-device basis.
This change migrates the logic to using a BUILD_PREBUILT module
called fonts.xml.
To add additional fonts, the add_additional_fonts.py script has been
added. If ADDITIONAL_FONTS_FILE is defined, add_additional_fonts.py
is run and generates a new version of fonts.xml that contains the
content of ADDITIONAL_FONTS_FILE added where
"<!-- fallback fonts -->" is added.

Bug: 36855735
Bug: 37997769
Test: manual. built multiple devices and verified that the correct
versions of fonts.xml were showing.

Change-Id: I8308f0cb3068274bca5ebd25a38cc023babbd69d
2017-05-30 16:49:14 -07:00
Roozbeh Pournader
63d4d0d358 Check CJK punctuation in early non-CJK fonts
Added tests check that CJK punctuation marks do not appear in
non-CJK fonts that appear earlier than CJK fonts.

This should prevent bugs like those fixed by
Ic2cbc79cecf9539ace8a432f373685eeff81e106 and
Ieeb4c04ca785e07a5db94006a6da31ad040b7e7a to appear again.

Change-Id: I622dccd2a619b2366987a81d1c7f8f49334f5638
Fixes: 38182099
Bug: 19355391
Test: make -j fontchain_lint
2017-05-18 18:38:36 -07:00
Siyamed Sinir
6e06ad055b Update fontchain to read from additional sequences
Test: make fontchain_lint

Bug: 37520224
Bug: 37169477
Change-Id: Ie01a2aca85314701654cc2397f0bcf8eafdbe608
2017-04-25 17:32:15 +00:00
Roozbeh Pournader
aa3ee8e079 Update fontchain_lint to test new emoji font
The new emoji font has been update to Unicode 10/Emoji 5, and has a
new mechanism for flag fallbacks. It also shares glyphs between
gendered emoji and non-genders ones.

Test: make fontchain_lint passes
Bug: 34688862
Bug: 33276970
Bug: 34738377
Change-Id: I4d43b8c777deb93be1e6a784eaa109e2e7febd7d
2017-04-10 13:52:20 -07:00
Roozbeh Pournader
f7a68c10c7 Use additions/emoji-data.txt instead of hardcoded values
Previously, characters for which Android defaulted to emoji were
hardcoded in the script. Now they are read from a data file.

Test: make checkbuild passes
Bug: 36536216
Change-Id: I99eeadf89a29b8a3336263dd68520433765ed5e2
2017-04-05 09:22:42 -07:00
Jungshik Shin
88b1114010 Use variable fonts for Noto Sans Khmer
Update fonts.xml to use NotoSansKhmer-VF.ttf.

The weight range of Khmer is also extended to have 9 weight instances
(three more than Roboto with 200, 600 and 800).

The width range for Khmer is left alone partly because of an apparent
lack of support in fonts.xml for non-normal width fallback fonts.

Note that Noto Sans Khmer UI is left alone because of a baseline issue.

BUG: 22667753
Test: See the QA instruction in comment 10 of the bug.
Test: fontchain_lint
Change-Id: Idf6d4fec86822663ac08feb8979edacbc6c709a0
2017-03-31 19:31:13 +00:00
Roozbeh Pournader
1800ba4ffe Read emoji addtions from data file
We now read the emoji additions from a data file, instead of keeping
them in code.

Test: updated lint script passes.
Change-Id: Ica1ca10eaba0ca2b4a178d08354e31729cb88ce5
2017-03-17 18:28:16 -07:00
Roozbeh Pournader
fabeed6910 Update fontchain_lint.py to read Emoji 5.0 data
This corresponds to an update in emoji-zwj-sequences.txt in
I956ba139737bd79f5e31324ed77df9182342df4e.

Test: The updated script passes with the update data file.
Bug: 30999328
Change-Id: I989dee6e571645daa324ae3eb667e3a92a31511f
2017-03-16 18:00:48 -07:00
Roozbeh Pournader
033b2226ba Load hyphenation patterns for Bulgarian and Church Slavonic
Patterns for Bulgarian (bg) and Church Slavonic (cu) are now loaded
too.

Also make changes to fontchain_lint.py, so it knows the script for Bulgarian
and Church Slavonic is Cyrillic.

Test: make -j works and creates .hyb files for bg and cu
Change-Id: I0586f6c49380279ef88fe952b5cfd2d3594c5524
2017-02-22 23:39:24 -08:00
Seigo Nonaka
9092dc2fa8 Check the count of the families in a default collection.
After I9e01d237c9adcb05e200932401cb1a4780049f86, Minikin can
accept up to 254 font families. To make sure we don't exeed this limit,
introduce an assertion to fontchain_lint.py

Bug: 33562608
Test: m fontchain_lint
Change-Id: I35fc104fd4763f77145bef0e7c5facf30fa99644
2017-01-11 17:46:52 +09:00
yirui
f9936b9b7c Fix incorrect emoji presentation for 'Zsym' script
If the language tag "und-Zsym" is applied to a TextView, the default
presentation should be text-style. However, it didn't work before this
patch, due to a lack of "und-Zsym" language tag in fonts.xml.

Bug: 31297127
Change-Id: Ieed8fe1532806dd1e75c58aa0d7a724bfeed7796
2016-09-14 10:30:59 +09:00
Raph Levien
2b8b819fee Update lint check to accommodate new emoji sequences
These are not yet ready for updating in the unicode data, so we patch
them in code until they are.

Bug: 30594617
Change-Id: Ib4c8568aa4840341474eb0c0c95674d640473f4d
2016-08-09 14:28:54 -07:00
Roozbeh Pournader
ede3a17f60 Add test for ascent and descent of serif and mono fonts
fontchain_lint now has tests making sure that their ascent and
descent matches that of Roboto.

Also, this moves a test class that contains a similar test and and
other related tests from graphictests to coretests.

Bug: 19791102
Change-Id: I8b473dd2a5f97ae2e3d322a2cabc16f3d32489f6
2016-07-27 16:35:12 -07:00
Roozbeh Pournader
bac1aec635 Test Roboto's vertical font metrics
Test that yMin, yMax, Ascent, and Descent values of Roboto are not
changed.

Bug: 26187231
Change-Id: Ia41f5a118e292b8eda8dae5124be112dc0cdbc8d
2016-07-27 13:10:24 -07:00
Roozbeh Pournader
10ea8f7431 Check defaults for Android default-emoji characters
There are 12 characters that Android is defaulting to emoji,
differing from UTR #51 recommendation. This tests for their proper
support.

Change-Id: Icd570510090ef29b3b7a3520bc368c5f77f99fa4
2016-07-26 23:09:48 +00:00
Roozbeh Pournader
3b3c78e6ba Re-enable disabled emoji tests
Since Ib68f803c6adfb41db70f7319b7736d17cdbb6ec2 updates the emoji
data to version 4.0 beta, we can now re-enable the disabled emoji
tests.

Also fix some style issues, update data file parsing method to handle
the new emoji format, add UN to unsupported flags, and do a little
refactoring.

Bug: 26187231
Change-Id: I441fdfed68381d08e5e0b3af91e94bfae742eef6
2016-07-25 14:13:00 -07:00
Raph Levien
5370c72c51 Merge \\"Patch out part of the emoji tests.\\" into nyc-mr1-dev am: 2f39bc777c
am: a77343f873

Change-Id: I60cc91a65e818cb78663647bfa249c896a7cff2c
2016-07-14 22:37:50 +00:00
Doug Felt
4970cdac7e Patch out part of the emoji tests.
This is temporary, until we have proper attribution for additional
emoji data.

Bug: 29939737
Change-Id: I5b97c8e055fa2ccf44b13bf801f681b860d47286
(cherry picked from commit f874a1949a7516596a0c2f5829e140dc6f69c326)
2016-07-13 18:44:45 +00:00
Doug Felt
f874a1949a Patch out part of the emoji tests.
This is temporary, until we have proper attribution for additional
emoji data.

Bug: 29939737
Change-Id: I5b97c8e055fa2ccf44b13bf801f681b860d47286
2016-07-09 01:10:42 +00:00
Roozbeh Pournader
8566f96668 Remove modifications to emoji data
The previous two changes, I60097cd78f28764d83abe0d12b53e2a7e6c974dc
and Idcc8f1b66014b25758c163d908d34f06011d9927, added code to filter
out two characters that were getting removed from the emoji set. Now
that the upstream Unicode data file removes them (see
Ibfea01280d08df34dcdd03f5121aabd532a6eecc), we can remove the code.

Bug: 26187231
Change-Id: Ib849917d8978da1b24fe5fff17d62ad7c2de963a
2016-06-15 13:23:01 -07:00
Doug Felt
3a64f8140c Remove rifle (1F946) from emoji font.
Bug: 28678310
Change-Id: I60097cd78f28764d83abe0d12b53e2a7e6c974dc
2016-05-10 12:50:25 -07:00
Doug Felt
ce51db00ec Patch fontchain_lint to exclude modern_pentathlon.
Fix build breakage.
Bug: 28426800

Change-Id: Idcc8f1b66014b25758c163d908d34f06011d9927
2016-04-29 14:17:57 -07:00
Roozbeh Pournader
5dde087811 Add many more emoji tests
This creates an exact map of the emoji font and adds the following
tests:
* Test that all 'emoji style' variation sequences exist in the color
  emoji font.
* Test that the emoji font contains the exact same character set that
  we expect.
* Test that all unsupported flags map to the same flag tofu glyph.
* Test that the reverse of ZWJ sequences exist in the font and map to
  the same glyph.
* Test that legacy PUA Android emoji are supported.
* Test that all emoji sequences that should map to the same glyph do
  so, but no other sequences map to the same glyph.

Bug: 26187231
Change-Id: I64ef17862df2d91879bf7904055c77c24abb7d88
2016-04-04 11:37:49 -07:00
Roozbeh Pournader
27ec3ace18 Re-enable emoji font tests
This re-enables the emoji font tests, but doesn't run the tests if
SMALLER_FONT_FOOTPRINT is set.

Additionally, we test that there's one and only one emoji font in the
fallback chain.

Bug: 26187231
Bug: 27785690
Change-Id: I2e6d467e3f54ee3d41737170d7c2492a0f6b30f0
2016-03-31 13:23:15 -07:00
Jungshik Shin
fe952f3a0b Merge "Add Lang-to-Script entries for languages with new hyph patterns" into nyc-dev 2016-03-25 00:30:45 +00:00