Commit Graph

11 Commits

Author SHA1 Message Date
Kohsuke Yatoh
1e62e215d4 Consolidate getFamilyAt() calls to minikin.
- Typeface: Use FontCollection::createCollectionWithFamilies() instead
  of creating fallback list inside hwui.
- system_fonts: Use SystemFonts::getFontSet() intead of getFontMap().

Bug: 174672300
Test: atest CtsGraphicsTestCases:android.graphics.cts.TypefaceTest
Test: atest CtsGraphicsTestCases:android.graphics.fonts.NativeSystemFontTest
Change-Id: I940f8de441b7bd102eca2d08bc5dd4d0fc4a2685
2022-08-20 03:50:57 +00:00
Kohsuke Yatoh
146c6a93d7 Replace getFamilies() with getFamilyAt().
Following minikin signature change.

Bug: 174672300
Test: m libhwui
Test: m libandroid
Change-Id: I25c5d27c406f49b5ee91a7f4390484296d4a6c7f
2022-07-20 21:48:22 +00:00
Seigo Nonaka
de1e019d56 Update usage of FontCollection interfaces.
Bug: 187358499
Test: m
Change-Id: I2b1f001b3ebf7c297dae422c730d7052894e4394
2021-05-10 00:38:17 -07:00
Seigo Nonaka
b950a1f746 Update native font API to read updated font files.
Bug: 184974821
Test: atest NativeSystemFontTest
Change-Id: Ia7fdf6155e07445d7f16edb88fd2a7293e63080c
2021-04-15 11:03:37 -07:00
Seigo Nonaka
0e5f67a04e Update FakedFont to use shared pointer
Bug: 179113771
Test: minikin_tests
Change-Id: I76082fd2ae00412726113654a87c7b59d47dd03d
2021-02-03 23:47:44 -08:00
Seigo Nonaka
01709c7469 Make AFont_getLocale work
There are multiple problems here:
- Java Font.equals and hashCode doesn't look at locale list. Due to this
issue, the CTS tests have been passing unexpectedly.
- The null pointer check in the AFont_getLoacle was inversed. Should
return only when it is non-null.
- Looks like we cannot get the parent's attribute which always returns
null. Instead, read the "lang" attribute when we read the family tag.

Bug: 139201432
Test: atest NativeSystemFontTest
Test: atest TypefaceEqualsTest
Change-Id: I0514847bbf46a73358afab374ccfce2db09b2ec0
2019-10-29 19:53:35 +00:00
Seigo Nonaka
ddc877300f Pass runMax = 1 to stop unnecessary itemization
Bug: 130044291
Test: N/A
Change-Id: I124b211f9a3db24d4c70c6d6bc0b1a9fdc93b9f7
2019-04-05 15:20:19 -07:00
Seigo Nonaka
b3a7bcea2a Update the system font implementation for new API change
Bug: 129559385
Test: TEMPORARY_DISABLE_PATH_RESTRICTIONS=true m ndk-docs
Test: atest CtsGraphicsTestCases:android.graphics.fonts
Change-Id: I73fd366762e4923886529a49a682cdc1cdceb1aa
2019-04-02 14:28:45 -07:00
Seigo Nonaka
75b841bd31 Implement matchFamilyStyleCharacter API
Bug: 114479228
Test: atest CtsGraphicsTestCases:android.graphics.fonts
Change-Id: Ieaa4251e0ba7c0479f048147141a81766016e9b6
2018-10-30 12:27:25 -07:00
Seigo Nonaka
367589889c Read OEM customization XML
We now moved OEM font customization outside of system image and all
system font modifications are in /product directory.

In this CL, only customizationType="new-named-family" is supported.

My previous CL If58711fc038898175fcad0ae095865312bd738e2 breaks test
cases in CtsGraphicsTestCases but TreeHugger didn't catch my mistake
becasue the test cases are not annotated as Presubmit.

Bug: 111544833
Test: atest CtsGraphicsTestCases:android.graphics.fonts
Change-Id: I7a7a2d91d8f37c51944d598dde7562733eae5626
2018-10-01 23:08:23 -07:00
Seigo Nonaka
50692caa28 Add native font enumeration API implementation
ASystemFont API provides an ability of enumerating the system available
font files with some additional information.

ASystemFont reads /system/etc/fonts.xml and give the information to
developers.

Lots of developers reads fonts.xml by themselves but that is not a part
of public API and the structure is subject to change. This API is a
replacement of the reading fonts.xml by developers.

Bug: 111861508
Test: atest NativeSystemFontTest

Change-Id: I992902228650303eb10f486f1ec7838f218c15e7
2018-09-13 15:53:07 -07:00