History log of /frameworks/base/graphics/java/android/graphics/FontFamily.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
5b6347a6af668ba47b3fab14cefbe03cc440c3a4 31-Mar-2017 Seigo Nonaka <nona@google.com> Introduce setFallbackTypeface

setFallbackTypeface is returned by Builder.build() method when the
provided font is not loaded due to some reasons.
The fallback family is resolved with width/italic passed to Builder.

Bug: 36794225
Test: android.graphics.cts.TypefaceTest passes
Change-Id: I65e220aca823fd815a52437b11c8e6dc952de8e2
/frameworks/base/graphics/java/android/graphics/FontFamily.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/graphics/java/android/graphics/FontFamily.java
2660aca4912b4bd890c5c76688f67f1898dc7b97 22-Mar-2017 Seigo Nonaka <nona@google.com> Revive old method to prevent crash internal app.

Bug: 36509029
Test: N/A
Change-Id: I4e04847de7b61a790323257c09da9a960a6689d5
/frameworks/base/graphics/java/android/graphics/FontFamily.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/graphics/java/android/graphics/FontFamily.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/graphics/java/android/graphics/FontFamily.java
b44abf290190ceee037f24c47493a34de45fa3f4 16-Feb-2017 Clara Bayarri <clarabayarri@google.com> Use weight & style data for fonts from xml source

Bug: 34916944
Test: manual tests
Change-Id: I1d6e1c4c52859c5e9d7a8b0a247e4d0581935833
/frameworks/base/graphics/java/android/graphics/FontFamily.java
8b48e624457e438fcc2b6b9363329036ef2f7743 07-Jan-2017 Seigo Nonaka <nona@google.com> Follow minikin::FontFamily constructor signature change.

This is 2nd attempt of Id10ca97f6f6f5bbe4999c1ad2736423a204d6e87.
The root caus of crash is due touching null pointer in nUnrefFamily.
After above change, native object may not be created on error case.
In that case, nUnrefFamily can not be called. In addition to this issue
there is also memory leak on error case. This fixes it by introducing
abortCreation method.

Also this contains fix of layout lib breakage done by jgaillard@.
Originally submitted by Ic8872a43993bcb0a157c5e3f0ce423af9b47f606

Here is original commit message of reverted change.

minikin::FontFamily no longer has addFont function, instead it accept
vector of Fonts in its constructor. To follow this signature change,
holding minikin::Font instance in native and build minikin::FontFamily
instance in FontFamily.freeze() method.

Bug: 34042446
Bug: 28119474
Bug: 34378805
Test: hwui test has passed
Test: m layoutlib layoutlib-tests
Change-Id: Ic34ebaa8191273d4c9f49c43124f15a1da5f7b78
/frameworks/base/graphics/java/android/graphics/FontFamily.java
4a65687b853a92268f4f0eb52f22e092b16f8ed3 23-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Expose fonts.xml via public API with a service"
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/graphics/java/android/graphics/FontFamily.java
18e9f9f3778318918c44d944489cb50daaf45d1c 19-Dec-2016 Clara Bayarri <clarabayarri@google.com> Expose Resources.getFont

Based on the work already done in aapt2, load a Font from a
resource id.

Test: WIP
Change-Id: Idc06bfbfd16452a328bfcc6ea9dcfb723b633f0c
/frameworks/base/graphics/java/android/graphics/FontFamily.java
c0d685b87aa544bc23c1ed1c01e88f6c04855f72 20-Jan-2017 Siyamed Sinir <siyamed@google.com> Revert "Follow minikin::FontFamily constructor signature change."

This reverts commit a0a4828614edfd633ab86f04408e7f4e55b491dd.

Bug: 34378805
Change-Id: Icbdbfbde2efe8eaebbe4334a679e3b3247057388
/frameworks/base/graphics/java/android/graphics/FontFamily.java
a0a4828614edfd633ab86f04408e7f4e55b491dd 07-Jan-2017 Seigo Nonaka <nona@google.com> Follow minikin::FontFamily constructor signature change.

minikin::FontFamily no longer has addFont function, instead it accept
vector of Fonts in its constructor. To follow this signature change,
holding minikin::Font instance in native and build minikin::FontFamily
instance in FontFamily.freeze() method.

Test: hwui test passed
Change-Id: Id10ca97f6f6f5bbe4999c1ad2736423a204d6e87
/frameworks/base/graphics/java/android/graphics/FontFamily.java
296bf8c55aaba0025f3e5b904fda3b6e15686753 07-Apr-2016 Raph Levien <raph@google.com> Avoid copying of font table data, provide raw font bytes

Minikin is changing its approach to table access to use HarfBuzz to
access the tables, based on raw font data, rather than calling the
MinikinFont::GetTable() virtual method. This patch provides raw access
to the font data to make this work.

There's a bit of plumbing to make sure fonts get a pointer to the raw
data as well.

Bug: 27860101
Change-Id: I638e18cf363644bf22fbc9fb9b3358a9e731087f
/frameworks/base/graphics/java/android/graphics/FontFamily.java
fb95699364e555148b437cfa1e5c69384f843845 28-Jan-2016 Ben Wagner <bungeman@google.com> Deduplicate font file mappings.

With ttc and gx variation fonts, it is now possible and common that a
number of fonts will use the same font file for data but with different
parameters. In the current code each font will map the font file data,
taking up an unecessary amount of virtual address space and is
inefficient with respect to memory management (like the tlb). This CL
deduplicates these file mappings so that a given font file will only be
mapped into memory once.

DO NOT MERGE
Change-Id: I5ca69f963a434c72ec4028402ecbf9e0f0ee7148
(cherry picked from commit fffcf0a31fd4c9a4ec8aa7de70b1eda0d48fb337)
/frameworks/base/graphics/java/android/graphics/FontFamily.java
a87b07d7fafd59ae26073a80cd742b17ea427ecd 06-Nov-2015 Ben Wagner <bungeman@google.com> Add support for gx font variation axes.

This adds an 'axis' child element to the 'font' element. The 'axis'
element has attributes 'tag' (a four byte identifier) and 'stylevalue'
(a float value) to the parser. This also modifies reading the font file
name in a backwards compatible fashion by using only the direct #text
children of the 'font' element. (Both the Minikin and Skia parsers now
allow the font file name on a separate line in the fonts.xml file).

This information is then passed through to Skia in order to select the
desired variation. The Skia parser already parses this way and has for
some time, so Chrome and WebView can already read this format.

Change-Id: I15623fe864fa92b2bf0705af5e389daedfb77e5c
(cherry picked from commit b8e367fb7428076ff2e4aa2a97adaed1ef806e92)
/frameworks/base/graphics/java/android/graphics/FontFamily.java
3fa667e22401bf3ba96957fe31167bf05d164c55 10-Dec-2015 Seigo Nonaka <nona@google.com> Introduce ttcIndex attribute into system font configuration.

ttcIndex is used for specifying index of the TrueType Collection.
No user visible change is expected with this CL.

BUG: 10861108
Change-Id: I76a1c890164bb55a7ece7b9c7db2ce2bac3f8b89
/frameworks/base/graphics/java/android/graphics/FontFamily.java
117cbebe810613d4a6de034f02652cdbbfef4cde 25-Aug-2014 Raph Levien <raph@google.com> New weight-aware font config

Parse new fonts.xml config file, and resolve weight selection based on
the base weight of the font (as defined by a weight alias specified in
the config file) and the requested bold flag. This change improves the
appearance of bold spans for alternate weights of Roboto.

In addition, this patch enables weight selection for fallback fonts.
For example, if an additional font with a weight of 100 is added to the
Hebrew font family in the fallback list, then requesting
"sans-serif-thin" would select that font for Hebrew text.

Bug: 14538154
Change-Id: I99a04fad4f7bf01c75726e760d42735dd9003496
/frameworks/base/graphics/java/android/graphics/FontFamily.java
d573794d83a049fe59e289944f0cd77406dd776a 02-Jun-2014 Raph Levien <raph@google.com> Support fallbacks for custom typefaces (Minikin)

This patch adds the fallback font list to custom typefaces created from
files and assets, as well as those created by name. This is a fix for
the deskclock half of bug 15139067 "Centered text isn't working".

Change-Id: I0cc60951953dfb73817a98ddfee5713f0387ee90
/frameworks/base/graphics/java/android/graphics/FontFamily.java
f9e3d311275c37fe5f2562993687a1627780a6d0 28-May-2014 Raph Levien <raph@google.com> Language and variant selection for Minikin

This is the frameworks/base side of what's needed to support language
selection (especially Han unification, but also compact/elegant
selection for scripts that require more vertical space).

This is part of the fix for bug 15179652 "Japanese font isn't shown on
LMP".

Change-Id: I8f0f3aa9a1915659f8d0b590cf1c56529356049a
/frameworks/base/graphics/java/android/graphics/FontFamily.java
baef8c1ffe5c900fb0da9512654bf249b5fc9269 20-May-2014 Deepanshu Gupta <deepanshu@google.com> Layoutlib fixes for L [DO NOT MERGE]

This adds the new delegates that were missing. This starts the work on
changes related to Minikin Fonts.

There are some changes related to TypedArray that still need to be
fixed.

Change-Id: Ic2397b64aa3f1f48926e849b14689c47d9ee7f8c
(cherry picked from commit 7ca3612094270183243938e79337c84effea7ad0)
/frameworks/base/graphics/java/android/graphics/FontFamily.java
15cf4757dc0099301662f8a26da561434cc07cfa 06-May-2014 Raph Levien <raph@google.com> Proper refcounting for Minikin objects

This patch introduces proper lifecycle maintenance (based on reference
counting) for Minkin objects, particularly FontFamily and
FontCollection. The patch depends on the corresponding Ref and Unref
methods being available in Minikin.

Change-Id: I91935e953d5a522e1adc496f2ce3a598be35de2b
/frameworks/base/graphics/java/android/graphics/FontFamily.java
9a5b61ccc83303ceeec2059f58c1977af9faa9e3 30-Apr-2014 Raph Levien <raph@google.com> Parsing of XML font configuration files for Minikin

This patch improves Minikin-based font handling, to deal with error
conditions (missing fonts and so on), and also moves the parsing of
fallback_fonts.xml and system_fonts.xml into Java code.

Change-Id: Ib0debdbd56ad3b0196be6d2a35668d711c98f1e5
/frameworks/base/graphics/java/android/graphics/FontFamily.java
1a73f732f91e97c9c66b808c245ddda36a10e987 31-Jan-2014 Raph Levien <raph@google.com> Start of Minikin integration

This is the current state of the Minikin integration. All changes are
hidden behind USE_MINIKIN #ifdef, so it should be safe to apply. To
play with the Minikin branch, set this in your BoardConfig.mk .

This change also merges in 64-bit changes that were happenening in
parallel.

Change-Id: Idd94553bcbe324c5875d0ff06495c966c3e95b7f
/frameworks/base/graphics/java/android/graphics/FontFamily.java