From 7a4747f4f62e4896d8f8469e1939b8191fff8d4e Mon Sep 17 00:00:00 2001 From: tomhudson Date: Wed, 13 Aug 2014 11:06:43 -0700 Subject: [PATCH] Update path to Android font config file In version LMP, Android is expected to change the path to their font configuration file (and condense several files into one), as well as changing the format (qv http://crrev.com/446473003/). This patch tries the new path before falling back to the old path. The new fonts are incompatible with assumptions made by the old SkFontConfigInterfaceAndroid, so this patch MUST NOT land until https://crrev.com/462073002/ or the equivalent has turned on the new SkFontManager. BUG=chromium:400801 R=djsollen@google.com, bungeman@google.com, tomhudson@google.com Committed: https://skia.googlesource.com/skia/+/94fa4b99e2a53e997a90c7808cc5263f1bf40c9f Author: tomhudson@chromium.org Review URL: https://codereview.chromium.org/458543002 --- src/ports/SkFontConfigParser_android.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ports/SkFontConfigParser_android.cpp b/src/ports/SkFontConfigParser_android.cpp index e9c912f..658055d 100644 --- a/src/ports/SkFontConfigParser_android.cpp +++ b/src/ports/SkFontConfigParser_android.cpp @@ -19,7 +19,7 @@ // From Android version LMP onwards, all font files collapse into -// /system/fonts/fonts.xml. Instead of trying to detect which version +// /system/etc/fonts.xml. Instead of trying to detect which version // 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" @@ -465,9 +465,10 @@ static void parseConfigFile(const char* filename, SkTDArray &famili } static void getSystemFontFamilies(SkTDArray &fontFamilies) { + int initialCount = fontFamilies.count(); parseConfigFile(LMP_SYSTEM_FONTS_FILE, fontFamilies); - if (0 == fontFamilies.count()) { + if (initialCount == fontFamilies.count()) { parseConfigFile(OLD_SYSTEM_FONTS_FILE, fontFamilies); } } -- 2.7.4