History log of /frameworks/base/core/java/android/text/FontConfig.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
042741ce4f80f6a19c15252e447e66a0f3a891ec 11-Apr-2017 Seigo Nonaka <nona@google.com> Remove unused public APIs.

By I9ccafe7a53935960566243e2856e166878ca59ae, FontManager was gone.
So FontConfig is no longer need to be parcelable.
We can drop Parcel interface from FontVariationAxis.

Bug: N/A
Test: N/A
Change-Id: I33e92abf1e1063af312f0b7d9d6b8bd938d09c0e
/frameworks/base/core/java/android/text/FontConfig.java
ff55115121a7a2753ba2265cb3201a3a14c0874d 29-Mar-2017 Seigo Nonaka <nona@google.com> Reorganize font enumeration API.

This CL cleans up APIs around font variation settings.
- Remove FontConfig and FontManager public API.
- Remove FontManagerService from system service.
- Extract inner class FontConfig.Axis as top-level class FontVariationAxis.
This is used by Typeface.Builder public API to create new Typeface.
- Introduce and expose FontVariationAxis utility functions from/to string.
- Throws if the invalid font variation settings is passed.

Test: android.text.cts.FontVariationAxisTest passes
Test: android.graphics.cts.TypefaceTest passes
Test: android.graphics.cts.PaintTest passes
Change-Id: I9ccafe7a53935960566243e2856e166878ca59ae
/frameworks/base/core/java/android/text/FontConfig.java
c0cf4f09f4c520b2aaafbe8a0cb0feb530c2e021 28-Mar-2017 Seigo Nonaka <nona@google.com> Do not use many FDs in FontManagerService.

Currently there are over 170 font files are installed in system directory.
Opening 170+ files and keep them is not unacceptable. Pass URI instead.

At the same time, this CL hides full font path from FontConfig since
/system/fonts directory will be deprecated in future.

Bug: 36660849
Test: android.text.cts.FontManagerTest passed
Change-Id: I1d216dc9c6dec702a4ce3b946bfda6dcbe12b7fe
(cherry picked from commit 455f1bfc05bf972ee4fe8cd5fa135ed232126bb7)
/frameworks/base/core/java/android/text/FontConfig.java
b2c20d880dea55f5657be08859950fc8eea96708 22-Mar-2017 Seigo Nonaka <nona@google.com> Unhide Typeface construction APIs.

These APIs are necessary to construct Typeface from various combination
TTC index, variation settings, etc.

Bug: 33062398
Test: android.graphics.cts.TypefaceTest passes
Change-Id: Ie069700ed4f67efbec55331bef867f94d58e2a61
/frameworks/base/core/java/android/text/FontConfig.java
20e5d91739fb88a02afb4888bf9f938308bc9b7b 18-Jan-2017 Seigo Nonaka <nona@google.com> Expose Typeface creation APIs with ttc and font variation.

Introduce Builder class for creating Typeface from various
sources with optional TTC index and font variation settings.

Bug: 33062398
Test: Manually verified new Builder create Typeface.
Change-Id: Ia23ee6a73516707d854c7387fe75fbb22f80673d
/frameworks/base/core/java/android/text/FontConfig.java
ac873c9f25d2a687c9195226b9d680f51c91fa30 08-Mar-2017 Seigo Nonaka <nona@google.com> Clean up public FontConfig APIs

This CL contains following clean up:

- Hide unnecessary constructors.
- Change List<XX> to XX[] since actually all fields are immutable.
- Change font's variant type from String to int.
- Decouple resource related members to FontResourcesParser.
- Add NonNull/Nullable to all fields.

Test: ran android.content.res.FontResourcesParserTest

Change-Id: If456266ffff86d41342572a19662cc8f3cd13181
/frameworks/base/core/java/android/text/FontConfig.java
3c4be77db95ea716889568bde853be082e764da9 07-Feb-2017 Clara Bayarri <clarabayarri@google.com> Support non-system Font Providers

To do this, the developer must specify the set of certificate
hashes that represent the authority's app. This allows us to
verify that the authority we find is indeed the one intended
by the developer.

Bug: 35025705
Test: runtest --path frameworks/base/core/tests/coretests/src/android/provider/FontsContractTest.java
runtest --path frameworks/base/core/tests/coretests/src/android/content/res/FontResourcesParserTest.java
CTS attached to topic
Change-Id: I605f9a93bbca8705936ead08efb4a5b4fdcc4882
/frameworks/base/core/java/android/text/FontConfig.java
4b5a4d221f377686a730182a3bffb8c6f190e313 27-Jan-2017 Clara Bayarri <clarabayarri@google.com> Declarative downloadable fonts

Implement support for downloadable font requests in xml. Given the
xml fonts feature in O, this adds support to not only declare
local font files as font resources, but also Downloadable fonts
from a fonts provider.

A provider returns a font family (of one or more files) given a
query, so the new attributes are added to the font-family tag.

Additionally, add support to pre-declare downloadable font resources
in the Android Manifest. These will then be fetched at app startup
time so they are available to use from the Typeface cache asap.

When retrieving downloadable fonts via resources, the cache is
checked to see if the font is already there and is used, otherwise
a request is sent to the provider and the default font is returned
as we need a result synchronously.

To do this, the developer declares an additional fonts xml resource
file with the list of fonts to preload and links it in the manifest
with a meta-data tag.

E.g.:

res/font/mydownloadedfont.xml

<font-family xmlns:android="http://schemas.android.com/apk/res/android"
android:fontProviderAuthority="com.example.test.fontprovider"
android:fontProviderQuery="myrequestedfont">
</font-family>

res/font/preloaded_fonts.xml

<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
<font android:font="@font/mydownloadedfont" />
</font-family>

and in the AndroidManifest.xml

<meta-data android:name="preloaded_fonts"
android:resource="@font/preloaded_fonts" />

Bug: 34660500, 34658116
Test: WIP, need to add more
Change-Id: I1d92555e115e241bf23b59e6f5c6cca6c7361de7
/frameworks/base/core/java/android/text/FontConfig.java
ed00bfdfae5d5cbc9e13f4e8affdece48f4c5b7f 20-Jan-2017 Clara Bayarri <clarabayarri@google.com> Implement .xml font resource support

This change implements the loading and parsing
of xml type font resources, and makes sure it is
used properly by TextView styles.

Test: run cts -m CtsContentTestCases -t android.content.res.cts.ResourcesTest
run cts -m CtsWidgetTestCases -t android.widget.cts.TextViewTest#testFontResources*

Change-Id: I5a2930b3ba7dad67d9607e9036a5dde6bab0c5a4
/frameworks/base/core/java/android/text/FontConfig.java
04d72abde1efc963ebb2f145f859552e83b92d13 10-Jan-2017 Clara Bayarri <clarabayarri@google.com> Expose fonts.xml via public API with a service

This change creates a new FontManagerService, in charge of providing
font management data. It exposes a public API to retrieve the
information in fonts.xml without accessing it directly. To do this,
it also refactors FontListParser's internal classes into a new public
FontConfig class holding all the font data.

getSystemFonts() returns all the available information in fonts.xml
as well as file descriptors for all the fonts. This allows us to
share the memory consumed by these files between all clients.

Bug: 34190490
Test: See attached CTS change in topic
Change-Id: I0e922f8bcc9a197a1988d04071eb485328d66fb7
/frameworks/base/core/java/android/text/FontConfig.java