michael@0: /* michael@0: * Copyright 2012 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: #ifndef SkFontDescriptor_DEFINED michael@0: #define SkFontDescriptor_DEFINED michael@0: michael@0: #include "SkString.h" michael@0: #include "SkTypeface.h" michael@0: michael@0: class SkStream; michael@0: class SkWStream; michael@0: michael@0: class SkFontDescriptor { michael@0: public: michael@0: SkFontDescriptor(SkTypeface::Style = SkTypeface::kNormal); michael@0: SkFontDescriptor(SkStream*); michael@0: michael@0: void serialize(SkWStream*); michael@0: michael@0: SkTypeface::Style getStyle() { return fStyle; } michael@0: void setStyle(SkTypeface::Style style) { fStyle = style; } michael@0: michael@0: const char* getFamilyName() { return fFamilyName.c_str(); } michael@0: const char* getFullName() { return fFullName.c_str(); } michael@0: const char* getPostscriptName() { return fPostscriptName.c_str(); } michael@0: const char* getFontFileName() { return fFontFileName.c_str(); } michael@0: michael@0: void setFamilyName(const char* name) { fFamilyName.set(name); } michael@0: void setFullName(const char* name) { fFullName.set(name); } michael@0: void setPostscriptName(const char* name) { fPostscriptName.set(name); } michael@0: void setFontFileName(const char* name) { fFontFileName.set(name); } michael@0: michael@0: private: michael@0: SkString fFamilyName; michael@0: SkString fFullName; michael@0: SkString fPostscriptName; michael@0: SkString fFontFileName; michael@0: michael@0: SkTypeface::Style fStyle; michael@0: }; michael@0: michael@0: #endif // SkFontDescriptor_DEFINED