| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "core/include/fxge/fx_ge.h" | 7 #include "core/include/fxge/fx_ge.h" |
| 8 | 8 |
| 9 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ | 9 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ |
| 10 #include <crtdbg.h> | 10 #include <crtdbg.h> |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 return hFont; | 404 return hFont; |
| 405 } | 405 } |
| 406 void CFX_Win32FontInfo::DeleteFont(void* hFont) { | 406 void CFX_Win32FontInfo::DeleteFont(void* hFont) { |
| 407 ::DeleteObject(hFont); | 407 ::DeleteObject(hFont); |
| 408 } | 408 } |
| 409 FX_DWORD CFX_Win32FontInfo::GetFontData(void* hFont, | 409 FX_DWORD CFX_Win32FontInfo::GetFontData(void* hFont, |
| 410 FX_DWORD table, | 410 FX_DWORD table, |
| 411 uint8_t* buffer, | 411 uint8_t* buffer, |
| 412 FX_DWORD size) { | 412 FX_DWORD size) { |
| 413 HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont); | 413 HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont); |
| 414 table = FXDWORD_FROM_MSBFIRST(table); | 414 table = FXDWORD_GET_MSBFIRST(reinterpret_cast<uint8_t*>(&table)); |
| 415 size = ::GetFontData(m_hDC, table, 0, buffer, size); | 415 size = ::GetFontData(m_hDC, table, 0, buffer, size); |
| 416 ::SelectObject(m_hDC, hOldFont); | 416 ::SelectObject(m_hDC, hOldFont); |
| 417 if (size == GDI_ERROR) { | 417 if (size == GDI_ERROR) { |
| 418 return 0; | 418 return 0; |
| 419 } | 419 } |
| 420 return size; | 420 return size; |
| 421 } | 421 } |
| 422 FX_BOOL CFX_Win32FontInfo::GetFaceName(void* hFont, CFX_ByteString& name) { | 422 FX_BOOL CFX_Win32FontInfo::GetFaceName(void* hFont, CFX_ByteString& name) { |
| 423 char facebuf[100]; | 423 char facebuf[100]; |
| 424 HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont); | 424 HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont); |
| (...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1363 SelectObject(m_hDC, m_hOldBitmap); | 1363 SelectObject(m_hDC, m_hOldBitmap); |
| 1364 DeleteDC(m_hDC); | 1364 DeleteDC(m_hDC); |
| 1365 } | 1365 } |
| 1366 if (m_hBitmap) { | 1366 if (m_hBitmap) { |
| 1367 DeleteObject(m_hBitmap); | 1367 DeleteObject(m_hBitmap); |
| 1368 } | 1368 } |
| 1369 delete GetBitmap(); | 1369 delete GetBitmap(); |
| 1370 } | 1370 } |
| 1371 | 1371 |
| 1372 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ | 1372 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ |
| OLD | NEW |