michael@0: michael@0: /* michael@0: * Copyright 2011 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: michael@0: #ifndef SkPDFFontImpl_DEFINED michael@0: #define SkPDFFontImpl_DEFINED michael@0: michael@0: #include "SkPDFFont.h" michael@0: michael@0: class SkPDFType0Font : public SkPDFFont { michael@0: public: michael@0: virtual ~SkPDFType0Font(); michael@0: virtual bool multiByteGlyphs() const { return true; } michael@0: SK_API virtual SkPDFFont* getFontSubset(const SkPDFGlyphSet* usage); michael@0: #ifdef SK_DEBUG michael@0: virtual void emitObject(SkWStream* stream, SkPDFCatalog* catalog, michael@0: bool indirect); michael@0: #endif michael@0: michael@0: private: michael@0: friend class SkPDFFont; // to access the constructor michael@0: #ifdef SK_DEBUG michael@0: bool fPopulated; michael@0: typedef SkPDFDict INHERITED; michael@0: #endif michael@0: michael@0: SkPDFType0Font(SkAdvancedTypefaceMetrics* info, SkTypeface* typeface); michael@0: michael@0: bool populate(const SkPDFGlyphSet* subset); michael@0: }; michael@0: michael@0: class SkPDFCIDFont : public SkPDFFont { michael@0: public: michael@0: virtual ~SkPDFCIDFont(); michael@0: virtual bool multiByteGlyphs() const { return true; } michael@0: michael@0: private: michael@0: friend class SkPDFType0Font; // to access the constructor michael@0: michael@0: SkPDFCIDFont(SkAdvancedTypefaceMetrics* info, SkTypeface* typeface, michael@0: const SkPDFGlyphSet* subset); michael@0: michael@0: bool populate(const SkPDFGlyphSet* subset); michael@0: bool addFontDescriptor(int16_t defaultWidth, michael@0: const SkTDArray* subset); michael@0: }; michael@0: michael@0: class SkPDFType1Font : public SkPDFFont { michael@0: public: michael@0: virtual ~SkPDFType1Font(); michael@0: virtual bool multiByteGlyphs() const { return false; } michael@0: michael@0: private: michael@0: friend class SkPDFFont; // to access the constructor michael@0: michael@0: SkPDFType1Font(SkAdvancedTypefaceMetrics* info, SkTypeface* typeface, michael@0: uint16_t glyphID, SkPDFDict* relatedFontDescriptor); michael@0: michael@0: bool populate(int16_t glyphID); michael@0: bool addFontDescriptor(int16_t defaultWidth); michael@0: void addWidthInfoFromRange(int16_t defaultWidth, michael@0: const SkAdvancedTypefaceMetrics::WidthRange* widthRangeEntry); michael@0: }; michael@0: michael@0: class SkPDFType3Font : public SkPDFFont { michael@0: public: michael@0: virtual ~SkPDFType3Font(); michael@0: virtual bool multiByteGlyphs() const { return false; } michael@0: michael@0: private: michael@0: friend class SkPDFFont; // to access the constructor michael@0: michael@0: SkPDFType3Font(SkAdvancedTypefaceMetrics* info, SkTypeface* typeface, uint16_t glyphID); michael@0: michael@0: bool populate(int16_t glyphID); michael@0: }; michael@0: michael@0: #endif