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

Side by Side Diff: src/ports/SkFontHost_FreeType.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/fonts/SkGScalerContext.cpp ('k') | src/ports/SkFontHost_FreeType_common.h » ('j') | 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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 // we cache this value, using -1 as a sentinel for "not computed" 1396 // we cache this value, using -1 as a sentinel for "not computed"
1397 if (fGlyphCount < 0) { 1397 if (fGlyphCount < 0) {
1398 AutoFTAccess fta(this); 1398 AutoFTAccess fta(this);
1399 FT_Face face = fta.face(); 1399 FT_Face face = fta.face();
1400 // if the face failed, we still assign a non-negative value 1400 // if the face failed, we still assign a non-negative value
1401 fGlyphCount = face ? face->num_glyphs : 0; 1401 fGlyphCount = face ? face->num_glyphs : 0;
1402 } 1402 }
1403 return fGlyphCount; 1403 return fGlyphCount;
1404 } 1404 }
1405 1405
1406 SkTypeface::LocalizedStrings* SkTypeface_FreeType::onGetFamilyNames() const { 1406 SkTypeface::LocalizedStrings* SkTypeface_FreeType::onCreateFamilyNameIterator() const {
1407 SkTypeface::LocalizedStrings* nameIter = 1407 SkTypeface::LocalizedStrings* nameIter =
1408 SkOTUtils::LocalizedStrings_NameTable::CreateForFamilyNames(*this); 1408 SkOTUtils::LocalizedStrings_NameTable::CreateForFamilyNames(*this);
1409 if (NULL == nameIter) { 1409 if (NULL == nameIter) {
1410 SkString familyName; 1410 SkString familyName;
1411 this->getFamilyName(&familyName); 1411 this->getFamilyName(&familyName);
1412 SkString language("und"); //undetermined 1412 SkString language("und"); //undetermined
1413 nameIter = new SkOTUtils::LocalizedStrings_SingleName(familyName, langua ge); 1413 nameIter = new SkOTUtils::LocalizedStrings_SingleName(familyName, langua ge);
1414 } 1414 }
1415 return nameIter; 1415 return nameIter;
1416 } 1416 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1526 *style = (SkTypeface::Style) tempStyle; 1526 *style = (SkTypeface::Style) tempStyle;
1527 } 1527 }
1528 if (isFixedPitch) { 1528 if (isFixedPitch) {
1529 *isFixedPitch = FT_IS_FIXED_WIDTH(face); 1529 *isFixedPitch = FT_IS_FIXED_WIDTH(face);
1530 } 1530 }
1531 1531
1532 FT_Done_Face(face); 1532 FT_Done_Face(face);
1533 FT_Done_FreeType(library); 1533 FT_Done_FreeType(library);
1534 return true; 1534 return true;
1535 } 1535 }
OLDNEW
« no previous file with comments | « src/fonts/SkGScalerContext.cpp ('k') | src/ports/SkFontHost_FreeType_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698