Index: src/ports/SkFontConfigParser_android.cpp |
diff --git a/src/ports/SkFontConfigParser_android.cpp b/src/ports/SkFontConfigParser_android.cpp |
index c6a3cf261fc7230531c7dad3dd1daf8272bfe45f..6e8727048d4706412e96af4ddd3e9803fc18bda5 100644 |
--- a/src/ports/SkFontConfigParser_android.cpp |
+++ b/src/ports/SkFontConfigParser_android.cpp |
@@ -16,7 +16,14 @@ |
#include <limits> |
-#define SYSTEM_FONTS_FILE "/system/etc/system_fonts.xml" |
+ |
+ |
+// From Android version LMP onwards, all font files collapse into |
+// /system/fonts/fonts.xml. Instead of trying to detect which version |
djsollen
2014/08/13 13:31:53
too late, but update this in a future CL to reflec
|
+// we're on, try to open fonts.xml; if that fails, fall back to the |
+// older filename. |
+#define LMP_SYSTEM_FONTS_FILE "/system/etc/fonts.xml" |
+#define OLD_SYSTEM_FONTS_FILE "/system/etc/system_fonts.xml" |
#define FALLBACK_FONTS_FILE "/system/etc/fallback_fonts.xml" |
#define VENDOR_FONTS_FILE "/vendor/etc/fallback_fonts.xml" |
@@ -455,7 +462,11 @@ static void parseConfigFile(const char* filename, SkTDArray<FontFamily*> &famili |
} |
static void getSystemFontFamilies(SkTDArray<FontFamily*> &fontFamilies) { |
- parseConfigFile(SYSTEM_FONTS_FILE, fontFamilies); |
+ parseConfigFile(LMP_SYSTEM_FONTS_FILE, fontFamilies); |
+ |
+ if (0 == fontFamilies.count()) { |
djsollen
2014/08/13 13:31:52
seems potentially wrong to trigger on that in case
|
+ parseConfigFile(OLD_SYSTEM_FONTS_FILE, fontFamilies); |
+ } |
} |
/** |