| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 call_ensure_accessible(lf); | 199 call_ensure_accessible(lf); |
| 200 otmRet = GetOutlineTextMetrics(hdc, sizeof(otm), &otm); | 200 otmRet = GetOutlineTextMetrics(hdc, sizeof(otm), &otm); |
| 201 } | 201 } |
| 202 | 202 |
| 203 return (0 == otmRet) ? 0 : otm.otmEMSquare; | 203 return (0 == otmRet) ? 0 : otm.otmEMSquare; |
| 204 } | 204 } |
| 205 | 205 |
| 206 class LogFontTypeface : public SkTypeface { | 206 class LogFontTypeface : public SkTypeface { |
| 207 public: | 207 public: |
| 208 LogFontTypeface(const SkFontStyle& style, const LOGFONT& lf, bool serializeA
sStream) | 208 LogFontTypeface(const SkFontStyle& style, const LOGFONT& lf, bool serializeA
sStream) |
| 209 : SkTypeface(style, SkTypefaceCache::NewFontID(), false) | 209 : SkTypeface(style, false) |
| 210 , fLogFont(lf) | 210 , fLogFont(lf) |
| 211 , fSerializeAsStream(serializeAsStream) | 211 , fSerializeAsStream(serializeAsStream) |
| 212 { | 212 { |
| 213 | 213 |
| 214 // If the font has cubic outlines, it will not be rendered with ClearTyp
e. | 214 // If the font has cubic outlines, it will not be rendered with ClearTyp
e. |
| 215 HFONT font = CreateFontIndirect(&lf); | 215 HFONT font = CreateFontIndirect(&lf); |
| 216 | 216 |
| 217 HDC deviceContext = ::CreateCompatibleDC(nullptr); | 217 HDC deviceContext = ::CreateCompatibleDC(nullptr); |
| 218 HFONT savefont = (HFONT)SelectObject(deviceContext, font); | 218 HFONT savefont = (HFONT)SelectObject(deviceContext, font); |
| 219 | 219 |
| (...skipping 2293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2513 | 2513 |
| 2514 private: | 2514 private: |
| 2515 SkTDArray<ENUMLOGFONTEX> fLogFontArray; | 2515 SkTDArray<ENUMLOGFONTEX> fLogFontArray; |
| 2516 }; | 2516 }; |
| 2517 | 2517 |
| 2518 /////////////////////////////////////////////////////////////////////////////// | 2518 /////////////////////////////////////////////////////////////////////////////// |
| 2519 | 2519 |
| 2520 SkFontMgr* SkFontMgr_New_GDI() { return new SkFontMgrGDI; } | 2520 SkFontMgr* SkFontMgr_New_GDI() { return new SkFontMgrGDI; } |
| 2521 | 2521 |
| 2522 #endif//defined(SK_BUILD_FOR_WIN32) | 2522 #endif//defined(SK_BUILD_FOR_WIN32) |
| OLD | NEW |