3 * Copyright 2011 Google Inc.
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
10 #ifndef SkPDFFontImpl_DEFINED
11 #define SkPDFFontImpl_DEFINED
13 #include "SkPDFFont.h"
15 class SkPDFType0Font : public SkPDFFont {
17 virtual ~SkPDFType0Font();
18 virtual bool multiByteGlyphs() const { return true; }
19 SK_API virtual SkPDFFont* getFontSubset(const SkPDFGlyphSet* usage);
21 virtual void emitObject(SkWStream* stream, SkPDFCatalog* catalog,
26 friend class SkPDFFont; // to access the constructor
29 typedef SkPDFDict INHERITED;
32 SkPDFType0Font(const SkAdvancedTypefaceMetrics* info, SkTypeface* typeface);
34 bool populate(const SkPDFGlyphSet* subset);
37 class SkPDFCIDFont : public SkPDFFont {
39 virtual ~SkPDFCIDFont();
40 virtual bool multiByteGlyphs() const { return true; }
43 friend class SkPDFType0Font; // to access the constructor
45 SkPDFCIDFont(const SkAdvancedTypefaceMetrics* info, SkTypeface* typeface,
46 const SkPDFGlyphSet* subset);
48 bool populate(const SkPDFGlyphSet* subset);
49 bool addFontDescriptor(int16_t defaultWidth,
50 const SkTDArray<uint32_t>* subset);
53 class SkPDFType1Font : public SkPDFFont {
55 virtual ~SkPDFType1Font();
56 virtual bool multiByteGlyphs() const { return false; }
59 friend class SkPDFFont; // to access the constructor
61 SkPDFType1Font(const SkAdvancedTypefaceMetrics* info, SkTypeface* typeface,
62 uint16_t glyphID, SkPDFDict* relatedFontDescriptor);
64 bool populate(int16_t glyphID);
65 bool addFontDescriptor(int16_t defaultWidth);
66 void addWidthInfoFromRange(int16_t defaultWidth,
67 const SkAdvancedTypefaceMetrics::WidthRange* widthRangeEntry);
70 class SkPDFType3Font : public SkPDFFont {
72 virtual ~SkPDFType3Font();
73 virtual bool multiByteGlyphs() const { return false; }
76 friend class SkPDFFont; // to access the constructor
78 SkPDFType3Font(const SkAdvancedTypefaceMetrics* info,
79 SkTypeface* typeface, uint16_t glyphID);
81 bool populate(int16_t glyphID);