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 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 | 1251 |
1252 return SkCreateTypefaceFromDWriteFont(fontFace.get(), font.get(), fontFamily
.get()); | 1252 return SkCreateTypefaceFromDWriteFont(fontFace.get(), font.get(), fontFamily
.get()); |
1253 } | 1253 } |
1254 | 1254 |
1255 SkTypeface* SkFontHost::CreateTypefaceFromFile(const char path[]) { | 1255 SkTypeface* SkFontHost::CreateTypefaceFromFile(const char path[]) { |
1256 printf("SkFontHost::CreateTypefaceFromFile unimplemented"); | 1256 printf("SkFontHost::CreateTypefaceFromFile unimplemented"); |
1257 return NULL; | 1257 return NULL; |
1258 } | 1258 } |
1259 | 1259 |
1260 void DWriteFontTypeface::onFilterRec(SkScalerContext::Rec* rec) const { | 1260 void DWriteFontTypeface::onFilterRec(SkScalerContext::Rec* rec) const { |
| 1261 if (rec->fFlags & SkScalerContext::kLCD_BGROrder_Flag || |
| 1262 rec->fFlags & SkScalerContext::kLCD_Vertical_Flag) |
| 1263 { |
| 1264 rec->fMaskFormat = SkMask::kA8_Format; |
| 1265 } |
| 1266 |
1261 unsigned flagsWeDontSupport = SkScalerContext::kDevKernText_Flag | | 1267 unsigned flagsWeDontSupport = SkScalerContext::kDevKernText_Flag | |
1262 SkScalerContext::kAutohinting_Flag | | 1268 SkScalerContext::kAutohinting_Flag | |
1263 SkScalerContext::kEmbeddedBitmapText_Flag | | 1269 SkScalerContext::kEmbeddedBitmapText_Flag | |
1264 SkScalerContext::kEmbolden_Flag | | 1270 SkScalerContext::kEmbolden_Flag | |
1265 SkScalerContext::kLCD_BGROrder_Flag | | 1271 SkScalerContext::kLCD_BGROrder_Flag | |
1266 SkScalerContext::kLCD_Vertical_Flag; | 1272 SkScalerContext::kLCD_Vertical_Flag; |
1267 rec->fFlags &= ~flagsWeDontSupport; | 1273 rec->fFlags &= ~flagsWeDontSupport; |
1268 | 1274 |
1269 SkPaint::Hinting h = rec->getHinting(); | 1275 SkPaint::Hinting h = rec->getHinting(); |
1270 // DirectWrite does not provide for hinting hints. | 1276 // DirectWrite does not provide for hinting hints. |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1742 | 1748 |
1743 WCHAR localeNameStorage[LOCALE_NAME_MAX_LENGTH]; | 1749 WCHAR localeNameStorage[LOCALE_NAME_MAX_LENGTH]; |
1744 WCHAR* localeName = NULL; | 1750 WCHAR* localeName = NULL; |
1745 int localeNameLen = GetUserDefaultLocaleName(localeNameStorage, LOCALE_NAME_
MAX_LENGTH); | 1751 int localeNameLen = GetUserDefaultLocaleName(localeNameStorage, LOCALE_NAME_
MAX_LENGTH); |
1746 if (localeNameLen) { | 1752 if (localeNameLen) { |
1747 localeName = localeNameStorage; | 1753 localeName = localeNameStorage; |
1748 }; | 1754 }; |
1749 | 1755 |
1750 return SkNEW_ARGS(SkFontMgr_DirectWrite, (sysFontCollection.get(), localeNam
e, localeNameLen)); | 1756 return SkNEW_ARGS(SkFontMgr_DirectWrite, (sysFontCollection.get(), localeNam
e, localeNameLen)); |
1751 } | 1757 } |
OLD | NEW |