summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorAndy Mast <andy@cyngn.com>2014-02-02 12:52:58 -0800
committerd34d <clark@cyngn.com>2015-10-26 15:57:35 -0700
commit39f748480050ef6d555d03fc7c9315f3a0b2f30e (patch)
treea4af5b36022a6c91a12286997d1ac8544174f3ab /graphics
parent12aed4e65691e06656afa0d6c3ccbe05ccabf735 (diff)
downloadframeworks_base-39f748480050ef6d555d03fc7c9315f3a0b2f30e.zip
frameworks_base-39f748480050ef6d555d03fc7c9315f3a0b2f30e.tar.gz
frameworks_base-39f748480050ef6d555d03fc7c9315f3a0b2f30e.tar.bz2
Themes: Port to CM13 [1/3]
Themes: Aapt port Id: I106d447daf7935bada65e78911d8973ce0ca27ae Themes: Port our additions to idmap Id: I2e47cc23de4e7c0b884cccbd87c7d77079ac6824 Themes: remove legacy theme support from idmap Id: I17dfe35f9985d8cef790b26a8bcda738ea65917c Themes: Forward port changes to Installer.java Id: If64e856773e50f5ed74f2358e0c590abad724689 Themes: Add clean spec for aapt Id: I68f5f63f7e83b99230860dd2d8646e96da484b62 androidfw: Port CM overlay contributions Id: Id7b7f5f35011922c668fcea3a8aec5b42bd28653 androidfw: Port addOverlayPath and removeOverlayPath Id: I279db083af28fd8941f3227f2a7512ff094742c1 androidfw: Port addCommonOverlayPath Id: I12d2fe05a04f6a7e553c330505a475346374b507 androidfw: Port addIconPath Id: Ide3db28cde0c7f93edd9e7ad626ebace8d4105cc androidfw: Allow package ID to be overriden at runtime Id: Ieca3a0ae070a6c0ad0cf2b73b5944d83397d08b9 Aapt: Zip Parsing Test Cases w/ Refactoring Id: I28f9115700e186136432138d228111ebcfbd0480 Themes: Update tests for idmap Id: I3dae5bd376d122eab397863378599ae0ac7c6734 androidfw: Add test case for overriding package id Id: I2668c529e24a55cd6bc8437406fc284b853a75e7 androidfw: Add tests for bags The overlayOverridesStyleAttribute will currently fail since our changes to allow theming styles is not currently implemented. Id: Idfacc4382baf4152c839799a22b6cbe015ef2197 androidfw: Don't consider package ids 0x60 and 0x61 as dynamic Package IDs that are not 0x01 (system) or 0x7f (app) are treated as dynamic references. Overlays are assigned specific package ids that fall within the region of shared libraries. This patch treats them the same as system and app resource packages. Id: Ieecaa889bed50490796351302405a38f77c84f4e Theme Parsing & Info Id: I3583d7e8ca704402e3d8c6e1c7cea1645b91c06f Port ThemeUtils and its dependencies This is pretty much copy/paste from cm-11.0 Id: I406860a259136ccca107b981aca0369851df445e Themes: AndroidManifest and Intent port Id: Ib97e8539301d20d120fd8b49891fdaae8205fe42 ComposedIconInfo Port (w/ stubbed IconPackHelper) IconPackHelper is stubbed out so that PMService can reference it, we'll need to port the Resource stack before porting the implementation. Id: I59b680511de525e1d375a4f3be04347686b5e81b Port PackageManagerService and other dependencies Id: I11629d1e5eee21e01c060bc6c0393aae96034b69 Themes: Add in ThemeService See also: external/selinux. The policy must be added in order for the service to start without a security exception. Change-Id: Ic6f64796b264e430e9706a17a3fd2a35085fd1ca TODO: ThemeService / Keyguard interaction TODO: SystemServer - AppsLaunchFailure Add AppsLaunchFailure Id: I09a3826f89c62cb898866408e807f269616f48fc androidfw: Update bags tests The overlayOverridesStyleAttribute was updated such that it does not check the attribute of the theme before adding the overlay. The bag is cached on the first call and the next call, after the overlay is attached, returns that pre-computed bag so the test would always fail. We now simply check that the attribute matches the one in the overlay, and if so then the test passes. This patch also adds a new test to check that an overlay can reference and access resources that are unique to the overlay. Currently this test fails. Id: I3892df3f0d9443a73eaa11b3d5e97cfe86620a73 androidfw: Add test for referencing overlay styles as parents Id: I4fa3bd447c888e96176955924ebe7ee5c784ab55 androidfw: Allow referencing and retrieving overlay resources This patch allows a theme to reference it's own resources. Overlays get their own group which contains those resources that are not idmapped. Idmapped resources end up in the target's group. Id: Ibc119ddcdb35d44a8afec3c6152bcab2909cda18 androidfw: Fill in missing attributes from overlay style Id: I74051b379b73c728c6a2aa4bc62f3cd268a40b53 Protect windowNoTitle and windowActionBar attributes This patch creates a new method to define "protected" attributes. These are attributes like windowActionBar which should not be modified by a theme. Some apps (eg gmail) use the appcompat library which has its own Actionbar classes. When an app uses its own Actionbar it must not include the default actionbar which is achieved through the windowActionBar attribute. Some themes may try to change these attributes, which can will cause the app to crash. Id: Ie3bb7285eed09f3f13facf9d142ea9eb83796eec Themes: Use SYSTEM_DEFAULT in ThemeService Id: I52794dd98ca2f64aa50046ecdd7f79f27c21dd98 androidfw: Test missing parent attributes are merged in This test checks that an overlaid style contains any attributes that were in the original style but omitted in the overlaid style. Id: I6b496ef2eb0a7ef27b4fafdfda5bdf7ccffad989 androidfw: Add test case for protected attributes For this test to pass a protected attribute, such as windowNoTitle, must be equal to the original and not the value specified in the overlay. Id: Ic03f11214a1fc4139e3c48d7e72694a80f819023 Themes: Attach theme and icon resources from java Id: I9ffa0ce96a4af603b78b32d6b190f9698d3e4b4f Themes: Icons, icons, icons! Let there be icons. Legacy icons and composed icons are included in this patch. Id: I9fedafa270f1c4dc30c9c8ffd4cf619895e688e6 Themes: Retrieve explicitly themed context and resources Id: I4e41c251aee47361b183b60089bf5666540f653e Themes: Add themeChange config change to manifest Id: Ia84c0089a79637906e4f75fa38a56e8ff3b21a2b Themes: Register THEME_SERVICE in ContextImpl Id: I608a0b65c7e2ff0d69bae7bf343916f2b985f4a0 Themes: Remove legacy theme support Id: I25887843d31f705425aa40f9a23482fd2cafaef8 androidfw: correctly index paths in idmap Since we added the mtime values for the target and overlay, the indices are increased by two. Id: Ie0f5474d425945d58a12021cd2739240d2e98c0a androidfw: Fix opening assets from theme resources Id: Iedb51163a62b046cdf7fda1ad1b55cc1ee409047 Themes: Consider overlaid resource as "best fit" Id: Ife8342a49eb9502be52f085f88161b113332e9e6 Themes: Save and restore theme config Id: I3fcd445fb458aa6ed09397c05df6eb66d9be7235 Themes: Let ThemeService process additional themes Id: I45837f26948367d5cc6c520e8c53f9da60bd1fda AAPT: Don't applyVersionForCompatibility on android When compiling themes with aapt, we do not want aapt to call applyVersionForCompatibility as this causes the entries in the resource table to have an incorrect path. Id: Ie2c69533b3659c7b7458d6e4b7bdc84946d1be8e androidfw: Don't consider package id 0x5f as dynamic Package id 0x5f is reserved for common overlay resources and needs to be reserved so that it is not considered a dynamic. Id: Id27b8e0e2231ee8541365274d512e347afcfd05b AAPT: Include resources.arsc in apk Common resources needs the resources.arsc in the resources.apk so that it can be included when processing other overlays. Without it, common resources cannot be referenced. Id: I4aee29f660e4a0aa1909240dc0ca5680f0a2d135 Themes: Add keyguard wallpaper support to theme service Id: Ib8f8acd55ab4d2b6ef06ee0a630dc50c4f870beb Themes: Don't pre-process non .9.png images When creating a resources.apk we do not need to pre-process the normal .png images as those can be referenced directly from the theme's apk. Id: Iaf846a03ead9ecb1e68c040eac6e0ecbfc6e5875 Themes: Adjust offsets for idmap hashes Idmap now has a header so the indices to the hashes need to be incremented by one. Id: If1fb183cc116ef9e3ad6cb4e17b6e44763e9e72a Themes: Use single ThemeInfo instead of an array We only ever used the first index so there is no need to use an array of ThemeInfo(s) Id: I9e2af076bc17396a0c978be3c0d31c41277db3df New converter for Kitkat -> L fonts.xml L introduced a new fonts xml format. Its great, but our themes will keep using hte old format. This provides a converter and test cases. The parser was taken from the chooser and remains mostly unchanged with the exception of a getName() helper method. Id: Ia1d42c9e50eb7b52d2d98fe6dbeee530bef3adc2 Themes: Port theme bootanimation support to CM12 Id: Ie016884b0e3b77e08732308923ac44e0975e0116 Resources: Clear drawable cache Id: I04b5b78cce703194a2baeff9c51d2e4733b8ccc9 Font switching Id: Ia43060a7db624102cdcd9b0d9dc7148441401584 Zygote changes Id: Ie3681cf0d2b9929661cf1214e899cef9a5f37471 Recreate String Blocks Id: I4747ebd1a0908b76ae7214b0584948353d426fc5 add a getter for the x and y offsets of the wallpaper window Id: I35294bcac664e85cc5d344b50b5c4335a60d3f37 Themes: Don't spam logcat with CREATING STRING CACHE When processing resources with AAPT on the device, it spams the logcat with warning messages about CREATING STRING CACHE. Change ALOGW to ALOGV so it will only show when verbose logging is enabled. Id: I5b591c3336e176dd71cebe672d60721c29651b00 SystemUI: Audio Volume Panel Id: I78c471864af401b274597339b8451e65931fdb32 AmService uiContext port Id: Ida251d7f80797b0ec78b3d20cf60a795d6c4c1f0 Cleanly detach theme assets Types from an overlay are added to the target group's TypeList and need to be removed when the overlay assets are detached. Failing to remove these types results in resources not being retieved due to the erroneous types. Id: I4a9c624e30309e61fce905ced45c55acd3ac4845 Themes: GlobalAction Port Id: Ifd87e04f94a284e77f1c48bec9fd75d69c45c47e Themes: Do not store forward locked themes in ASEC containers If a theme is in a asec container and is applied, when the device is rebooted the device will get stuck in a nasty boot loop since the theme resources must be read and the asec container is not ready yet. Id: I1d93d8175d5c40b34c222974960c43352012a5ad Use systemui's applied theme for notifications. Notifications contain RemoteViews which are inflated using the application's context for which this notification belongs to. This can look out of place if SystemUI is using a different theme than the rest of the system. This patch will use SystemUIs theme when inflating the RemoteViews, giving us a more consistent look in the notification drawer. Id: I9514ce7fcc4858bad3d3c4190f55c1f5a1441d7c SysUI: Add theme support This ports over the changes needed to facilitate a theme change in SystemUI. Id: I673fb79db90994371a9c0627746a97414132f0ba Themes: Allow composing of VectorDrawable Base icons can be vector drawables. This patch allows them to be composed. Currently, VectorDrawables cannot have filters applied since they do not have a method to get the Paint object like BitmapDrawable and PaintDrawable. Id: I762c8e1f4d1c945b8ebc164bbd7944120324bd42 Themes: Add target api to ThemesContract This will allow the ThemesProvider to track the api a theme was built for. We may want to let the user know when a theme may not be designed for the version of CM installed on their device. Id: Idf0e6cef0ce9ac5e221ce5ff7e0b155ae0258d5f Access Themed ResTables from compiled theme apk [1/2] Before this patch the ResTable for a theme/app was created and accessed seperate from the compiled APK. Since the compiled APK has its own copy of the resources.arsc, we can just reuse the table in the APK instead. Id: I106a2434e74784bc04014831098f49fe128bc7e2 Themes: Port AppsLaunchFailureReceiver to CM12 Id: I5c3265e64aef1536ba5fceed0ec89082e786b686 Themes: Bump idmap hash version to 3 Due to changes in idmap, we need to force the recreation of resource cache when upgrading from CM11 to CM12. Id: I25c1e2c598bca889818e2d685651e3214c30ab3c Remove debug logs Id: Ia5cfa83ddf6da195e20526a94ba154864b8d0ecb Send target sdk version to aapt [1/2] If vector drawables are used in a theme we must have a minSdkVersion of 21 passed to aapt or else aapt will Segfault. Id: I687ee146f9f80543bbcdd06d93891cb3b23001c4 Add missing imports to ActivityThread Id: I09fe07807ed824ccb938e0e174b06653c613c403 Themes: Dynamically add/remove content from StatusBarWindow StatusBarWindowView has logic for resizing and fading content which doesn't always behave correctly if this view is not the root. Rather than create a container, this patch uses the existing StatusBarWindowView as the container and the inflated status bar is then added to this view. Id: Ia93d25a589419145f95d75b1b56eb3c2f300f935 Themes: don't use preloaded drawables when themed If we have themed assets we should try and load those rather than pulling from the preloaded drawables. This allows us to continue and preload drawables in ZygoteInit while maintaining the ability to theme those preloaded assets. Id: I68cfc099d328ece0791b6d0e5cf11d07097fd1fd CM11 -> CM12 Upgrade [1/3] - Introduce a new secure setting "THEME_PREV_BOOT_API_LEVEL". This field will always be set to the previous api level for themes. So if we upgrade from CM11 to CM12 this value will differ from the current API causing an upgrade to trigger - When moving from CM11 -> CM12, unapply incompatible overlays - Rename "holo" to "system" in secure settings themeConfig - Provide a testing downgrade script to put the secure settings db into a state similiar to CM11 (at least for themes) Id: I71be2c0ad83e60ffe8c574f913e5eaecb9700045 Themes: Add constant for system target API Id: I0a6caf65c9e8b0feeef1ae848ba4683235304e8c Change-Id: Ide6d4e1daf535a54efb1ec7cf39ef8b2fb8cf272
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/FontListConverter.java220
-rw-r--r--graphics/java/android/graphics/FontListParser.java53
-rw-r--r--graphics/java/android/graphics/LegacyFontListParser.java186
-rw-r--r--graphics/java/android/graphics/Typeface.java65
-rw-r--r--graphics/tests/localtests/Android.mk18
-rw-r--r--graphics/tests/localtests/src/android/graphics/FontListConverterTest.java280
-rw-r--r--graphics/tests/localtests/src/android/graphics/TypefaceTestSuite.java27
7 files changed, 838 insertions, 11 deletions
diff --git a/graphics/java/android/graphics/FontListConverter.java b/graphics/java/android/graphics/FontListConverter.java
new file mode 100644
index 0000000..c675c88
--- /dev/null
+++ b/graphics/java/android/graphics/FontListConverter.java
@@ -0,0 +1,220 @@
+/*
+ * Copyright (C) 2014 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.graphics;
+
+import android.graphics.FontListParser;
+import android.graphics.FontListParser.Alias;
+import android.graphics.FontListParser.Font;
+import android.graphics.LegacyFontListParser.Family;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map.Entry;
+
+/**
+ * Converts a list of Family to FontListParser.Config
+ * {@hide}
+ */
+public class FontListConverter {
+ // These array values were determined by the order
+ // of fonts in a fileset. The order is:
+ // "Normal, Bold, Italic, BoldItalic"
+ // Additionally the weight values in L's fonts.xml
+ // are used to determine a generic weight value for each type
+ // e.g The 2nd entry in a fileset is the bold font.
+ protected static final int[] WEIGHTS = { 400, 700, 400, 700 };
+ protected static boolean[] ITALICS = { false, false, true, true };
+ protected static final int DEFAULT_WEIGHT = WEIGHTS[0];
+
+ // Arbitrarily chosen list based on L's fonts.xml.
+ // There could be more out there, but we can't use a generic pattern of "fontName-styleName"
+ // as "sans-serif" would be translated as a font called "sans" with the style "serif".
+ public static final String[] STYLES = {
+ "thin",
+ "light",
+ "medium",
+ "black"
+ };
+
+ // Maps a "normal" family to a list of similar families differing by style
+ // Example: "sans-serif" -> { sans-serif-thin, sans-serif-light, sans-serif-medium }
+ private HashMap<Family, List<Family>> mFamilyVariants = new HashMap<Family, List<Family>>();
+ private List<Family> mFamilies =
+ new ArrayList<Family >();
+ private String mFontDir;
+
+
+ public FontListConverter(List<Family> families, String fontDir) {
+ mFamilies.addAll(families);
+ mFontDir = fontDir;
+ findFamilyVariants();
+ }
+
+ public FontListConverter(Family family, String fontDir) {
+ mFamilies.add(family);
+ mFontDir = fontDir;
+ findFamilyVariants();
+ }
+
+ private void findFamilyVariants() {
+ for(Family family : mFamilies) {
+ if (isNormalStyle(family)) {
+ List<Family> variants = findVariants(family, mFamilies);
+ mFamilyVariants.put(family, variants);
+ }
+ }
+ }
+
+ private List<Family> findVariants(Family normalFamily, List<Family> legacyFamilies) {
+ List<Family> variants = new ArrayList<Family>();
+
+ String normalFamilyName = normalFamily.getName();
+
+ for(Family family : legacyFamilies) {
+ String name = family.getName();
+
+ if (name.startsWith(normalFamilyName) && !isNormalStyle(family)) {
+ variants.add(family);
+ }
+ }
+ return variants;
+ }
+
+ public FontListParser.Config convert() {
+ FontListParser.Config config = new FontListParser.Config();
+ config.families.addAll(convertFamilies());
+ config.aliases.addAll(createAliases());
+ return config;
+ }
+
+ /**
+ * A "normal" style is just standard font,
+ * eg Roboto is normal. Roboto-Thin is styled.
+ */
+ protected boolean isNormalStyle(Family family) {
+ String name = family.getName();
+ if (name == null) return false;
+
+ for(String style : STYLES) {
+ if (name.endsWith('-' + style)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ protected List<FontListParser.Family> convertFamilies() {
+ List<FontListParser.Family> convertedFamilies = new ArrayList<FontListParser.Family>();
+
+ // Only convert normal families. Each normal family will add in its variants
+ for(Family family : mFamilyVariants.keySet()) {
+ convertedFamilies.add(convertFamily(family));
+ }
+
+ return convertedFamilies;
+ }
+
+ protected FontListParser.Family convertFamily(Family legacyFamily) {
+ List<String> nameset = legacyFamily.nameset;
+ List<String> fileset = legacyFamily.fileset;
+
+ // Arbitrarily choose the first entry in the nameset to be the name
+ String name = nameset.isEmpty() ? null : nameset.get(0);
+
+ List<Font> fonts = convertFonts(fileset);
+
+ // Add fonts from other variants
+ for(Family variantFamily : mFamilyVariants.get(legacyFamily)) {
+ fonts.addAll(convertFonts(variantFamily.fileset));
+ }
+
+ return new FontListParser.Family(name, fonts, null, null);
+ }
+
+ protected List<FontListParser.Font> convertFonts(List<String> fileset) {
+ List<Font> fonts = new ArrayList<Font>();
+
+ for(int i=0; i < fileset.size(); i++) {
+ String fullpath = mFontDir + File.separatorChar + fileset.get(i);
+ // fileset should only be 4 entries, but if
+ // its more we can just assign a default.
+ int weight = i < WEIGHTS.length ? WEIGHTS[i] : DEFAULT_WEIGHT;
+ boolean isItalic = i < ITALICS.length ? ITALICS[i] : false;
+
+ Font font = new Font(fullpath, weight, isItalic);
+ fonts.add(font);
+ }
+
+ return fonts;
+ }
+
+ protected List<Alias> createAliases() {
+ List<Alias> aliases = new ArrayList<Alias>();
+
+ for(Family family : mFamilyVariants.keySet()) {
+ // Get any aliases that might be from a normal family's nameset.
+ // eg sans-serif, arial, helvetica, tahoma etc.
+ if (isNormalStyle(family)) {
+ aliases.addAll(adaptNamesetAliases(family.nameset));
+ }
+ }
+
+ aliases.addAll(getAliasesForRelatedFamilies());
+
+ return aliases;
+ }
+
+ private List<Alias> getAliasesForRelatedFamilies() {
+ List<Alias> aliases = new ArrayList<Alias>();
+
+ for(Entry<Family, List<Family>> entry : mFamilyVariants.entrySet()) {
+ String toName = entry.getKey().nameset.get(0);
+ List<Family> relatedFamilies = entry.getValue();
+ for(Family relatedFamily : relatedFamilies) {
+ aliases.addAll(adaptNamesetAliases(relatedFamily.nameset, toName));
+ }
+ }
+ return aliases;
+ }
+
+ private List<Alias> adaptNamesetAliases(List<String> nameset, String toName) {
+ List<Alias> aliases = new ArrayList<Alias>();
+ for(String name : nameset) {
+ Alias alias = new Alias();
+ alias.name = name;
+ alias.toName = toName;
+ aliases.add(alias);
+ }
+ return aliases;
+ }
+
+ private List<Alias> adaptNamesetAliases(List<String> nameset) {
+ List<Alias> aliases = new ArrayList<Alias>();
+ if (nameset.size() < 2) return aliases; // An alias requires a name and toName
+
+ String toName = nameset.get(0);
+ for(int i = 1; i < nameset.size(); i++) {
+ Alias alias = new Alias();
+ alias.name = nameset.get(i);
+ alias.toName = toName;
+ aliases.add(alias);
+ }
+
+ return aliases;
+ }
+}
diff --git a/graphics/java/android/graphics/FontListParser.java b/graphics/java/android/graphics/FontListParser.java
index 97081f9..1ca464d 100644
--- a/graphics/java/android/graphics/FontListParser.java
+++ b/graphics/java/android/graphics/FontListParser.java
@@ -21,6 +21,8 @@ import android.util.Xml;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
+import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
@@ -74,25 +76,64 @@ public class FontListParser {
}
/* Parse fallback list (no names) */
- public static Config parse(InputStream in) throws XmlPullParserException, IOException {
+ public static Config parse(File configFilename, File fontDir)
+ throws XmlPullParserException, IOException {
+ FileInputStream in = new FileInputStream(configFilename);
+ if (isLegacyFormat(configFilename)) {
+ return parseLegacyFormat(in, fontDir.getAbsolutePath());
+ } else {
+ return parseNormalFormat(in, fontDir.getAbsolutePath());
+ }
+ }
+
+ private static boolean isLegacyFormat(File configFilename)
+ throws XmlPullParserException, IOException {
+ FileInputStream in = new FileInputStream(configFilename);
+ boolean isLegacy = false;
+ try {
+ XmlPullParser parser = Xml.newPullParser();
+ parser.setInput(in, null);
+ parser.nextTag();
+ parser.require(XmlPullParser.START_TAG, null, "familyset");
+ String version = parser.getAttributeValue(null, "version");
+ isLegacy = version == null;
+ } finally {
+ in.close();
+ }
+ return isLegacy;
+ }
+
+ public static Config parseLegacyFormat(InputStream in, String dirName)
+ throws XmlPullParserException, IOException {
+ try {
+ List<LegacyFontListParser.Family> legacyFamilies = LegacyFontListParser.parse(in);
+ FontListConverter converter = new FontListConverter(legacyFamilies, dirName);
+ return converter.convert();
+ } finally {
+ in.close();
+ }
+ }
+
+ public static Config parseNormalFormat(InputStream in, String dirName)
+ throws XmlPullParserException, IOException {
try {
XmlPullParser parser = Xml.newPullParser();
parser.setInput(in, null);
parser.nextTag();
- return readFamilies(parser);
+ return readFamilies(parser, dirName);
} finally {
in.close();
}
}
- private static Config readFamilies(XmlPullParser parser)
+ private static Config readFamilies(XmlPullParser parser, String dirPath)
throws XmlPullParserException, IOException {
Config config = new Config();
parser.require(XmlPullParser.START_TAG, null, "familyset");
while (parser.next() != XmlPullParser.END_TAG) {
if (parser.getEventType() != XmlPullParser.START_TAG) continue;
if (parser.getName().equals("family")) {
- config.families.add(readFamily(parser));
+ config.families.add(readFamily(parser, dirPath));
} else if (parser.getName().equals("alias")) {
config.aliases.add(readAlias(parser));
} else {
@@ -102,7 +143,7 @@ public class FontListParser {
return config;
}
- private static Family readFamily(XmlPullParser parser)
+ private static Family readFamily(XmlPullParser parser, String dirPath)
throws XmlPullParserException, IOException {
String name = parser.getAttributeValue(null, "name");
String lang = parser.getAttributeValue(null, "lang");
@@ -116,7 +157,7 @@ public class FontListParser {
int weight = weightStr == null ? 400 : Integer.parseInt(weightStr);
boolean isItalic = "italic".equals(parser.getAttributeValue(null, "style"));
String filename = parser.nextText();
- String fullFilename = "/system/fonts/" + filename;
+ String fullFilename = dirPath + File.separatorChar + filename;
fonts.add(new Font(fullFilename, weight, isItalic));
} else {
skip(parser);
diff --git a/graphics/java/android/graphics/LegacyFontListParser.java b/graphics/java/android/graphics/LegacyFontListParser.java
new file mode 100644
index 0000000..adb37a3
--- /dev/null
+++ b/graphics/java/android/graphics/LegacyFontListParser.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright (C) 2014 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.graphics;
+
+import android.util.Xml;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Parses an XML font config. Example:
+ *
+ *<familyset>
+ *
+ * <family>
+ * <nameset>
+ * <name>sans-serif</name>
+ * <name>arial</name>
+ * </nameset>
+ * <fileset>
+ * <file>Roboto-Regular.ttf</file>
+ * <file>Roboto-Bold.ttf</file>
+ * <file>Roboto-Italic.ttf</file>
+ * <file>Roboto-BoldItalic.ttf</file>
+ * </fileset>
+ * </family>
+ * <family>
+ * ...
+ * </family>
+ *</familyset>
+ */
+public class LegacyFontListParser {
+ public static class Family {
+ public List<String> nameset = new ArrayList<String>();
+ public List<String> fileset = new ArrayList<String>();
+
+ public String getName() {
+ if (nameset != null && !nameset.isEmpty()) {
+ return nameset.get(0);
+ }
+ return null;
+ }
+ }
+
+ public static List<Family> parse(InputStream in)
+ throws XmlPullParserException, IOException {
+ try {
+ XmlPullParser parser = Xml.newPullParser();
+ parser.setInput(in, null);
+ parser.nextTag();
+ return readFamilySet(parser);
+ } finally {
+ in.close();
+ }
+ }
+
+ private static List<Family> readFamilySet(XmlPullParser parser)
+ throws XmlPullParserException, IOException {
+ List<Family> families = new ArrayList<Family>();
+ parser.require(XmlPullParser.START_TAG, null, "familyset");
+
+ while (parser.next() != XmlPullParser.END_TAG) {
+ if (parser.getEventType() != XmlPullParser.START_TAG) {
+ continue;
+ }
+ String name = parser.getName();
+
+ // Starts by looking for the entry tag
+ if (name.equals("family")) {
+ Family family = readFamily(parser);
+ families.add(family);
+ }
+ }
+ return families;
+ }
+
+ private static Family readFamily(XmlPullParser parser)
+ throws XmlPullParserException, IOException {
+ Family family = new Family();
+ parser.require(XmlPullParser.START_TAG, null, "family");
+
+ while (parser.next() != XmlPullParser.END_TAG) {
+ if (parser.getEventType() != XmlPullParser.START_TAG) {
+ continue;
+ }
+ String name = parser.getName();
+ if (name.equals("nameset")) {
+ List<String> nameset = readNameset(parser);
+ family.nameset = nameset;
+ } else if (name.equals("fileset")) {
+ List<String> fileset = readFileset(parser);
+ family.fileset = fileset;
+ } else {
+ skip(parser);
+ }
+ }
+ return family;
+ }
+
+ private static List<String> readNameset(XmlPullParser parser)
+ throws XmlPullParserException, IOException {
+ List<String> names = new ArrayList<String>();
+ parser.require(XmlPullParser.START_TAG, null, "nameset");
+
+ while (parser.next() != XmlPullParser.END_TAG) {
+ if (parser.getEventType() != XmlPullParser.START_TAG) {
+ continue;
+ }
+ String tagname = parser.getName();
+ if (tagname.equals("name")) {
+ String name = readText(parser);
+ names.add(name);
+ } else {
+ skip(parser);
+ }
+ }
+ return names;
+ }
+
+ private static List<String> readFileset(XmlPullParser parser)
+ throws XmlPullParserException, IOException {
+ List<String> files = new ArrayList<String>();
+ parser.require(XmlPullParser.START_TAG, null, "fileset");
+
+ while (parser.next() != XmlPullParser.END_TAG) {
+ if (parser.getEventType() != XmlPullParser.START_TAG) {
+ continue;
+ }
+ String name = parser.getName();
+ if (name.equals("file")) {
+ String file = readText(parser);
+ files.add(file);
+ } else {
+ skip(parser);
+ }
+ }
+ return files;
+ }
+
+ // For the tags title and summary, extracts their text values.
+ private static String readText(XmlPullParser parser)
+ throws IOException, XmlPullParserException {
+ String result = "";
+ if (parser.next() == XmlPullParser.TEXT) {
+ result = parser.getText();
+ parser.nextTag();
+ }
+ return result;
+ }
+
+ private static void skip(XmlPullParser parser)
+ throws XmlPullParserException, IOException {
+ if (parser.getEventType() != XmlPullParser.START_TAG) {
+ throw new IllegalStateException();
+ }
+ int depth = 1;
+ while (depth != 0) {
+ switch (parser.next()) {
+ case XmlPullParser.END_TAG:
+ depth--;
+ break;
+ case XmlPullParser.START_TAG:
+ depth++;
+ break;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/java/android/graphics/Typeface.java b/graphics/java/android/graphics/Typeface.java
index db42314..5c62a86 100644
--- a/graphics/java/android/graphics/Typeface.java
+++ b/graphics/java/android/graphics/Typeface.java
@@ -25,7 +25,6 @@ import android.util.SparseArray;
import org.xmlpull.v1.XmlPullParserException;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
@@ -228,7 +227,10 @@ public class Typeface {
for (int i = 0; i < families.length; i++) {
ptrArray[i] = families[i].mNativePtr;
}
- return new Typeface(nativeCreateFromArray(ptrArray));
+
+
+ Typeface typeface = new Typeface(nativeCreateFromArray(ptrArray));
+ return typeface;
}
/**
@@ -275,10 +277,24 @@ public class Typeface {
private static void init() {
// Load font config and initialize Minikin state
File systemFontConfigLocation = getSystemFontConfigLocation();
- File configFilename = new File(systemFontConfigLocation, FONTS_CONFIG);
+ File themeFontConfigLocation = getThemeFontConfigLocation();
+
+ File systemConfigFilename = new File(systemFontConfigLocation, FONTS_CONFIG);
+ File themeConfigFilename = new File(themeFontConfigLocation, FONTS_CONFIG);
+ File configFilename = null;
+ File fontDir;
+
+
+ if (themeConfigFilename.exists()) {
+ configFilename = themeConfigFilename;
+ fontDir = getThemeFontConfigLocation();
+ } else {
+ configFilename = systemConfigFilename;
+ fontDir = getSystemFontDirLocation();
+ }
+
try {
- FileInputStream fontsIn = new FileInputStream(configFilename);
- FontListParser.Config fontConfig = FontListParser.parse(fontsIn);
+ FontListParser.Config fontConfig = FontListParser.parse(configFilename, fontDir);
List<FontFamily> familyList = new ArrayList<FontFamily>();
// Note that the default typeface is always present in the fallback list;
@@ -332,6 +348,33 @@ public class Typeface {
}
}
+ /**
+ * Clears caches in java and skia.
+ * Skia will then reparse font config
+ * @hide
+ */
+ public static void recreateDefaults() {
+ sTypefaceCache.clear();
+ sSystemFontMap.clear();
+ init();
+
+ long newDefault = create((String) null, 0).native_instance;
+ long newDefaultBold = create((String) null, Typeface.BOLD).native_instance;
+ long newSansSerif = create("sans-serif", 0).native_instance;
+ long newSerif = create("serif", 0).native_instance;
+ long newMonoSpace = create("monospace", 0).native_instance;
+ long newItalic = create((String) null, Typeface.ITALIC).native_instance;
+ long newBoldItalic = create((String) null, Typeface.BOLD_ITALIC).native_instance;
+
+ DEFAULT.native_instance = newDefault;
+ DEFAULT_BOLD.native_instance = newDefaultBold;
+ SANS_SERIF.native_instance = newSansSerif;
+ SERIF.native_instance = newSerif;
+ MONOSPACE.native_instance = newMonoSpace;
+ sDefaults[2].native_instance = newItalic;
+ sDefaults[3].native_instance = newBoldItalic;
+ }
+
static {
init();
// Set up defaults and typefaces exposed in public API
@@ -354,6 +397,18 @@ public class Typeface {
return new File("/system/etc/");
}
+ private static File getSystemFontDirLocation() {
+ return new File("/system/fonts/");
+ }
+
+ private static File getThemeFontConfigLocation() {
+ return new File("/data/system/theme/fonts/");
+ }
+
+ private static File getThemeFontDir() {
+ return new File("/data/system/theme/fonts/");
+ }
+
@Override
protected void finalize() throws Throwable {
try {
diff --git a/graphics/tests/localtests/Android.mk b/graphics/tests/localtests/Android.mk
new file mode 100644
index 0000000..0b95ecd
--- /dev/null
+++ b/graphics/tests/localtests/Android.mk
@@ -0,0 +1,18 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+# We only want this apk build for tests.
+LOCAL_MODULE_TAGS := tests
+LOCAL_MODULE := FrameworksGraphicsHostTests
+
+# Include all test java files.
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_JAVA_LIBRARIES := android.test.runner
+#LOCAL_PACKAGE_NAME := FrameworksGraphicsTests
+
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+#####################################
+
+
diff --git a/graphics/tests/localtests/src/android/graphics/FontListConverterTest.java b/graphics/tests/localtests/src/android/graphics/FontListConverterTest.java
new file mode 100644
index 0000000..60c9053
--- /dev/null
+++ b/graphics/tests/localtests/src/android/graphics/FontListConverterTest.java
@@ -0,0 +1,280 @@
+/*
+ * Copyright (C) 2014 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.graphics;
+
+import android.graphics.FontListParser.Alias;
+import android.graphics.LegacyFontListParser.Family;
+import android.test.suitebuilder.annotation.SmallTest;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+public class FontListConverterTest extends TestCase {
+ // VALID nameset includes the default name first and
+ // and some other 'aliases' with it.
+ private static final String[] VALID_NAMESET = {
+ "sans-serif",
+ "arial",
+ "helvetica",
+ "tahoma",
+ "verdana"
+ };
+
+ // The correct fileset will have 4 files in
+ // order by type (regular, bold, italic, bolditalic)
+ private static final String[] VALID_FILESET = {
+ "Roboto-Regular.ttf",
+ "Roboto-Bold.ttf",
+ "Roboto-Italic.ttf",
+ "Roboto-BoldItalic.ttf"
+ };
+
+ // The legacy fontlist format considered thin, light, and black styles
+ // each as part of their own familysets. The new format does not, so we need
+ // to provide a test case to adapt this. Note: "condensed" is still considered
+ // to be its own familyset. So we must be careful
+ private static final String[] VALID_ADDITIONAL_STYLE_NAMESET = {
+ "sans-serif-thin"
+ };
+
+ private static final String[] VALID_ADDITIONAL_STYLE_FILESET = {
+ "Roboto-Thin.ttf",
+ "Roboto-ThinItalic.ttf"
+ };
+
+ // thin, light, and black styles are part of the same family but a Roboto "condensed"
+ // or Roboto "slab" would be considered part of a different family. Since the legacy
+ // format would already consider these as a different family, we just have to make sure
+ // they don't get brought back into a common family like thin/light/black
+ private static final String[] VALID_RELATED_FAMILY_NAMESET = {
+ "sans-serif-condensed"
+ };
+
+ private static final String[] VALID_RELATED_FAMILY_FILESET = {
+ "RobotoCondensed-Regular.ttf",
+ "RobotoCondensed-Bold.ttf",
+ "RobotoCondensed-Italic.ttf",
+ "RobotoCondensed-BoldItalic.ttf"
+ };
+
+ // Some typefaces will only have one style.
+ private static final String[] VALID_SINGLE_STYLE_FAMIlY_NAMESET = {
+ "monospace"
+ };
+ private static final String[] VALID_SINGLE_STYLE_FAMIlY_FILESET = {
+ "DroidSansMono.ttf"
+ };
+
+ final String VALID_PATH = "/valid/path/";
+
+ private Family sValidFamily; // eg "sans-serif"
+ private Family sValidAdditionalStyleFamily; // eg "sans-serif-light"
+ private Family sValidRelatedFamily; // eg "sans-serif-condensed"
+ private Family mValidSingleStyleFamily; // eg "monospace" which only uses DroidSansMono.ttf
+
+ protected void setUp() {
+ sValidFamily = new Family();
+ sValidFamily.nameset = new ArrayList<String>(Arrays.asList(VALID_NAMESET));
+ sValidFamily.fileset = new ArrayList<String>(Arrays.asList(VALID_FILESET));
+
+ sValidAdditionalStyleFamily = new Family();
+ sValidAdditionalStyleFamily.nameset =
+ new ArrayList<String>(Arrays.asList(VALID_ADDITIONAL_STYLE_NAMESET));
+ sValidAdditionalStyleFamily.fileset =
+ new ArrayList<String>(Arrays.asList(VALID_ADDITIONAL_STYLE_FILESET));
+
+ sValidRelatedFamily = new Family();
+ sValidRelatedFamily.nameset =
+ new ArrayList<String>(Arrays.asList(VALID_RELATED_FAMILY_NAMESET));
+ sValidRelatedFamily.fileset =
+ new ArrayList<String>(Arrays.asList(VALID_RELATED_FAMILY_FILESET));
+
+ mValidSingleStyleFamily = new Family();
+ }
+
+ @SmallTest
+ public void testValidAdaptedFamilyShouldHaveNameOfNamesetsFirstElement() {
+ FontListConverter adapter = new FontListConverter(sValidFamily, VALID_PATH);
+ FontListParser.Family convertedFamily = adapter.convertFamily(sValidFamily);
+ assertEquals(VALID_NAMESET[0], convertedFamily.name);
+ }
+
+ @SmallTest
+ public void testValidAdaptedFamilyShouldHaveFonts() {
+ FontListConverter adapter = new FontListConverter(sValidFamily, VALID_PATH);
+ FontListParser.Family convertedFamily = adapter.convertFamily(sValidFamily);
+ List<FontListParser.Font> fonts = convertedFamily.fonts;
+ assertEquals(VALID_FILESET.length, fonts.size());
+ }
+
+ @SmallTest
+ public void testValidAdaptedFontsShouldHaveCorrectProperties() {
+ FontListConverter adapter = new FontListConverter(sValidFamily, VALID_PATH);
+ List<FontListParser.Font> fonts = adapter.convertFonts(Arrays.asList(VALID_FILESET));
+
+ assertEquals(VALID_FILESET.length, fonts.size());
+ for(int i=0; i < fonts.size(); i++) {
+ FontListParser.Font font = fonts.get(i);
+ assertEquals(VALID_PATH + VALID_FILESET[i], font.fontName);
+ assertEquals("shouldBeItalic", shouldBeItalic(i), font.isItalic);
+ assertEquals(FontListConverter.WEIGHTS[i], font.weight);
+ }
+ }
+
+ @SmallTest
+ public void testExtraNamesetsShouldConvertToAliases() {
+ List<Family> families = new ArrayList<Family>();
+ families.add(sValidFamily);
+
+ FontListConverter adapter = new FontListConverter(sValidFamily, VALID_PATH);
+ List<FontListParser.Alias> aliases = adapter.createAliases();
+
+ // Be sure the aliases point to the first name in the nameset
+ for(int i = 0; i < aliases.size(); i++) {
+ FontListParser.Alias alias = aliases.get(i);
+ assertEquals(VALID_NAMESET[0], alias.toName);
+ }
+
+ // Be sure the extra namesets are in the alias list
+ for(int i = 1; i < VALID_NAMESET.length; i++) {
+ assertTrue("hasAliasWithName", hasAliasWithName(aliases, VALID_NAMESET[i]));
+ }
+ }
+
+ /**
+ * The legacy format treats thin, light, and black fonts to be different families
+ * The new format treats these as all part of the original
+ * eg sans-serif and sans-serif-thin become one family
+ */
+ @SmallTest
+ public void testAdditionalStylesShouldConvertToSameFamily() {
+ List<Family> families = new ArrayList<Family>();
+ families.add(sValidFamily); //eg "sans-serif"
+ families.add(sValidAdditionalStyleFamily); //eg "sans-serif-light"
+
+ FontListConverter adapter = new FontListConverter(families, VALID_PATH);
+ List<FontListParser.Family> convertedFamilies = adapter.convertFamilies();
+
+ // We started with two similiar families, and now should have one
+ assertEquals(1, convertedFamilies.size());
+
+ // The name of the family should be the base name, no style modifiers
+ // ie "sans-serif" not "sans-serif-light"
+ FontListParser.Family convertedFamily = convertedFamilies.get(0);
+ assertEquals(sValidFamily.nameset.get(0), convertedFamily.name);
+
+ // Verify all the fonts from both families exist now in the converted Family
+ List<String> combinedFileSet = new ArrayList<String>();
+ combinedFileSet.addAll(sValidFamily.fileset);
+ combinedFileSet.addAll(sValidAdditionalStyleFamily.fileset);
+ for(String filename : combinedFileSet) {
+ String fontName = VALID_PATH + filename;
+ assertTrue("hasFontWithName", hasFontWithName(convertedFamily, fontName));
+ }
+ }
+
+ /**
+ * When two families combine, the "varied" family (ie light, light, black) should
+ * have their namesets converted to aliases.
+ * IE sans-serif-light should point to sans-serif because the light family
+ * gets merged to sans-serif
+ */
+ @SmallTest
+ public void testAdditionalStylesNamesShouldBecomeAliases() {
+ List<Family> families = new ArrayList<Family>();
+ families.add(sValidFamily); //eg "sans-serif"
+ families.add(sValidAdditionalStyleFamily); //eg "sans-serif-light"
+
+ FontListConverter adapter = new FontListConverter(families, VALID_PATH);
+ List<Alias> aliases = adapter.createAliases();
+
+ // Subtract 1 from the total length since VALID_NAMESET[0] will be the family name
+ int expectedSize = VALID_NAMESET.length + VALID_ADDITIONAL_STYLE_NAMESET.length - 1;
+ assertEquals(expectedSize, aliases.size());
+
+ // All aliases should point at the base family
+ for(Alias alias : aliases) {
+ assertEquals(VALID_NAMESET[0], alias.toName);
+ }
+
+ // There should be an alias for every name in the merged in family
+ for(String name : VALID_ADDITIONAL_STYLE_NAMESET) {
+ assertTrue("hasAliasWithName", hasAliasWithName(aliases, name));
+ }
+ }
+
+ /**
+ * sans-serif-condensed should not get merged in with sans-serif
+ */
+ @SmallTest
+ public void testSimiliarFontsShouldKeepSameFamily() {
+ List<Family> families = new ArrayList<Family>();
+ families.add(sValidFamily); //eg "sans-serif"
+ families.add(sValidRelatedFamily); //eg "sans-serif-condensed"
+
+ FontListConverter adapter = new FontListConverter(families, VALID_PATH);
+ List<FontListParser.Family> convertedFamilies = adapter.convertFamilies();
+ FontListParser.Family convertedValidFamily =
+ getFontListFamilyWithName(convertedFamilies, VALID_NAMESET[0]);
+ FontListParser.Family convertedRelatedFamily =
+ getFontListFamilyWithName(convertedFamilies, VALID_RELATED_FAMILY_NAMESET[0]);
+
+
+ // Valid family should only have its own fonts. Will fail if these were merged
+ for(String filename : sValidFamily.fileset) {
+ String fontName = VALID_PATH + filename;
+ assertTrue("hasFontWithName", hasFontWithName(convertedValidFamily, fontName));
+ assertFalse("hasFontWIthName", hasFontWithName(convertedRelatedFamily, fontName));
+ }
+
+ // Related family should also only have have its own fonts. Will fail if these were merged
+ for(String filename : sValidRelatedFamily.fileset) {
+ String fontName = VALID_PATH + filename;
+ assertTrue("hasFontWithName", hasFontWithName(convertedRelatedFamily, fontName));
+ assertFalse("hasFontWIthName", hasFontWithName(convertedValidFamily, fontName));
+ }
+ }
+
+ private static boolean hasAliasWithName(List<Alias> aliases, String name) {
+ for (Alias alias : aliases) if (name.equals(alias.name)) return true;
+ return false;
+ }
+
+ private static boolean hasFontWithName(FontListParser.Family family, String name) {
+ for (FontListParser.Font font : family.fonts) {
+ if(font.fontName != null && font.fontName.equals(name)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static FontListParser.Family getFontListFamilyWithName(
+ List<FontListParser.Family> families, String name) {
+ for(FontListParser.Family family : families) {
+ if (name.equals(family.name)) return family;
+ }
+ return null;
+ }
+
+ private boolean shouldBeItalic(int index) {
+ // Since the fileset format is regular, bold, italic, bolditalic, anything >= 2 is italic
+ return index >= 2;
+ }
+}
diff --git a/graphics/tests/localtests/src/android/graphics/TypefaceTestSuite.java b/graphics/tests/localtests/src/android/graphics/TypefaceTestSuite.java
new file mode 100644
index 0000000..9ef8421
--- /dev/null
+++ b/graphics/tests/localtests/src/android/graphics/TypefaceTestSuite.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.graphics;
+
+import junit.framework.TestSuite;
+
+public class TypefaceTestSuite {
+ public static TestSuite suite() {
+ TestSuite suite = new TestSuite(TypefaceTestSuite.class.getName());
+ suite.addTestSuite(FontListConverterTest.class);
+ return suite;
+ }
+}