| 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 "../../../include/fxge/fx_ge.h" | 7 #include "../../../include/fxge/fx_ge.h" |
| 8 #include "apple_int.h" | 8 #include "apple_int.h" |
| 9 #if _FX_OS_ == _FX_MACOSX_ | 9 #if _FX_OS_ == _FX_MACOSX_ |
| 10 static const struct { | 10 static const struct { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 face = "LiSong Pro Light"; | 89 face = "LiSong Pro Light"; |
| 90 } | 90 } |
| 91 it = m_FontList.find(face); | 91 it = m_FontList.find(face); |
| 92 if (it != m_FontList.end()) | 92 if (it != m_FontList.end()) |
| 93 return it->second; | 93 return it->second; |
| 94 | 94 |
| 95 return NULL; | 95 return NULL; |
| 96 } | 96 } |
| 97 IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault(const char** pUnused) { | 97 IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault(const char** pUnused) { |
| 98 CFX_MacFontInfo* pInfo = new CFX_MacFontInfo; | 98 CFX_MacFontInfo* pInfo = new CFX_MacFontInfo; |
| 99 if (!pInfo) { | |
| 100 return NULL; | |
| 101 } | |
| 102 pInfo->AddPath("~/Library/Fonts"); | 99 pInfo->AddPath("~/Library/Fonts"); |
| 103 pInfo->AddPath("/Library/Fonts"); | 100 pInfo->AddPath("/Library/Fonts"); |
| 104 pInfo->AddPath("/System/Library/Fonts"); | 101 pInfo->AddPath("/System/Library/Fonts"); |
| 105 return pInfo; | 102 return pInfo; |
| 106 } | 103 } |
| 107 void CFX_GEModule::InitPlatform() { | 104 void CFX_GEModule::InitPlatform() { |
| 108 m_pPlatformData = new CApplePlatform; | 105 m_pPlatformData = new CApplePlatform; |
| 109 m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault(nullptr)); | 106 m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault(nullptr)); |
| 110 } | 107 } |
| 111 void CFX_GEModule::DestroyPlatform() { | 108 void CFX_GEModule::DestroyPlatform() { |
| 112 delete (CApplePlatform*)m_pPlatformData; | 109 delete (CApplePlatform*)m_pPlatformData; |
| 113 m_pPlatformData = NULL; | 110 m_pPlatformData = NULL; |
| 114 } | 111 } |
| 115 #endif | 112 #endif |
| OLD | NEW |