| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 "SkAdvancedTypefaceMetrics.h" | 8 #include "SkAdvancedTypefaceMetrics.h" |
| 9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 SkASSERT(glyphIndex < SkToUInt(numGlyphs)); | 449 SkASSERT(glyphIndex < SkToUInt(numGlyphs)); |
| 450 (*glyphToUnicode)[glyphIndex] = charCode; | 450 (*glyphToUnicode)[glyphIndex] = charCode; |
| 451 charCode = FT_Get_Next_Char(face, charCode, &glyphIndex); | 451 charCode = FT_Get_Next_Char(face, charCode, &glyphIndex); |
| 452 } | 452 } |
| 453 } | 453 } |
| 454 | 454 |
| 455 SkAdvancedTypefaceMetrics* SkTypeface_FreeType::onGetAdvancedTypefaceMetrics( | 455 SkAdvancedTypefaceMetrics* SkTypeface_FreeType::onGetAdvancedTypefaceMetrics( |
| 456 PerGlyphInfo perGlyphInfo, | 456 PerGlyphInfo perGlyphInfo, |
| 457 const uint32_t* glyphIDs, | 457 const uint32_t* glyphIDs, |
| 458 uint32_t glyphIDsCount) const { | 458 uint32_t glyphIDsCount) const { |
| 459 #if defined(SK_BUILD_FOR_MAC) | |
| 460 return nullptr; | |
| 461 #else | |
| 462 AutoFTAccess fta(this); | 459 AutoFTAccess fta(this); |
| 463 FT_Face face = fta.face(); | 460 FT_Face face = fta.face(); |
| 464 if (!face) { | 461 if (!face) { |
| 465 return nullptr; | 462 return nullptr; |
| 466 } | 463 } |
| 467 | 464 |
| 468 SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics; | 465 SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics; |
| 469 info->fFontName.set(FT_Get_Postscript_Name(face)); | 466 info->fFontName.set(FT_Get_Postscript_Name(face)); |
| 470 info->fFlags = SkAdvancedTypefaceMetrics::kEmpty_FontFlag; | 467 info->fFlags = SkAdvancedTypefaceMetrics::kEmpty_FontFlag; |
| 471 if (FT_HAS_MULTIPLE_MASTERS(face)) { | 468 if (FT_HAS_MULTIPLE_MASTERS(face)) { |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 } | 644 } |
| 648 } | 645 } |
| 649 | 646 |
| 650 if (perGlyphInfo & kToUnicode_PerGlyphInfo && | 647 if (perGlyphInfo & kToUnicode_PerGlyphInfo && |
| 651 info->fType != SkAdvancedTypefaceMetrics::kType1_Font && | 648 info->fType != SkAdvancedTypefaceMetrics::kType1_Font && |
| 652 face->num_charmaps) { | 649 face->num_charmaps) { |
| 653 populate_glyph_to_unicode(face, &(info->fGlyphToUnicode)); | 650 populate_glyph_to_unicode(face, &(info->fGlyphToUnicode)); |
| 654 } | 651 } |
| 655 | 652 |
| 656 return info; | 653 return info; |
| 657 #endif | |
| 658 } | 654 } |
| 659 | 655 |
| 660 /////////////////////////////////////////////////////////////////////////// | 656 /////////////////////////////////////////////////////////////////////////// |
| 661 | 657 |
| 662 static bool bothZero(SkScalar a, SkScalar b) { | 658 static bool bothZero(SkScalar a, SkScalar b) { |
| 663 return 0 == a && 0 == b; | 659 return 0 == a && 0 == b; |
| 664 } | 660 } |
| 665 | 661 |
| 666 // returns false if there is any non-90-rotation or skew | 662 // returns false if there is any non-90-rotation or skew |
| 667 static bool isAxisAligned(const SkScalerContext::Rec& rec) { | 663 static bool isAxisAligned(const SkScalerContext::Rec& rec) { |
| (...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1836 SkDEBUGF(("Requested font axis not found: %s '%c%c%c%c'\n", | 1832 SkDEBUGF(("Requested font axis not found: %s '%c%c%c%c'\n", |
| 1837 name.c_str(), | 1833 name.c_str(), |
| 1838 (skTag >> 24) & 0xFF, | 1834 (skTag >> 24) & 0xFF, |
| 1839 (skTag >> 16) & 0xFF, | 1835 (skTag >> 16) & 0xFF, |
| 1840 (skTag >> 8) & 0xFF, | 1836 (skTag >> 8) & 0xFF, |
| 1841 (skTag) & 0xFF)); | 1837 (skTag) & 0xFF)); |
| 1842 } | 1838 } |
| 1843 } | 1839 } |
| 1844 ) | 1840 ) |
| 1845 } | 1841 } |
| OLD | NEW |