blob: 5febfd81a3f36dd1af26154bd0672dd74c465f76 [file] [log] [blame]
djsollen@google.com97145162012-05-31 19:55:08 +00001/*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
djsollen@google.com97145162012-05-31 19:55:08 +00008#ifndef SkFontDescriptor_DEFINED
9#define SkFontDescriptor_DEFINED
10
11#include "SkString.h"
12#include "SkTypeface.h"
13
14class SkStream;
15class SkWStream;
16
17class SkFontDescriptor {
18public:
reed@google.com3b700f62012-05-31 21:16:48 +000019 SkFontDescriptor(SkTypeface::Style = SkTypeface::kNormal);
djsollen@google.com97145162012-05-31 19:55:08 +000020 SkFontDescriptor(SkStream*);
21
22 void serialize(SkWStream*);
23
reed@google.com3b700f62012-05-31 21:16:48 +000024 SkTypeface::Style getStyle() { return fStyle; }
25 void setStyle(SkTypeface::Style style) { fStyle = style; }
26
27 const char* getFamilyName() { return fFamilyName.c_str(); }
28 const char* getFullName() { return fFullName.c_str(); }
29 const char* getPostscriptName() { return fPostscriptName.c_str(); }
30 const char* getFontFileName() { return fFontFileName.c_str(); }
rmistry@google.comd6176b02012-08-23 18:14:13 +000031
reed@google.com3b700f62012-05-31 21:16:48 +000032 void setFamilyName(const char* name) { fFamilyName.set(name); }
33 void setFullName(const char* name) { fFullName.set(name); }
34 void setPostscriptName(const char* name) { fPostscriptName.set(name); }
djsollen@google.com97145162012-05-31 19:55:08 +000035 void setFontFileName(const char* name) { fFontFileName.set(name); }
36
djsollen@google.com97145162012-05-31 19:55:08 +000037private:
reed@google.com3b700f62012-05-31 21:16:48 +000038 SkString fFamilyName;
39 SkString fFullName;
40 SkString fPostscriptName;
djsollen@google.com97145162012-05-31 19:55:08 +000041 SkString fFontFileName;
reed@google.com3b700f62012-05-31 21:16:48 +000042
43 SkTypeface::Style fStyle;
djsollen@google.com97145162012-05-31 19:55:08 +000044};
45
46#endif // SkFontDescriptor_DEFINED