diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-31 15:56:22 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-31 15:56:22 +0000 |
commit | 3b0a9fe5672e7339ec3e5e6d3986b15f57ae24e7 (patch) | |
tree | 3c1fd7d83830d76aa412f57a3d7cf39cb8d1e24a /src/core/SkFontDescriptor.h | |
parent | 633c32b13b5d199d797be669d3dc7981d603a945 (diff) |
Update filter tool to allow more flexible filtering
https://codereview.appspot.com/7227055/
git-svn-id: http://skia.googlecode.com/svn/trunk@7492 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkFontDescriptor.h')
-rw-r--r-- | src/core/SkFontDescriptor.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/core/SkFontDescriptor.h b/src/core/SkFontDescriptor.h new file mode 100644 index 0000000000..5febfd81a3 --- /dev/null +++ b/src/core/SkFontDescriptor.h @@ -0,0 +1,46 @@ +/* + * Copyright 2012 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef SkFontDescriptor_DEFINED +#define SkFontDescriptor_DEFINED + +#include "SkString.h" +#include "SkTypeface.h" + +class SkStream; +class SkWStream; + +class SkFontDescriptor { +public: + SkFontDescriptor(SkTypeface::Style = SkTypeface::kNormal); + SkFontDescriptor(SkStream*); + + void serialize(SkWStream*); + + SkTypeface::Style getStyle() { return fStyle; } + void setStyle(SkTypeface::Style style) { fStyle = style; } + + const char* getFamilyName() { return fFamilyName.c_str(); } + const char* getFullName() { return fFullName.c_str(); } + const char* getPostscriptName() { return fPostscriptName.c_str(); } + const char* getFontFileName() { return fFontFileName.c_str(); } + + void setFamilyName(const char* name) { fFamilyName.set(name); } + void setFullName(const char* name) { fFullName.set(name); } + void setPostscriptName(const char* name) { fPostscriptName.set(name); } + void setFontFileName(const char* name) { fFontFileName.set(name); } + +private: + SkString fFamilyName; + SkString fFullName; + SkString fPostscriptName; + SkString fFontFileName; + + SkTypeface::Style fStyle; +}; + +#endif // SkFontDescriptor_DEFINED |