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()); | |
49 *isLocalStream = SkToBool(fDWriteFontFileLoader.get()); | 48 *isLocalStream = SkToBool(fDWriteFontFileLoader.get()); |
50 } | 49 } |
51 | 50 |
52 static SkUnichar next_utf8(const void** chars) { | 51 static SkUnichar next_utf8(const void** chars) { |
53 return SkUTF8_NextUnichar((const char**)chars); | 52 return SkUTF8_NextUnichar((const char**)chars); |
54 } | 53 } |
55 | 54 |
56 static SkUnichar next_utf16(const void** chars) { | 55 static SkUnichar next_utf16(const void** chars) { |
57 return SkUTF16_NextUnichar((const uint16_t**)chars); | 56 return SkUTF16_NextUnichar((const uint16_t**)chars); |
58 } | 57 } |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 SkAdvancedTypefaceMetrics::GetAdvance([borrowedFontFace](int gId
, int16_t* data) { | 458 SkAdvancedTypefaceMetrics::GetAdvance([borrowedFontFace](int gId
, int16_t* data) { |
460 return getWidthAdvance(borrowedFontFace, gId, data); | 459 return getWidthAdvance(borrowedFontFace, gId, data); |
461 }) | 460 }) |
462 ); | 461 ); |
463 } | 462 } |
464 } | 463 } |
465 | 464 |
466 return info; | 465 return info; |
467 } | 466 } |
468 #endif//defined(SK_BUILD_FOR_WIN32) | 467 #endif//defined(SK_BUILD_FOR_WIN32) |
OLD | NEW |