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 // SkTypes will include Windows.h, which will pull in all of the GDI defines. | 9 // SkTypes will include Windows.h, which will pull in all of the GDI defines. |
10 // GDI #defines GetGlyphIndices to GetGlyphIndicesA or GetGlyphIndicesW, but | 10 // GDI #defines GetGlyphIndices to GetGlyphIndicesA or GetGlyphIndicesW, but |
(...skipping 24 matching lines...) Expand all Loading... |
35 void DWriteFontTypeface::onGetFontDescriptor(SkFontDescriptor* desc, | 35 void DWriteFontTypeface::onGetFontDescriptor(SkFontDescriptor* desc, |
36 bool* isLocalStream) const { | 36 bool* isLocalStream) const { |
37 // Get the family name. | 37 // Get the family name. |
38 SkTScopedComPtr<IDWriteLocalizedStrings> familyNames; | 38 SkTScopedComPtr<IDWriteLocalizedStrings> familyNames; |
39 HRV(fDWriteFontFamily->GetFamilyNames(&familyNames)); | 39 HRV(fDWriteFontFamily->GetFamilyNames(&familyNames)); |
40 | 40 |
41 SkString utf8FamilyName; | 41 SkString utf8FamilyName; |
42 sk_get_locale_string(familyNames.get(), NULL/*fMgr->fLocaleName.get()*/, &ut
f8FamilyName); | 42 sk_get_locale_string(familyNames.get(), NULL/*fMgr->fLocaleName.get()*/, &ut
f8FamilyName); |
43 | 43 |
44 desc->setFamilyName(utf8FamilyName.c_str()); | 44 desc->setFamilyName(utf8FamilyName.c_str()); |
45 desc->setFontIndex(fDWriteFontFace->GetIndex()); | |
46 *isLocalStream = SkToBool(fDWriteFontFileLoader.get()); | 45 *isLocalStream = SkToBool(fDWriteFontFileLoader.get()); |
47 } | 46 } |
48 | 47 |
49 static SkUnichar next_utf8(const void** chars) { | 48 static SkUnichar next_utf8(const void** chars) { |
50 return SkUTF8_NextUnichar((const char**)chars); | 49 return SkUTF8_NextUnichar((const char**)chars); |
51 } | 50 } |
52 | 51 |
53 static SkUnichar next_utf16(const void** chars) { | 52 static SkUnichar next_utf16(const void** chars) { |
54 return SkUTF16_NextUnichar((const uint16_t**)chars); | 53 return SkUTF16_NextUnichar((const uint16_t**)chars); |
55 } | 54 } |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 getAdvanceData(fDWriteFontFace.get(), | 454 getAdvanceData(fDWriteFontFace.get(), |
456 glyphCount, | 455 glyphCount, |
457 glyphIDs, | 456 glyphIDs, |
458 glyphIDsCount, | 457 glyphIDsCount, |
459 getWidthAdvance)); | 458 getWidthAdvance)); |
460 } | 459 } |
461 } | 460 } |
462 | 461 |
463 return info; | 462 return info; |
464 } | 463 } |
OLD | NEW |