Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: src/ports/SkFontConfigParser_android.cpp

Issue 458543002: Update path to Android font config file (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move lower-case fix to a different patch Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ }
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698