OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 2490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2501 | 2501 |
2502 SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle styl
e) const override { | 2502 SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle styl
e) const override { |
2503 LOGFONT lf; | 2503 LOGFONT lf; |
2504 if (nullptr == familyName) { | 2504 if (nullptr == familyName) { |
2505 lf = get_default_font(); | 2505 lf = get_default_font(); |
2506 } else { | 2506 } else { |
2507 logfont_for_name(familyName, &lf); | 2507 logfont_for_name(familyName, &lf); |
2508 } | 2508 } |
2509 | 2509 |
2510 lf.lfWeight = style.weight(); | 2510 lf.lfWeight = style.weight(); |
2511 lf.lfItalic = style.isItalic() ? TRUE : FALSE; | 2511 lf.lfItalic = style.slant() == SkFontStyle::kUpright_Slant ? FALSE : TRU
E; |
2512 return SkCreateTypefaceFromLOGFONT(lf); | 2512 return SkCreateTypefaceFromLOGFONT(lf); |
2513 } | 2513 } |
2514 | 2514 |
2515 private: | 2515 private: |
2516 SkTDArray<ENUMLOGFONTEX> fLogFontArray; | 2516 SkTDArray<ENUMLOGFONTEX> fLogFontArray; |
2517 }; | 2517 }; |
2518 | 2518 |
2519 /////////////////////////////////////////////////////////////////////////////// | 2519 /////////////////////////////////////////////////////////////////////////////// |
2520 | 2520 |
2521 SkFontMgr* SkFontMgr_New_GDI() { return new SkFontMgrGDI; } | 2521 SkFontMgr* SkFontMgr_New_GDI() { return new SkFontMgrGDI; } |
2522 | 2522 |
2523 #endif//defined(SK_BUILD_FOR_WIN32) | 2523 #endif//defined(SK_BUILD_FOR_WIN32) |
OLD | NEW |