| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "Test.h" | 8 #include "Test.h" |
| 9 | 9 |
| 10 #include "SkCommandLineFlags.h" | 10 #include "SkCommandLineFlags.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 //TODO: SkFontMgr_fontconfig always returns NULL? | 157 //TODO: SkFontMgr_fontconfig always returns NULL? |
| 158 continue; | 158 continue; |
| 159 } | 159 } |
| 160 | 160 |
| 161 SkString familyName; | 161 SkString familyName; |
| 162 typeface->getFamilyName(&familyName); | 162 typeface->getFamilyName(&familyName); |
| 163 if (verbose) { | 163 if (verbose) { |
| 164 printf("[%s]\n", familyName.c_str()); | 164 printf("[%s]\n", familyName.c_str()); |
| 165 } | 165 } |
| 166 | 166 |
| 167 SkAutoTDelete<SkTypeface::LocalizedStrings> familyNamesIter(typeface
->getFamilyNames()); | 167 SkAutoTUnref<SkTypeface::LocalizedStrings> familyNamesIter( |
| 168 typeface->createFamilyNameIterator()); |
| 168 SkTypeface::LocalizedString familyNameLocalized; | 169 SkTypeface::LocalizedString familyNameLocalized; |
| 169 while (familyNamesIter->next(&familyNameLocalized)) { | 170 while (familyNamesIter->next(&familyNameLocalized)) { |
| 170 if (verbose) { | 171 if (verbose) { |
| 171 printf("(%s) <%s>\n", familyNameLocalized.fString.c_str(), | 172 printf("(%s) <%s>\n", familyNameLocalized.fString.c_str(), |
| 172 familyNameLocalized.fLanguage.c_str())
; | 173 familyNameLocalized.fLanguage.c_str())
; |
| 173 } | 174 } |
| 174 } | 175 } |
| 175 | 176 |
| 176 size_t nameTableSize = typeface->getTableSize(nameTag); | 177 size_t nameTableSize = typeface->getTableSize(nameTag); |
| 177 if (0 == nameTableSize) { | 178 if (0 == nameTableSize) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 218 |
| 218 DEFINE_bool(verboseFontNames, false, "verbose FontNames test."); | 219 DEFINE_bool(verboseFontNames, false, "verbose FontNames test."); |
| 219 | 220 |
| 220 static void TestFontNames(skiatest::Reporter* reporter) { | 221 static void TestFontNames(skiatest::Reporter* reporter) { |
| 221 test_synthetic(reporter, FLAGS_verboseFontNames); | 222 test_synthetic(reporter, FLAGS_verboseFontNames); |
| 222 test_systemfonts(reporter, FLAGS_verboseFontNames); | 223 test_systemfonts(reporter, FLAGS_verboseFontNames); |
| 223 } | 224 } |
| 224 | 225 |
| 225 #include "TestClassDef.h" | 226 #include "TestClassDef.h" |
| 226 DEFINE_TESTCLASS("FontNames", FontNamesTestClass, TestFontNames) | 227 DEFINE_TESTCLASS("FontNames", FontNamesTestClass, TestFontNames) |
| OLD | NEW |