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 "SkStream.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 SkStreamAsset* getLocalStream() const { return fLocalStream.get(); } | 36 SkStreamAsset* getLocalStream() const { return fLocalStream.get(); } |
37 | 37 |
38 bool isFamilyName(const char* name) const { | 38 bool isFamilyName(const char* name) const { |
39 return fFamilyName.equals(name); | 39 return fFamilyName.equals(name); |
40 } | 40 } |
41 | 41 |
42 static SkTypeface* LegacyCreateTypeface(const char familyName[], SkTypeface:
:Style); | 42 static SkTypeface* LegacyCreateTypeface(const char familyName[], SkTypeface:
:Style); |
43 | 43 |
44 protected: | 44 protected: |
45 friend class SkFontHost; // hack until we can make public versions | |
46 | |
47 FontConfigTypeface(const SkFontStyle& style, | 45 FontConfigTypeface(const SkFontStyle& style, |
48 const SkFontConfigInterface::FontIdentity& fi, | 46 const SkFontConfigInterface::FontIdentity& fi, |
49 const SkString& familyName) | 47 const SkString& familyName) |
50 : INHERITED(style, SkTypefaceCache::NewFontID(), false) | 48 : INHERITED(style, SkTypefaceCache::NewFontID(), false) |
51 , fIdentity(fi) | 49 , fIdentity(fi) |
52 , fFamilyName(familyName) | 50 , fFamilyName(familyName) |
53 , fLocalStream(NULL) {} | 51 , fLocalStream(NULL) {} |
54 | 52 |
55 FontConfigTypeface(const SkFontStyle& style, bool fixedWidth, SkStreamAsset*
localStream) | 53 FontConfigTypeface(const SkFontStyle& style, bool fixedWidth, SkStreamAsset*
localStream) |
56 : INHERITED(style, SkTypefaceCache::NewFontID(), fixedWidth) | 54 : INHERITED(style, SkTypefaceCache::NewFontID(), fixedWidth) |
57 , fLocalStream(localStream) { | 55 , fLocalStream(localStream) { |
58 // we default to empty fFamilyName and fIdentity | 56 // we default to empty fFamilyName and fIdentity |
59 } | 57 } |
60 | 58 |
61 void onGetFamilyName(SkString* familyName) const SK_OVERRIDE; | 59 void onGetFamilyName(SkString* familyName) const SK_OVERRIDE; |
62 void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE; | 60 void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE; |
63 SkStreamAsset* onOpenStream(int* ttcIndex) const SK_OVERRIDE; | 61 SkStreamAsset* onOpenStream(int* ttcIndex) const SK_OVERRIDE; |
64 | 62 |
65 private: | 63 private: |
66 typedef SkTypeface_FreeType INHERITED; | 64 typedef SkTypeface_FreeType INHERITED; |
67 }; | 65 }; |
OLD | NEW |