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 "SkTypes.h" | 8 #include "SkTypes.h" |
9 #if defined(SK_BUILD_FOR_WIN32) | 9 #if defined(SK_BUILD_FOR_WIN32) |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 void DWriteFontTypeface::onGetFontDescriptor(SkFontDescriptor* desc, | 38 void DWriteFontTypeface::onGetFontDescriptor(SkFontDescriptor* desc, |
39 bool* isLocalStream) const { | 39 bool* isLocalStream) const { |
40 // Get the family name. | 40 // Get the family name. |
41 SkTScopedComPtr<IDWriteLocalizedStrings> familyNames; | 41 SkTScopedComPtr<IDWriteLocalizedStrings> familyNames; |
42 HRV(fDWriteFontFamily->GetFamilyNames(&familyNames)); | 42 HRV(fDWriteFontFamily->GetFamilyNames(&familyNames)); |
43 | 43 |
44 SkString utf8FamilyName; | 44 SkString utf8FamilyName; |
45 sk_get_locale_string(familyNames.get(), nullptr/*fMgr->fLocaleName.get()*/,
&utf8FamilyName); | 45 sk_get_locale_string(familyNames.get(), nullptr/*fMgr->fLocaleName.get()*/,
&utf8FamilyName); |
46 | 46 |
47 desc->setFamilyName(utf8FamilyName.c_str()); | 47 desc->setFamilyName(utf8FamilyName.c_str()); |
| 48 desc->setStyle(this->fontStyle()); |
48 *isLocalStream = SkToBool(fDWriteFontFileLoader.get()); | 49 *isLocalStream = SkToBool(fDWriteFontFileLoader.get()); |
49 } | 50 } |
50 | 51 |
51 static SkUnichar next_utf8(const void** chars) { | 52 static SkUnichar next_utf8(const void** chars) { |
52 return SkUTF8_NextUnichar((const char**)chars); | 53 return SkUTF8_NextUnichar((const char**)chars); |
53 } | 54 } |
54 | 55 |
55 static SkUnichar next_utf16(const void** chars) { | 56 static SkUnichar next_utf16(const void** chars) { |
56 return SkUTF16_NextUnichar((const uint16_t**)chars); | 57 return SkUTF16_NextUnichar((const uint16_t**)chars); |
57 } | 58 } |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 SkAdvancedTypefaceMetrics::GetAdvance([borrowedFontFace](int gId
, int16_t* data) { | 459 SkAdvancedTypefaceMetrics::GetAdvance([borrowedFontFace](int gId
, int16_t* data) { |
459 return getWidthAdvance(borrowedFontFace, gId, data); | 460 return getWidthAdvance(borrowedFontFace, gId, data); |
460 }) | 461 }) |
461 ); | 462 ); |
462 } | 463 } |
463 } | 464 } |
464 | 465 |
465 return info; | 466 return info; |
466 } | 467 } |
467 #endif//defined(SK_BUILD_FOR_WIN32) | 468 #endif//defined(SK_BUILD_FOR_WIN32) |
OLD | NEW |