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 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 &content); | 1383 &content); |
1384 const SkPath* path = cache->findPath(glyph); | 1384 const SkPath* path = cache->findPath(glyph); |
1385 if (path) { | 1385 if (path) { |
1386 SkPDFUtils::EmitPath(*path, paint.getStyle(), &content); | 1386 SkPDFUtils::EmitPath(*path, paint.getStyle(), &content); |
1387 SkPDFUtils::PaintPath(paint.getStyle(), path->getFillType(), | 1387 SkPDFUtils::PaintPath(paint.getStyle(), path->getFillType(), |
1388 &content); | 1388 &content); |
1389 } | 1389 } |
1390 SkAutoTDelete<SkMemoryStream> glyphStream(new SkMemoryStream()); | 1390 SkAutoTDelete<SkMemoryStream> glyphStream(new SkMemoryStream()); |
1391 glyphStream->setData(content.copyToData())->unref(); | 1391 glyphStream->setData(content.copyToData())->unref(); |
1392 | 1392 |
1393 SkAutoTUnref<SkPDFStream> glyphDescription( | 1393 charProcs->insertObjRef(characterName, |
1394 new SkPDFStream(glyphStream.get())); | 1394 new SkPDFStream(glyphStream.get())); |
1395 charProcs->insert(characterName.c_str(), | |
1396 new SkPDFObjRef(glyphDescription.get()))->unref(); | |
1397 } | 1395 } |
1398 | 1396 |
1399 insert("FontBBox", makeFontBBox(bbox, 1000))->unref(); | 1397 insert("FontBBox", makeFontBBox(bbox, 1000))->unref(); |
1400 insertInt("FirstChar", 1); | 1398 insertInt("FirstChar", 1); |
1401 insertInt("LastChar", lastGlyphID() - firstGlyphID() + 1); | 1399 insertInt("LastChar", lastGlyphID() - firstGlyphID() + 1); |
1402 insert("Widths", widthArray.get()); | 1400 insert("Widths", widthArray.get()); |
1403 insertName("CIDToGIDMap", "Identity"); | 1401 insertName("CIDToGIDMap", "Identity"); |
1404 | 1402 |
1405 populateToUnicodeTable(NULL); | 1403 populateToUnicodeTable(NULL); |
1406 return true; | 1404 return true; |
(...skipping 12 matching lines...) Expand all Loading... |
1419 } | 1417 } |
1420 if (existingFont != NULL) { | 1418 if (existingFont != NULL) { |
1421 return (existingFont->fFirstGlyphID <= searchGlyphID && | 1419 return (existingFont->fFirstGlyphID <= searchGlyphID && |
1422 searchGlyphID <= existingFont->fLastGlyphID) | 1420 searchGlyphID <= existingFont->fLastGlyphID) |
1423 ? SkPDFFont::kExact_Match | 1421 ? SkPDFFont::kExact_Match |
1424 : SkPDFFont::kRelated_Match; | 1422 : SkPDFFont::kRelated_Match; |
1425 } | 1423 } |
1426 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match | 1424 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match |
1427 : SkPDFFont::kRelated_Match; | 1425 : SkPDFFont::kRelated_Match; |
1428 } | 1426 } |
OLD | NEW |