OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |