OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 <ctype.h> | 8 #include <ctype.h> |
9 | 9 |
10 #include "SkData.h" | 10 #include "SkData.h" |
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1196 SkPDFDict* relatedFontDescriptor) | 1196 SkPDFDict* relatedFontDescriptor) |
1197 : SkPDFFont(info, typeface, relatedFontDescriptor) { | 1197 : SkPDFFont(info, typeface, relatedFontDescriptor) { |
1198 this->populate(glyphID); | 1198 this->populate(glyphID); |
1199 } | 1199 } |
1200 | 1200 |
1201 SkPDFType1Font::~SkPDFType1Font() {} | 1201 SkPDFType1Font::~SkPDFType1Font() {} |
1202 | 1202 |
1203 bool SkPDFType1Font::addFontDescriptor(int16_t defaultWidth) { | 1203 bool SkPDFType1Font::addFontDescriptor(int16_t defaultWidth) { |
1204 if (SkPDFDict* descriptor = getFontDescriptor()) { | 1204 if (SkPDFDict* descriptor = getFontDescriptor()) { |
1205 this->insertObjRef("FontDescriptor", | 1205 this->insertObjRef("FontDescriptor", |
1206 sk_sp<SkPDFDict>(SkRef(descriptor))); | 1206 sk_ref_sp(descriptor)); |
1207 return true; | 1207 return true; |
1208 } | 1208 } |
1209 | 1209 |
1210 auto descriptor = sk_make_sp<SkPDFDict>("FontDescriptor"); | 1210 auto descriptor = sk_make_sp<SkPDFDict>("FontDescriptor"); |
1211 setFontDescriptor(descriptor.get()); | 1211 setFontDescriptor(descriptor.get()); |
1212 | 1212 |
1213 int ttcIndex; | 1213 int ttcIndex; |
1214 size_t header SK_INIT_TO_AVOID_WARNING; | 1214 size_t header SK_INIT_TO_AVOID_WARNING; |
1215 size_t data SK_INIT_TO_AVOID_WARNING; | 1215 size_t data SK_INIT_TO_AVOID_WARNING; |
1216 size_t trailer SK_INIT_TO_AVOID_WARNING; | 1216 size_t trailer SK_INIT_TO_AVOID_WARNING; |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1427 sk_sp<const SkAdvancedTypefaceMetrics> fontMetrics( | 1427 sk_sp<const SkAdvancedTypefaceMetrics> fontMetrics( |
1428 face->getAdvancedTypefaceMetrics( | 1428 face->getAdvancedTypefaceMetrics( |
1429 SkTypeface::kNo_PerGlyphInfo, nullptr, 0)); | 1429 SkTypeface::kNo_PerGlyphInfo, nullptr, 0)); |
1430 if (fontMetrics) { | 1430 if (fontMetrics) { |
1431 canEmbed = !SkToBool( | 1431 canEmbed = !SkToBool( |
1432 fontMetrics->fFlags & | 1432 fontMetrics->fFlags & |
1433 SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag); | 1433 SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag); |
1434 } | 1434 } |
1435 return *canon->fCanEmbedTypeface.set(id, canEmbed); | 1435 return *canon->fCanEmbedTypeface.set(id, canEmbed); |
1436 } | 1436 } |
OLD | NEW |