OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkFontConfigInterface.h" | 8 #include "SkFontConfigInterface.h" |
9 #include "SkFontHost_FreeType_common.h" | 9 #include "SkFontHost_FreeType_common.h" |
| 10 #include "SkStream.h" |
10 #include "SkTypefaceCache.h" | 11 #include "SkTypefaceCache.h" |
11 | 12 |
12 class SkFontDescriptor; | 13 class SkFontDescriptor; |
13 class SkStream; | |
14 | 14 |
15 class FontConfigTypeface : public SkTypeface_FreeType { | 15 class FontConfigTypeface : public SkTypeface_FreeType { |
16 SkFontConfigInterface::FontIdentity fIdentity; | 16 SkFontConfigInterface::FontIdentity fIdentity; |
17 SkString fFamilyName; | 17 SkString fFamilyName; |
18 SkStream* fLocalStream; | 18 SkStream* fLocalStream; |
19 | 19 |
20 public: | 20 public: |
21 FontConfigTypeface(Style style, | 21 FontConfigTypeface(Style style, |
22 const SkFontConfigInterface::FontIdentity& fi, | 22 const SkFontConfigInterface::FontIdentity& fi, |
23 const SkString& familyName) | 23 const SkString& familyName) |
(...skipping 17 matching lines...) Expand all Loading... |
41 return fIdentity; | 41 return fIdentity; |
42 } | 42 } |
43 | 43 |
44 const char* getFamilyName() const { return fFamilyName.c_str(); } | 44 const char* getFamilyName() const { return fFamilyName.c_str(); } |
45 SkStream* getLocalStream() const { return fLocalStream; } | 45 SkStream* getLocalStream() const { return fLocalStream; } |
46 | 46 |
47 bool isFamilyName(const char* name) const { | 47 bool isFamilyName(const char* name) const { |
48 return fFamilyName.equals(name); | 48 return fFamilyName.equals(name); |
49 } | 49 } |
50 | 50 |
| 51 static SkTypeface* LegacyCreateTypeface(const SkTypeface* family, |
| 52 const char familyName[], |
| 53 SkTypeface::Style); |
| 54 |
51 protected: | 55 protected: |
52 friend class SkFontHost; // hack until we can make public versions | 56 friend class SkFontHost; // hack until we can make public versions |
53 | 57 |
54 virtual int onGetTableTags(SkFontTableTag tags[]) const SK_OVERRIDE; | 58 virtual int onGetTableTags(SkFontTableTag tags[]) const SK_OVERRIDE; |
55 virtual size_t onGetTableData(SkFontTableTag, size_t offset, | 59 virtual size_t onGetTableData(SkFontTableTag, size_t offset, |
56 size_t length, void* data) const SK_OVERRIDE; | 60 size_t length, void* data) const SK_OVERRIDE; |
57 virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE
; | 61 virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE
; |
58 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE; | 62 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE; |
| 63 virtual SkTypeface* onRefMatchingStyle(Style) const SK_OVERRIDE; |
59 | 64 |
60 private: | 65 private: |
61 typedef SkTypeface_FreeType INHERITED; | 66 typedef SkTypeface_FreeType INHERITED; |
62 }; | 67 }; |
OLD | NEW |