| 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_FreeType_common.h" | 8 #include "SkFontHost_FreeType_common.h" |
| 9 #include "SkFontDescriptor.h" | 9 #include "SkFontDescriptor.h" |
| 10 #include "SkFontMgr.h" | 10 #include "SkFontMgr.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 bool isSysFont() const { return fIsSysFont; } | 33 bool isSysFont() const { return fIsSysFont; } |
| 34 | 34 |
| 35 protected: | 35 protected: |
| 36 void onGetFamilyName(SkString* familyName) const override { | 36 void onGetFamilyName(SkString* familyName) const override { |
| 37 *familyName = fFamilyName; | 37 *familyName = fFamilyName; |
| 38 } | 38 } |
| 39 | 39 |
| 40 void onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) const overri
de { | 40 void onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) const overri
de { |
| 41 desc->setFamilyName(fFamilyName.c_str()); | 41 desc->setFamilyName(fFamilyName.c_str()); |
| 42 desc->setFontIndex(fIndex); | |
| 43 *isLocal = !this->isSysFont(); | 42 *isLocal = !this->isSysFont(); |
| 44 } | 43 } |
| 45 | 44 |
| 46 int getIndex() const { return fIndex; } | 45 int getIndex() const { return fIndex; } |
| 47 | 46 |
| 48 private: | 47 private: |
| 49 const bool fIsSysFont; | 48 const bool fIsSysFont; |
| 50 const SkString fFamilyName; | 49 const SkString fFamilyName; |
| 51 const int fIndex; | 50 const int fIndex; |
| 52 | 51 |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 #else | 525 #else |
| 527 | 526 |
| 528 #ifndef SK_FONT_FILE_PREFIX | 527 #ifndef SK_FONT_FILE_PREFIX |
| 529 # define SK_FONT_FILE_PREFIX "/usr/share/fonts/" | 528 # define SK_FONT_FILE_PREFIX "/usr/share/fonts/" |
| 530 #endif | 529 #endif |
| 531 SkFontMgr* SkFontMgr::Factory() { | 530 SkFontMgr* SkFontMgr::Factory() { |
| 532 return new SkFontMgr_Custom(DirectorySystemFontLoader(SK_FONT_FILE_PREFIX)); | 531 return new SkFontMgr_Custom(DirectorySystemFontLoader(SK_FONT_FILE_PREFIX)); |
| 533 } | 532 } |
| 534 | 533 |
| 535 #endif | 534 #endif |
| OLD | NEW |