| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 "SkFontHost.h" | 8 #include "SkFontHost.h" |
| 9 #include "SkFontHost_FreeType_common.h" | 9 #include "SkFontHost_FreeType_common.h" |
| 10 #include "SkFontDescriptor.h" | 10 #include "SkFontDescriptor.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 private: | 78 private: |
| 79 typedef SkTypeface_Custom INHERITED; | 79 typedef SkTypeface_Custom INHERITED; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 /** The stream SkTypeface implementation for the custom font manager. */ | 82 /** The stream SkTypeface implementation for the custom font manager. */ |
| 83 class SkTypeface_Stream : public SkTypeface_Custom { | 83 class SkTypeface_Stream : public SkTypeface_Custom { |
| 84 public: | 84 public: |
| 85 SkTypeface_Stream(const SkFontStyle& style, bool isFixedPitch, bool sysFont, | 85 SkTypeface_Stream(const SkFontStyle& style, bool isFixedPitch, bool sysFont, |
| 86 const SkString familyName, SkStream* stream, int index) | 86 const SkString familyName, SkStream* stream, int index) |
| 87 : INHERITED(style, isFixedPitch, sysFont, familyName, index) | 87 : INHERITED(style, isFixedPitch, sysFont, familyName, index) |
| 88 , fStream(SkRef(stream)) | 88 , fStream(stream) |
| 89 { } | 89 { } |
| 90 | 90 |
| 91 const char* getUniqueString() const SK_OVERRIDE { return NULL; } | 91 const char* getUniqueString() const SK_OVERRIDE { return NULL; } |
| 92 | 92 |
| 93 protected: | 93 protected: |
| 94 SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE { | 94 SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE { |
| 95 *ttcIndex = this->getIndex(); | 95 *ttcIndex = this->getIndex(); |
| 96 return fStream->duplicate(); | 96 return fStream->duplicate(); |
| 97 } | 97 } |
| 98 | 98 |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 | 430 |
| 431 SkTArray<SkAutoTUnref<SkFontStyleSet_Custom>, true> fFamilies; | 431 SkTArray<SkAutoTUnref<SkFontStyleSet_Custom>, true> fFamilies; |
| 432 SkFontStyleSet_Custom* gDefaultFamily; | 432 SkFontStyleSet_Custom* gDefaultFamily; |
| 433 SkTypeface* gDefaultNormal; | 433 SkTypeface* gDefaultNormal; |
| 434 SkTypeface_FreeType::Scanner fScanner; | 434 SkTypeface_FreeType::Scanner fScanner; |
| 435 }; | 435 }; |
| 436 | 436 |
| 437 SkFontMgr* SkFontMgr::Factory() { | 437 SkFontMgr* SkFontMgr::Factory() { |
| 438 return new SkFontMgr_Custom(SK_FONT_FILE_PREFIX); | 438 return new SkFontMgr_Custom(SK_FONT_FILE_PREFIX); |
| 439 } | 439 } |
| OLD | NEW |