| 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 #ifndef SkFontMgr_DEFINED | 8 #ifndef SkFontMgr_DEFINED |
| 9 #define SkFontMgr_DEFINED | 9 #define SkFontMgr_DEFINED |
| 10 | 10 |
| 11 #include "SkRefCnt.h" | 11 #include "SkRefCnt.h" |
| 12 #include "SkFontStyle.h" | 12 #include "SkFontStyle.h" |
| 13 | 13 |
| 14 class SkData; | 14 class SkData; |
| 15 class SkStream; | 15 class SkStream; |
| 16 class SkString; | 16 class SkString; |
| 17 | 17 |
| 18 class SkFontStyleSet : public SkRefCnt { | 18 class SkFontStyleSet : public SkRefCnt { |
| 19 public: | 19 public: |
| 20 int count() const; | 20 virtual int count() = 0; |
| 21 void getStyle(int index, SkFontStyle*) const; | 21 virtual void getStyle(int index, SkFontStyle*, SkString* style) = 0; |
| 22 SkTypeface* createTypeface(int index) const; | 22 virtual SkTypeface* createTypeface(int index) = 0; |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 class SkFontMgr : public SkRefCnt { | 25 class SkFontMgr : public SkRefCnt { |
| 26 public: | 26 public: |
| 27 int countFamilies(); | 27 int countFamilies(); |
| 28 void getFamilyName(int index, SkString* familyName); | 28 void getFamilyName(int index, SkString* familyName); |
| 29 SkFontStyleSet* createStyleSet(int index); | 29 SkFontStyleSet* createStyleSet(int index); |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * Find the closest matching typeface to the specified familyName and style | 32 * Find the closest matching typeface to the specified familyName and style |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 virtual SkTypeface* onCreateFromFile(const char path[], int ttcIndex) = 0; | 81 virtual SkTypeface* onCreateFromFile(const char path[], int ttcIndex) = 0; |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 static SkFontMgr* Factory(); // implemented by porting layer | 84 static SkFontMgr* Factory(); // implemented by porting layer |
| 85 static SkMutex* Mutex(); // implemented by porting layer | 85 static SkMutex* Mutex(); // implemented by porting layer |
| 86 | 86 |
| 87 typedef SkRefCnt INHERITED; | 87 typedef SkRefCnt INHERITED; |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 #endif | 90 #endif |
| OLD | NEW |