Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Side by Side Diff: core/src/fxge/win32/fx_win32_device.cpp

Issue 1368513002: Merge to XFA: Allow external font-path configuration from pdfium_test. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/src/fxge/ge/fx_ge_linux.cpp ('k') | fpdfsdk/src/fpdf_sysfontinfo.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "../../../include/fxge/fx_ge.h" 7 #include "../../../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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 return TRUE; 398 return TRUE;
399 } 399 }
400 FX_BOOL CFX_Win32FontInfo::GetFontCharset(void* hFont, int& charset) { 400 FX_BOOL CFX_Win32FontInfo::GetFontCharset(void* hFont, int& charset) {
401 TEXTMETRIC tm; 401 TEXTMETRIC tm;
402 HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont); 402 HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont);
403 ::GetTextMetrics(m_hDC, &tm); 403 ::GetTextMetrics(m_hDC, &tm);
404 ::SelectObject(m_hDC, hOldFont); 404 ::SelectObject(m_hDC, hOldFont);
405 charset = tm.tmCharSet; 405 charset = tm.tmCharSet;
406 return TRUE; 406 return TRUE;
407 } 407 }
408 IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault() { 408 IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault(const char** pUnused) {
409 return new CFX_Win32FontInfo; 409 return new CFX_Win32FontInfo;
410 } 410 }
411 void CFX_GEModule::InitPlatform() { 411 void CFX_GEModule::InitPlatform() {
412 CWin32Platform* pPlatformData = new CWin32Platform; 412 CWin32Platform* pPlatformData = new CWin32Platform;
413 if (!pPlatformData) { 413 if (!pPlatformData) {
414 return; 414 return;
415 } 415 }
416 OSVERSIONINFO ver; 416 OSVERSIONINFO ver;
417 ver.dwOSVersionInfoSize = sizeof(ver); 417 ver.dwOSVersionInfoSize = sizeof(ver);
418 GetVersionEx(&ver); 418 GetVersionEx(&ver);
419 pPlatformData->m_bHalfTone = ver.dwMajorVersion >= 5; 419 pPlatformData->m_bHalfTone = ver.dwMajorVersion >= 5;
420 pPlatformData->m_GdiplusExt.Load(); 420 pPlatformData->m_GdiplusExt.Load();
421 m_pPlatformData = pPlatformData; 421 m_pPlatformData = pPlatformData;
422 m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault()); 422 m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault(nullptr));
423 } 423 }
424 void CFX_GEModule::DestroyPlatform() { 424 void CFX_GEModule::DestroyPlatform() {
425 delete (CWin32Platform*)m_pPlatformData; 425 delete (CWin32Platform*)m_pPlatformData;
426 m_pPlatformData = NULL; 426 m_pPlatformData = NULL;
427 } 427 }
428 CGdiDeviceDriver::CGdiDeviceDriver(HDC hDC, int device_class) { 428 CGdiDeviceDriver::CGdiDeviceDriver(HDC hDC, int device_class) {
429 m_hDC = hDC; 429 m_hDC = hDC;
430 m_DeviceClass = device_class; 430 m_DeviceClass = device_class;
431 CWin32Platform* pPlatform = 431 CWin32Platform* pPlatform =
432 (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData(); 432 (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData();
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 SelectObject(m_hDC, m_hOldBitmap); 1321 SelectObject(m_hDC, m_hOldBitmap);
1322 DeleteDC(m_hDC); 1322 DeleteDC(m_hDC);
1323 } 1323 }
1324 if (m_hBitmap) { 1324 if (m_hBitmap) {
1325 DeleteObject(m_hBitmap); 1325 DeleteObject(m_hBitmap);
1326 } 1326 }
1327 delete GetBitmap(); 1327 delete GetBitmap();
1328 } 1328 }
1329 1329
1330 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ 1330 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
OLDNEW
« no previous file with comments | « core/src/fxge/ge/fx_ge_linux.cpp ('k') | fpdfsdk/src/fpdf_sysfontinfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698