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 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(info), |
879 fDescriptor(relatedFontDescriptor) { | 879 fDescriptor(relatedFontDescriptor) { |
880 SkSafeRef(typeface); | |
881 SkSafeRef(info); | 880 SkSafeRef(info); |
882 if (info == NULL) { | 881 if (info == NULL) { |
883 fFontType = SkAdvancedTypefaceMetrics::kNotEmbeddable_Font; | 882 fFontType = SkAdvancedTypefaceMetrics::kNotEmbeddable_Font; |
884 } else if (info->fMultiMaster) { | 883 } else if (info->fMultiMaster) { |
885 fFontType = SkAdvancedTypefaceMetrics::kOther_Font; | 884 fFontType = SkAdvancedTypefaceMetrics::kOther_Font; |
886 } else { | 885 } else { |
887 fFontType = info->fType; | 886 fFontType = info->fType; |
888 } | 887 } |
889 } | 888 } |
890 | 889 |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1423 | 1422 |
1424 insert("FontBBox", makeFontBBox(bbox, 1000))->unref(); | 1423 insert("FontBBox", makeFontBBox(bbox, 1000))->unref(); |
1425 insertInt("FirstChar", firstGlyphID()); | 1424 insertInt("FirstChar", firstGlyphID()); |
1426 insertInt("LastChar", lastGlyphID()); | 1425 insertInt("LastChar", lastGlyphID()); |
1427 insert("Widths", widthArray.get()); | 1426 insert("Widths", widthArray.get()); |
1428 insertName("CIDToGIDMap", "Identity"); | 1427 insertName("CIDToGIDMap", "Identity"); |
1429 | 1428 |
1430 populateToUnicodeTable(NULL); | 1429 populateToUnicodeTable(NULL); |
1431 return true; | 1430 return true; |
1432 } | 1431 } |
OLD | NEW |