| 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/fxge/apple/apple_int.h" | 7 #include "core/fxge/apple/apple_int.h" |
| 8 #include "core/fxge/include/fx_ge.h" | 8 #include "core/fxge/include/fx_ge.h" |
| 9 | 9 |
| 10 #if _FX_OS_ == _FX_MACOSX_ | 10 #if _FX_OS_ == _FX_MACOSX_ |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 int& iExact) { | 57 int& iExact) { |
| 58 CFX_ByteString face = cstr_face; | 58 CFX_ByteString face = cstr_face; |
| 59 int iBaseFont; | 59 int iBaseFont; |
| 60 for (iBaseFont = 0; iBaseFont < 12; iBaseFont++) | 60 for (iBaseFont = 0; iBaseFont < 12; iBaseFont++) |
| 61 if (face == CFX_ByteStringC(Base14Substs[iBaseFont].m_pName)) { | 61 if (face == CFX_ByteStringC(Base14Substs[iBaseFont].m_pName)) { |
| 62 face = Base14Substs[iBaseFont].m_pSubstName; | 62 face = Base14Substs[iBaseFont].m_pSubstName; |
| 63 iExact = TRUE; | 63 iExact = TRUE; |
| 64 break; | 64 break; |
| 65 } | 65 } |
| 66 if (iBaseFont < 12) { | 66 if (iBaseFont < 12) { |
| 67 return GetFont(face); | 67 return GetFont(face.c_str()); |
| 68 } | 68 } |
| 69 auto it = m_FontList.find(face); | 69 auto it = m_FontList.find(face); |
| 70 if (it != m_FontList.end()) | 70 if (it != m_FontList.end()) |
| 71 return it->second; | 71 return it->second; |
| 72 | 72 |
| 73 if (charset == FXFONT_ANSI_CHARSET && (pitch_family & FXFONT_FF_FIXEDPITCH)) { | 73 if (charset == FXFONT_ANSI_CHARSET && (pitch_family & FXFONT_FF_FIXEDPITCH)) { |
| 74 return GetFont("Courier New"); | 74 return GetFont("Courier New"); |
| 75 } | 75 } |
| 76 if (charset == FXFONT_ANSI_CHARSET || charset == FXFONT_SYMBOL_CHARSET) { | 76 if (charset == FXFONT_ANSI_CHARSET || charset == FXFONT_SYMBOL_CHARSET) { |
| 77 return NULL; | 77 return NULL; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 104 } | 104 } |
| 105 void CFX_GEModule::InitPlatform() { | 105 void CFX_GEModule::InitPlatform() { |
| 106 m_pPlatformData = new CApplePlatform; | 106 m_pPlatformData = new CApplePlatform; |
| 107 m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault(nullptr)); | 107 m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault(nullptr)); |
| 108 } | 108 } |
| 109 void CFX_GEModule::DestroyPlatform() { | 109 void CFX_GEModule::DestroyPlatform() { |
| 110 delete (CApplePlatform*)m_pPlatformData; | 110 delete (CApplePlatform*)m_pPlatformData; |
| 111 m_pPlatformData = NULL; | 111 m_pPlatformData = NULL; |
| 112 } | 112 } |
| 113 #endif | 113 #endif |
| OLD | NEW |