OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkDataTable.h" | 8 #include "SkDataTable.h" |
9 #include "SkFontDescriptor.h" | 9 #include "SkFontDescriptor.h" |
10 #include "SkFontHost_FreeType_common.h" | 10 #include "SkFontHost_FreeType_common.h" |
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 virtual SkTypeface* onLegacyCreateTypeface(const char familyName[], | 789 virtual SkTypeface* onLegacyCreateTypeface(const char familyName[], |
790 unsigned styleBits) const SK_OVER
RIDE { | 790 unsigned styleBits) const SK_OVER
RIDE { |
791 bool bold = styleBits & SkTypeface::kBold; | 791 bool bold = styleBits & SkTypeface::kBold; |
792 bool italic = styleBits & SkTypeface::kItalic; | 792 bool italic = styleBits & SkTypeface::kItalic; |
793 SkFontStyle style = SkFontStyle(bold ? SkFontStyle::kBold_Weight | 793 SkFontStyle style = SkFontStyle(bold ? SkFontStyle::kBold_Weight |
794 : SkFontStyle::kNormal_Weight, | 794 : SkFontStyle::kNormal_Weight, |
795 SkFontStyle::kNormal_Width, | 795 SkFontStyle::kNormal_Width, |
796 italic ? SkFontStyle::kItalic_Slant | 796 italic ? SkFontStyle::kItalic_Slant |
797 : SkFontStyle::kUpright_Slant); | 797 : SkFontStyle::kUpright_Slant); |
798 SkAutoTUnref<SkTypeface> typeface(this->matchFamilyStyle(familyName, sty
le)); | 798 SkAutoTUnref<SkTypeface> typeface(this->matchFamilyStyle(familyName, sty
le)); |
799 if (NULL != typeface.get()) { | 799 if (typeface.get()) { |
800 return typeface.detach(); | 800 return typeface.detach(); |
801 } | 801 } |
802 | 802 |
803 return this->matchFamilyStyle(NULL, style); | 803 return this->matchFamilyStyle(NULL, style); |
804 } | 804 } |
805 }; | 805 }; |
806 | 806 |
807 SkFontMgr* SkFontMgr::Factory() { | 807 SkFontMgr* SkFontMgr::Factory() { |
808 return SkNEW(SkFontMgr_fontconfig); | 808 return SkNEW(SkFontMgr_fontconfig); |
809 } | 809 } |
OLD | NEW |