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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 } | 453 } |
454 // Select the fallback font information class if GDI is disabled. | 454 // Select the fallback font information class if GDI is disabled. |
455 CFX_Win32FallbackFontInfo* pInfoFallback = new CFX_Win32FallbackFontInfo; | 455 CFX_Win32FallbackFontInfo* pInfoFallback = new CFX_Win32FallbackFontInfo; |
456 // Construct the font path manually, SHGetKnownFolderPath won't work under | 456 // Construct the font path manually, SHGetKnownFolderPath won't work under |
457 // a restrictive sandbox. | 457 // a restrictive sandbox. |
458 CHAR windows_path[MAX_PATH] = {}; | 458 CHAR windows_path[MAX_PATH] = {}; |
459 DWORD path_len = ::GetWindowsDirectoryA(windows_path, MAX_PATH); | 459 DWORD path_len = ::GetWindowsDirectoryA(windows_path, MAX_PATH); |
460 if (path_len > 0 && path_len < MAX_PATH) { | 460 if (path_len > 0 && path_len < MAX_PATH) { |
461 CFX_ByteString fonts_path(windows_path); | 461 CFX_ByteString fonts_path(windows_path); |
462 fonts_path += "\\Fonts"; | 462 fonts_path += "\\Fonts"; |
463 pInfoFallback->AddPath(fonts_path); | 463 pInfoFallback->AddPath(fonts_path.AsByteStringC()); |
464 } | 464 } |
465 return pInfoFallback; | 465 return pInfoFallback; |
466 } | 466 } |
467 void CFX_GEModule::InitPlatform() { | 467 void CFX_GEModule::InitPlatform() { |
468 CWin32Platform* pPlatformData = new CWin32Platform; | 468 CWin32Platform* pPlatformData = new CWin32Platform; |
469 OSVERSIONINFO ver; | 469 OSVERSIONINFO ver; |
470 ver.dwOSVersionInfoSize = sizeof(ver); | 470 ver.dwOSVersionInfoSize = sizeof(ver); |
471 GetVersionEx(&ver); | 471 GetVersionEx(&ver); |
472 pPlatformData->m_bHalfTone = ver.dwMajorVersion >= 5; | 472 pPlatformData->m_bHalfTone = ver.dwMajorVersion >= 5; |
473 if (IsGDIEnabled()) { | 473 if (IsGDIEnabled()) { |
(...skipping 889 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 |