From aee878d767a3965ee6409be9c72bb9ae6266bf52 Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Thu, 10 Aug 2017 13:49:41 -0400 Subject: Move lang to list in Android font manager. Change-Id: Ia4af2769f4761e6b444ed0c232c48199872f3acc Reviewed-on: https://skia-review.googlesource.com/33480 Reviewed-by: Derek Sollenberger Commit-Queue: Ben Wagner --- tests/FontMgrAndroidParserTest.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'tests/FontMgrAndroidParserTest.cpp') diff --git a/tests/FontMgrAndroidParserTest.cpp b/tests/FontMgrAndroidParserTest.cpp index cbcfb3be2a..b5346ef5b6 100644 --- a/tests/FontMgrAndroidParserTest.cpp +++ b/tests/FontMgrAndroidParserTest.cpp @@ -45,11 +45,13 @@ void ValidateLoadedFonts(SkTDArray fontFamilies, const char* firstE REPORTER_ASSERT(reporter, !fontFamilies[0]->fIsFallbackFont); // Check that the languages are all sane. - for (int i = 0; i < fontFamilies.count(); ++i) { - const SkString& lang = fontFamilies[i]->fLanguage.getTag(); - for (size_t j = 0; j < lang.size(); ++j) { - int c = lang[j]; - REPORTER_ASSERT(reporter, isALPHA(c) || isDIGIT(c) || '-' == c); + for (const auto& fontFamily : fontFamilies) { + for (const auto& lang : fontFamily->fLanguages) { + const SkString& langString = lang.getTag(); + for (size_t i = 0; i < langString.size(); ++i) { + int c = langString[i]; + REPORTER_ASSERT(reporter, isALPHA(c) || isDIGIT(c) || '-' == c); + } } } @@ -81,8 +83,12 @@ void DumpLoadedFonts(SkTDArray fontFamilies, const char* label) { default: break; } SkDebugf(" basePath %s\n", fontFamilies[i]->fBasePath.c_str()); - if (!fontFamilies[i]->fLanguage.getTag().isEmpty()) { - SkDebugf(" language %s\n", fontFamilies[i]->fLanguage.getTag().c_str()); + if (!fontFamilies[i]->fLanguages.empty()) { + SkDebugf(" language"); + for (const auto& lang : fontFamilies[i]->fLanguages) { + SkDebugf(" %s", lang.getTag().c_str()); + } + SkDebugf("\n"); } for (int j = 0; j < fontFamilies[i]->fNames.count(); ++j) { SkDebugf(" name %s\n", fontFamilies[i]->fNames[j].c_str()); -- cgit v1.2.3