| 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 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 *index = CanonicalFonts().find(search); | 868 *index = CanonicalFonts().find(search); |
| 869 return false; | 869 return false; |
| 870 } | 870 } |
| 871 | 871 |
| 872 SkPDFFont::SkPDFFont(SkAdvancedTypefaceMetrics* info, SkTypeface* typeface, | 872 SkPDFFont::SkPDFFont(SkAdvancedTypefaceMetrics* info, SkTypeface* typeface, |
| 873 SkPDFDict* relatedFontDescriptor) | 873 SkPDFDict* relatedFontDescriptor) |
| 874 : SkPDFDict("Font"), | 874 : SkPDFDict("Font"), |
| 875 fTypeface(ref_or_default(typeface)), | 875 fTypeface(ref_or_default(typeface)), |
| 876 fFirstGlyphID(1), | 876 fFirstGlyphID(1), |
| 877 fLastGlyphID(info ? info->fLastGlyphID : 0), | 877 fLastGlyphID(info ? info->fLastGlyphID : 0), |
| 878 fFontInfo(info), | 878 fFontInfo(SkSafeRef(info)), |
| 879 fDescriptor(relatedFontDescriptor) { | 879 fDescriptor(SkSafeRef(relatedFontDescriptor)) { |
| 880 SkSafeRef(info); | |
| 881 if (info == NULL) { | 880 if (info == NULL) { |
| 882 fFontType = SkAdvancedTypefaceMetrics::kNotEmbeddable_Font; | 881 fFontType = SkAdvancedTypefaceMetrics::kNotEmbeddable_Font; |
| 883 } else if (info->fMultiMaster) { | 882 } else if (info->fMultiMaster) { |
| 884 fFontType = SkAdvancedTypefaceMetrics::kOther_Font; | 883 fFontType = SkAdvancedTypefaceMetrics::kOther_Font; |
| 885 } else { | 884 } else { |
| 886 fFontType = info->fType; | 885 fFontType = info->fType; |
| 887 } | 886 } |
| 888 } | 887 } |
| 889 | 888 |
| 890 // static | 889 // static |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1422 | 1421 |
| 1423 insert("FontBBox", makeFontBBox(bbox, 1000))->unref(); | 1422 insert("FontBBox", makeFontBBox(bbox, 1000))->unref(); |
| 1424 insertInt("FirstChar", firstGlyphID()); | 1423 insertInt("FirstChar", firstGlyphID()); |
| 1425 insertInt("LastChar", lastGlyphID()); | 1424 insertInt("LastChar", lastGlyphID()); |
| 1426 insert("Widths", widthArray.get()); | 1425 insert("Widths", widthArray.get()); |
| 1427 insertName("CIDToGIDMap", "Identity"); | 1426 insertName("CIDToGIDMap", "Identity"); |
| 1428 | 1427 |
| 1429 populateToUnicodeTable(NULL); | 1428 populateToUnicodeTable(NULL); |
| 1430 return true; | 1429 return true; |
| 1431 } | 1430 } |
| OLD | NEW |