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

Side by Side Diff: tests/FontNamesTest.cpp

Issue 21716005: Add getFamilyNames to SkTypeface. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ports/SkFontHost_win_dw.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « src/ports/SkFontHost_win_dw.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698