diff options
| author | 2023-07-03 14:25:26 +0900 | |
|---|---|---|
| committer | 2023-07-25 09:45:47 +0900 | |
| commit | e3510a82a0fbddbb71ba31a704cff7b4c09da60e (patch) | |
| tree | c6c9bfc4b1d56c3b990fcbb4773c66a0b5b2d1e9 /graphics/java/android | |
| parent | e7627bd73223e4f20a49a92acf42f4275aaa8c5e (diff) | |
Deprecate fonts.xml and add hidden font_fallback.xml
Not to break the apps that reads fonts.xml and add new features to
the system font customization at the same time, this CL introduces
new hidden XML file font_fallback.xml which is currently a copy of
the fonts.xml.
The fonts.xml still exists but may not contain the latest system font
settings due to compatibility problems. Application should use the
public API for accessing system installed fonts which is available
from API29.
Bug: 281769620
Test: atest CtsGraphicsTestCases
Test: atest CtsTextTestCases
Change-Id: I556b5fffb0c78f0c6150b472fd240b9a546de93f
Merged-In: I556b5fffb0c78f0c6150b472fd240b9a546de93f
Diffstat (limited to 'graphics/java/android')
| -rw-r--r-- | graphics/java/android/graphics/fonts/SystemFonts.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/fonts/SystemFonts.java b/graphics/java/android/graphics/fonts/SystemFonts.java index 6278c0e23f27..1c1723cbd195 100644 --- a/graphics/java/android/graphics/fonts/SystemFonts.java +++ b/graphics/java/android/graphics/fonts/SystemFonts.java @@ -46,7 +46,7 @@ import java.util.Set; public final class SystemFonts { private static final String TAG = "SystemFonts"; - private static final String FONTS_XML = "/system/etc/fonts.xml"; + private static final String FONTS_XML = "/system/etc/font_fallback.xml"; /** @hide */ public static final String SYSTEM_FONT_DIR = "/system/fonts/"; private static final String OEM_XML = "/product/etc/fonts_customization.xml"; @@ -208,6 +208,19 @@ public final class SystemFonts { } /** + * Get the updated FontConfig for testing purposes. + * @hide + */ + public static @NonNull FontConfig getSystemFontConfigForTesting( + @NonNull String fontsXmlPath, + @Nullable Map<String, File> updatableFontMap, + long lastModifiedDate, + int configVersion) { + return getSystemFontConfigInternal(fontsXmlPath, SYSTEM_FONT_DIR, OEM_XML, OEM_FONT_DIR, + updatableFontMap, lastModifiedDate, configVersion); + } + + /** * Get the updated FontConfig. * * @param updatableFontMap a font mapping of updated font files. |