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 "SkFontDescriptor.h" | 8 #include "SkFontDescriptor.h" |
9 #include "SkFontHost_FreeType_common.h" | 9 #include "SkFontHost_FreeType_common.h" |
10 #include "SkFontMgr.h" | 10 #include "SkFontMgr.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 bool isSysFont() const { return fIsSysFont; } | 37 bool isSysFont() const { return fIsSysFont; } |
38 | 38 |
39 protected: | 39 protected: |
40 void onGetFamilyName(SkString* familyName) const override { | 40 void onGetFamilyName(SkString* familyName) const override { |
41 *familyName = fFamilyName; | 41 *familyName = fFamilyName; |
42 } | 42 } |
43 | 43 |
44 void onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) const overri
de { | 44 void onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) const overri
de { |
45 desc->setFamilyName(fFamilyName.c_str()); | 45 desc->setFamilyName(fFamilyName.c_str()); |
46 desc->setStyle(this->fontStyle()); | |
47 *isLocal = !this->isSysFont(); | 46 *isLocal = !this->isSysFont(); |
48 } | 47 } |
49 | 48 |
50 int getIndex() const { return fIndex; } | 49 int getIndex() const { return fIndex; } |
51 | 50 |
52 private: | 51 private: |
53 const bool fIsSysFont; | 52 const bool fIsSysFont; |
54 const SkString fFamilyName; | 53 const SkString fFamilyName; |
55 const int fIndex; | 54 const int fIndex; |
56 | 55 |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 SkFontStyleSet_Custom* family = new SkFontStyleSet_Custom(SkString()); | 510 SkFontStyleSet_Custom* family = new SkFontStyleSet_Custom(SkString()); |
512 families->push_back().reset(family); | 511 families->push_back().reset(family); |
513 family->appendTypeface(sk_make_sp<SkTypeface_Empty>()); | 512 family->appendTypeface(sk_make_sp<SkTypeface_Empty>()); |
514 } | 513 } |
515 | 514 |
516 }; | 515 }; |
517 | 516 |
518 SK_API SkFontMgr* SkFontMgr_New_Custom_Empty() { | 517 SK_API SkFontMgr* SkFontMgr_New_Custom_Empty() { |
519 return new SkFontMgr_Custom(EmptyFontLoader()); | 518 return new SkFontMgr_Custom(EmptyFontLoader()); |
520 } | 519 } |
OLD | NEW |