/* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkAdvancedTypefaceMetrics_DEFINED #define SkAdvancedTypefaceMetrics_DEFINED #include "SkRect.h" #include "SkRefCnt.h" #include "SkString.h" #include "SkTDArray.h" #include "SkTemplates.h" #include "SkSinglyLinkedList.h" /** \class SkAdvancedTypefaceMetrics The SkAdvancedTypefaceMetrics class is used by the PDF backend to correctly embed typefaces. This class is created and filled in with information by SkTypeface::getAdvancedTypefaceMetrics. */ class SkAdvancedTypefaceMetrics : public SkRefCnt { public: SkAdvancedTypefaceMetrics() : fType(SkAdvancedTypefaceMetrics::kOther_Font) , fFlags(SkAdvancedTypefaceMetrics::kEmpty_FontFlag) , fLastGlyphID(0) , fEmSize(0) , fStyle(0) , fItalicAngle(0) , fAscent(0) , fDescent(0) , fStemV(0) , fCapHeight(0) , fBBox(SkIRect::MakeEmpty()) {} ~SkAdvancedTypefaceMetrics() {} SkString fFontName; enum FontType { kType1_Font, kType1CID_Font, kCFF_Font, kTrueType_Font, kOther_Font, }; // The type of the underlying font program. This field determines which // of the following fields are valid. If it is kOther_Font the per glyph // information will never be populated. FontType fType; enum FontFlags { kEmpty_FontFlag = 0x0, //! fGlyphNames; // The mapping from glyph to Unicode, only populated if // kToUnicode_PerGlyphInfo is passed to GetAdvancedTypefaceMetrics. SkTDArray fGlyphToUnicode; private: typedef SkRefCnt INHERITED; }; #endif