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 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1320 SkTypeface* typeface, | 1320 SkTypeface* typeface, |
1321 uint16_t glyphID) | 1321 uint16_t glyphID) |
1322 : SkPDFFont(info, typeface, nullptr) { | 1322 : SkPDFFont(info, typeface, nullptr) { |
1323 this->populate(glyphID); | 1323 this->populate(glyphID); |
1324 } | 1324 } |
1325 | 1325 |
1326 SkPDFType3Font::~SkPDFType3Font() {} | 1326 SkPDFType3Font::~SkPDFType3Font() {} |
1327 | 1327 |
1328 bool SkPDFType3Font::populate(uint16_t glyphID) { | 1328 bool SkPDFType3Font::populate(uint16_t glyphID) { |
1329 SkPaint paint; | 1329 SkPaint paint; |
1330 paint.setTypeface(sk_ref_sp(this->typeface())); | 1330 paint.setTypeface(typeface()); |
1331 paint.setTextSize(1000); | 1331 paint.setTextSize(1000); |
1332 const SkSurfaceProps props(0, kUnknown_SkPixelGeometry); | 1332 const SkSurfaceProps props(0, kUnknown_SkPixelGeometry); |
1333 SkAutoGlyphCache autoCache(paint, &props, nullptr); | 1333 SkAutoGlyphCache autoCache(paint, &props, nullptr); |
1334 SkGlyphCache* cache = autoCache.getCache(); | 1334 SkGlyphCache* cache = autoCache.getCache(); |
1335 // If fLastGlyphID isn't set (because there is not fFontInfo), look it up. | 1335 // If fLastGlyphID isn't set (because there is not fFontInfo), look it up. |
1336 if (lastGlyphID() == 0) { | 1336 if (lastGlyphID() == 0) { |
1337 setLastGlyphID(cache->getGlyphCount() - 1); | 1337 setLastGlyphID(cache->getGlyphCount() - 1); |
1338 } | 1338 } |
1339 | 1339 |
1340 adjustGlyphRangeForSingleByteEncoding(glyphID); | 1340 adjustGlyphRangeForSingleByteEncoding(glyphID); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1436 } | 1436 } |
1437 return *canon->fCanEmbedTypeface.set(id, canEmbed); | 1437 return *canon->fCanEmbedTypeface.set(id, canEmbed); |
1438 } | 1438 } |
1439 | 1439 |
1440 void SkPDFFont::drop() { | 1440 void SkPDFFont::drop() { |
1441 fTypeface = nullptr; | 1441 fTypeface = nullptr; |
1442 fFontInfo = nullptr; | 1442 fFontInfo = nullptr; |
1443 fDescriptor = nullptr; | 1443 fDescriptor = nullptr; |
1444 this->SkPDFDict::drop(); | 1444 this->SkPDFDict::drop(); |
1445 } | 1445 } |
OLD | NEW |