gfx/skia/trunk/src/pdf/SkPDFFontImpl.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/src/pdf/SkPDFFontImpl.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,83 @@
     1.4 +
     1.5 +/*
     1.6 + * Copyright 2011 Google Inc.
     1.7 + *
     1.8 + * Use of this source code is governed by a BSD-style license that can be
     1.9 + * found in the LICENSE file.
    1.10 + */
    1.11 +
    1.12 +
    1.13 +#ifndef SkPDFFontImpl_DEFINED
    1.14 +#define SkPDFFontImpl_DEFINED
    1.15 +
    1.16 +#include "SkPDFFont.h"
    1.17 +
    1.18 +class SkPDFType0Font : public SkPDFFont {
    1.19 +public:
    1.20 +    virtual ~SkPDFType0Font();
    1.21 +    virtual bool multiByteGlyphs() const { return true; }
    1.22 +    SK_API virtual SkPDFFont* getFontSubset(const SkPDFGlyphSet* usage);
    1.23 +#ifdef SK_DEBUG
    1.24 +    virtual void emitObject(SkWStream* stream, SkPDFCatalog* catalog,
    1.25 +                            bool indirect);
    1.26 +#endif
    1.27 +
    1.28 +private:
    1.29 +    friend class SkPDFFont;  // to access the constructor
    1.30 +#ifdef SK_DEBUG
    1.31 +    bool fPopulated;
    1.32 +    typedef SkPDFDict INHERITED;
    1.33 +#endif
    1.34 +
    1.35 +    SkPDFType0Font(SkAdvancedTypefaceMetrics* info, SkTypeface* typeface);
    1.36 +
    1.37 +    bool populate(const SkPDFGlyphSet* subset);
    1.38 +};
    1.39 +
    1.40 +class SkPDFCIDFont : public SkPDFFont {
    1.41 +public:
    1.42 +    virtual ~SkPDFCIDFont();
    1.43 +    virtual bool multiByteGlyphs() const { return true; }
    1.44 +
    1.45 +private:
    1.46 +    friend class SkPDFType0Font;  // to access the constructor
    1.47 +
    1.48 +    SkPDFCIDFont(SkAdvancedTypefaceMetrics* info, SkTypeface* typeface,
    1.49 +                 const SkPDFGlyphSet* subset);
    1.50 +
    1.51 +    bool populate(const SkPDFGlyphSet* subset);
    1.52 +    bool addFontDescriptor(int16_t defaultWidth,
    1.53 +                           const SkTDArray<uint32_t>* subset);
    1.54 +};
    1.55 +
    1.56 +class SkPDFType1Font : public SkPDFFont {
    1.57 +public:
    1.58 +    virtual ~SkPDFType1Font();
    1.59 +    virtual bool multiByteGlyphs() const { return false; }
    1.60 +
    1.61 +private:
    1.62 +    friend class SkPDFFont;  // to access the constructor
    1.63 +
    1.64 +    SkPDFType1Font(SkAdvancedTypefaceMetrics* info, SkTypeface* typeface,
    1.65 +                   uint16_t glyphID, SkPDFDict* relatedFontDescriptor);
    1.66 +
    1.67 +    bool populate(int16_t glyphID);
    1.68 +    bool addFontDescriptor(int16_t defaultWidth);
    1.69 +    void addWidthInfoFromRange(int16_t defaultWidth,
    1.70 +        const SkAdvancedTypefaceMetrics::WidthRange* widthRangeEntry);
    1.71 +};
    1.72 +
    1.73 +class SkPDFType3Font : public SkPDFFont {
    1.74 +public:
    1.75 +    virtual ~SkPDFType3Font();
    1.76 +    virtual bool multiByteGlyphs() const { return false; }
    1.77 +
    1.78 +private:
    1.79 +    friend class SkPDFFont;  // to access the constructor
    1.80 +
    1.81 +    SkPDFType3Font(SkAdvancedTypefaceMetrics* info, SkTypeface* typeface, uint16_t glyphID);
    1.82 +
    1.83 +    bool populate(int16_t glyphID);
    1.84 +};
    1.85 +
    1.86 +#endif

mercurial