| 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()); |
| 45 *isLocalStream = SkToBool(fDWriteFontFileLoader.get()); | 46 *isLocalStream = SkToBool(fDWriteFontFileLoader.get()); |
| 46 } | 47 } |
| 47 | 48 |
| 48 static SkUnichar next_utf8(const void** chars) { | 49 static SkUnichar next_utf8(const void** chars) { |
| 49 return SkUTF8_NextUnichar((const char**)chars); | 50 return SkUTF8_NextUnichar((const char**)chars); |
| 50 } | 51 } |
| 51 | 52 |
| 52 static SkUnichar next_utf16(const void** chars) { | 53 static SkUnichar next_utf16(const void** chars) { |
| 53 return SkUTF16_NextUnichar((const uint16_t**)chars); | 54 return SkUTF16_NextUnichar((const uint16_t**)chars); |
| 54 } | 55 } |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 getAdvanceData(fDWriteFontFace.get(), | 455 getAdvanceData(fDWriteFontFace.get(), |
| 455 glyphCount, | 456 glyphCount, |
| 456 glyphIDs, | 457 glyphIDs, |
| 457 glyphIDsCount, | 458 glyphIDsCount, |
| 458 getWidthAdvance)); | 459 getWidthAdvance)); |
| 459 } | 460 } |
| 460 } | 461 } |
| 461 | 462 |
| 462 return info; | 463 return info; |
| 463 } | 464 } |
| OLD | NEW |