OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkAdvancedTypefaceMetrics.h" | 9 #include "SkAdvancedTypefaceMetrics.h" |
10 #include "SkBase64.h" | 10 #include "SkBase64.h" |
(...skipping 2136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2147 LOGFONT lf = fLogFont; | 2147 LOGFONT lf = fLogFont; |
2148 | 2148 |
2149 HDC hdc = ::CreateCompatibleDC(NULL); | 2149 HDC hdc = ::CreateCompatibleDC(NULL); |
2150 HFONT font = CreateFontIndirect(&lf); | 2150 HFONT font = CreateFontIndirect(&lf); |
2151 HFONT savefont = (HFONT)SelectObject(hdc, font); | 2151 HFONT savefont = (HFONT)SelectObject(hdc, font); |
2152 | 2152 |
2153 tag = SkEndian_SwapBE32(tag); | 2153 tag = SkEndian_SwapBE32(tag); |
2154 if (NULL == data) { | 2154 if (NULL == data) { |
2155 length = 0; | 2155 length = 0; |
2156 } | 2156 } |
2157 DWORD bufferSize = GetFontData(hdc, tag, offset, data, length); | 2157 DWORD bufferSize = GetFontData(hdc, tag, (DWORD) offset, data, (DWORD) lengt
h); |
2158 if (bufferSize == GDI_ERROR) { | 2158 if (bufferSize == GDI_ERROR) { |
2159 call_ensure_accessible(lf); | 2159 call_ensure_accessible(lf); |
2160 bufferSize = GetFontData(hdc, tag, offset, data, length); | 2160 bufferSize = GetFontData(hdc, tag, (DWORD) offset, data, (DWORD) length)
; |
2161 } | 2161 } |
2162 | 2162 |
2163 SelectObject(hdc, savefont); | 2163 SelectObject(hdc, savefont); |
2164 DeleteObject(font); | 2164 DeleteObject(font); |
2165 DeleteDC(hdc); | 2165 DeleteDC(hdc); |
2166 | 2166 |
2167 return bufferSize == GDI_ERROR ? 0 : bufferSize; | 2167 return bufferSize == GDI_ERROR ? 0 : bufferSize; |
2168 } | 2168 } |
2169 | 2169 |
2170 SkScalerContext* LogFontTypeface::onCreateScalerContext(const SkDescriptor* desc
) const { | 2170 SkScalerContext* LogFontTypeface::onCreateScalerContext(const SkDescriptor* desc
) const { |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2427 | 2427 |
2428 SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) { | 2428 SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) { |
2429 return create_from_stream(stream); | 2429 return create_from_stream(stream); |
2430 } | 2430 } |
2431 | 2431 |
2432 #endif | 2432 #endif |
2433 | 2433 |
2434 SkFontMgr* SkFontMgr_New_GDI() { | 2434 SkFontMgr* SkFontMgr_New_GDI() { |
2435 return SkNEW(SkFontMgrGDI); | 2435 return SkNEW(SkFontMgrGDI); |
2436 } | 2436 } |
OLD | NEW |