OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #undef GetGlyphIndices | 9 #undef GetGlyphIndices |
10 | 10 |
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 SkTScopedComPtr<IDWriteFont> font; | 1124 SkTScopedComPtr<IDWriteFont> font; |
1125 HRN(fontFamily->GetFont(0, &font)); | 1125 HRN(fontFamily->GetFont(0, &font)); |
1126 | 1126 |
1127 SkTScopedComPtr<IDWriteFontFace> fontFace; | 1127 SkTScopedComPtr<IDWriteFontFace> fontFace; |
1128 HRN(font->CreateFontFace(&fontFace)); | 1128 HRN(font->CreateFontFace(&fontFace)); |
1129 | 1129 |
1130 return SkCreateTypefaceFromDWriteFont(fontFace.get(), font.get(), fontFamily
.get(), | 1130 return SkCreateTypefaceFromDWriteFont(fontFace.get(), font.get(), fontFamily
.get(), |
1131 fontFileLoader.get(), streamFontCollec
tionLoader.get()); | 1131 fontFileLoader.get(), streamFontCollec
tionLoader.get()); |
1132 } | 1132 } |
1133 | 1133 |
1134 SkStream* SkFontHost::OpenStream(SkFontID uniqueID) { | |
1135 DWriteFontTypeface* typeface = GetDWriteFontByID(uniqueID); | |
1136 return typeface ? typeface->openStream(NULL) : NULL; | |
1137 } | |
1138 | |
1139 SkStream* DWriteFontTypeface::onOpenStream(int* ttcIndex) const { | 1134 SkStream* DWriteFontTypeface::onOpenStream(int* ttcIndex) const { |
1140 *ttcIndex = 0; | 1135 *ttcIndex = 0; |
1141 | 1136 |
1142 UINT32 numFiles; | 1137 UINT32 numFiles; |
1143 HRNM(fDWriteFontFace->GetFiles(&numFiles, NULL), | 1138 HRNM(fDWriteFontFace->GetFiles(&numFiles, NULL), |
1144 "Could not get number of font files."); | 1139 "Could not get number of font files."); |
1145 if (numFiles != 1) { | 1140 if (numFiles != 1) { |
1146 return NULL; | 1141 return NULL; |
1147 } | 1142 } |
1148 | 1143 |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1552 getAdvanceData(fDWriteFontFace.get(), | 1547 getAdvanceData(fDWriteFontFace.get(), |
1553 glyphCount, | 1548 glyphCount, |
1554 glyphIDs, | 1549 glyphIDs, |
1555 glyphIDsCount, | 1550 glyphIDsCount, |
1556 getWidthAdvance)); | 1551 getWidthAdvance)); |
1557 } | 1552 } |
1558 } | 1553 } |
1559 | 1554 |
1560 return info; | 1555 return info; |
1561 } | 1556 } |
OLD | NEW |