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 <vector> | 9 #include <vector> |
10 #ifdef SK_BUILD_FOR_MAC | 10 #ifdef SK_BUILD_FOR_MAC |
(...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1721 | 1721 |
1722 // DEPRECATED | 1722 // DEPRECATED |
1723 SkTypeface* SkFontHost::NextLogicalTypeface(SkFontID currFontID, SkFontID origFo
ntID) { | 1723 SkTypeface* SkFontHost::NextLogicalTypeface(SkFontID currFontID, SkFontID origFo
ntID) { |
1724 SkTypeface* face = GetDefaultFace(); | 1724 SkTypeface* face = GetDefaultFace(); |
1725 if (face->uniqueID() == currFontID) { | 1725 if (face->uniqueID() == currFontID) { |
1726 face = NULL; | 1726 face = NULL; |
1727 } | 1727 } |
1728 return SkSafeRef(face); | 1728 return SkSafeRef(face); |
1729 } | 1729 } |
1730 | 1730 |
1731 // DEPRECATED | |
1732 int SkFontHost::CountTables(SkFontID fontID) { | |
1733 SkTypeface* face = SkTypefaceCache::FindByID(fontID); | |
1734 return face ? face->onGetTableTags(NULL) : 0; | |
1735 } | |
1736 | |
1737 // DEPRECATED | |
1738 int SkFontHost::GetTableTags(SkFontID fontID, SkFontTableTag tags[]) { | |
1739 SkTypeface* face = SkTypefaceCache::FindByID(fontID); | |
1740 return face ? face->onGetTableTags(tags) : 0; | |
1741 } | |
1742 | |
1743 // DEPRECATED | |
1744 size_t SkFontHost::GetTableSize(SkFontID fontID, SkFontTableTag tag) { | |
1745 SkTypeface* face = SkTypefaceCache::FindByID(fontID); | |
1746 return face ? face->onGetTableData(tag, 0, ~0U, NULL) : 0; | |
1747 } | |
1748 | |
1749 // DEPRECATED | |
1750 size_t SkFontHost::GetTableData(SkFontID fontID, SkFontTableTag tag, | |
1751 size_t offset, size_t length, void* dst) { | |
1752 SkTypeface* face = SkTypefaceCache::FindByID(fontID); | |
1753 return face ? face->onGetTableData(tag, offset, length, dst) : 0; | |
1754 } | |
1755 | |
1756 /////////////////////////////////////////////////////////////////////////////// | 1731 /////////////////////////////////////////////////////////////////////////////// |
1757 /////////////////////////////////////////////////////////////////////////////// | 1732 /////////////////////////////////////////////////////////////////////////////// |
1758 | 1733 |
1759 int SkTypeface_Mac::onGetUPEM() const { | 1734 int SkTypeface_Mac::onGetUPEM() const { |
1760 AutoCFRelease<CGFontRef> cgFont(CTFontCopyGraphicsFont(fFontRef, NULL)); | 1735 AutoCFRelease<CGFontRef> cgFont(CTFontCopyGraphicsFont(fFontRef, NULL)); |
1761 return CGFontGetUnitsPerEm(cgFont); | 1736 return CGFontGetUnitsPerEm(cgFont); |
1762 } | 1737 } |
1763 | 1738 |
1764 // If, as is the case with web fonts, the CTFont data isn't available, | 1739 // If, as is the case with web fonts, the CTFont data isn't available, |
1765 // the CGFont data may work. While the CGFont may always provide the | 1740 // the CGFont data may work. While the CGFont may always provide the |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1883 } | 1858 } |
1884 | 1859 |
1885 void SkTypeface_Mac::onGetFontDescriptor(SkFontDescriptor* desc) const { | 1860 void SkTypeface_Mac::onGetFontDescriptor(SkFontDescriptor* desc) const { |
1886 this->INHERITED::onGetFontDescriptor(desc); | 1861 this->INHERITED::onGetFontDescriptor(desc); |
1887 SkString tmpStr; | 1862 SkString tmpStr; |
1888 | 1863 |
1889 desc->setFamilyName(get_str(CTFontCopyFamilyName(fFontRef), &tmpStr)); | 1864 desc->setFamilyName(get_str(CTFontCopyFamilyName(fFontRef), &tmpStr)); |
1890 desc->setFullName(get_str(CTFontCopyFullName(fFontRef), &tmpStr)); | 1865 desc->setFullName(get_str(CTFontCopyFullName(fFontRef), &tmpStr)); |
1891 desc->setPostscriptName(get_str(CTFontCopyPostScriptName(fFontRef), &tmpStr)
); | 1866 desc->setPostscriptName(get_str(CTFontCopyPostScriptName(fFontRef), &tmpStr)
); |
1892 } | 1867 } |
OLD | NEW |