| 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 "../../../include/fxge/fx_freetype.h" | 8 #include "../../../include/fxge/fx_freetype.h" | 
| 9 #include "text_int.h" | 9 #include "text_int.h" | 
| 10 #define EM_ADJUST(em, a) (em == 0 ? (a) : (a)*1000 / em) | 10 #define EM_ADJUST(em, a) (em == 0 ? (a) : (a)*1000 / em) | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
| 23   m_pGsubData = NULL; | 23   m_pGsubData = NULL; | 
| 24   m_pPlatformFont = NULL; | 24   m_pPlatformFont = NULL; | 
| 25   m_pPlatformFontCollection = NULL; | 25   m_pPlatformFontCollection = NULL; | 
| 26   m_pDwFont = NULL; | 26   m_pDwFont = NULL; | 
| 27   m_hHandle = NULL; | 27   m_hHandle = NULL; | 
| 28   m_bDwLoaded = FALSE; | 28   m_bDwLoaded = FALSE; | 
| 29 } | 29 } | 
| 30 CFX_Font::~CFX_Font() { | 30 CFX_Font::~CFX_Font() { | 
| 31   delete m_pSubstFont; | 31   delete m_pSubstFont; | 
| 32   m_pSubstFont = NULL; | 32   m_pSubstFont = NULL; | 
| 33   if (m_pFontDataAllocation) { | 33   FX_Free(m_pFontDataAllocation); | 
| 34     FX_Free(m_pFontDataAllocation); | 34   m_pFontDataAllocation = NULL; | 
| 35     m_pFontDataAllocation = NULL; |  | 
| 36   } |  | 
| 37   if (m_Face) { | 35   if (m_Face) { | 
| 38     if (FXFT_Get_Face_External_Stream(m_Face)) { | 36     if (FXFT_Get_Face_External_Stream(m_Face)) { | 
| 39       FXFT_Clear_Face_External_Stream(m_Face); | 37       FXFT_Clear_Face_External_Stream(m_Face); | 
| 40     } | 38     } | 
| 41     if (m_bEmbedded) { | 39     if (m_bEmbedded) { | 
| 42       DeleteFace(); | 40       DeleteFace(); | 
| 43     } else { | 41     } else { | 
| 44       CFX_GEModule::Get()->GetFontMgr()->ReleaseFace(m_Face); | 42       CFX_GEModule::Get()->GetFontMgr()->ReleaseFace(m_Face); | 
| 45     } | 43     } | 
| 46   } | 44   } | 
| 47   if (m_pOwnedStream) { | 45   FX_Free(m_pOwnedStream); | 
| 48     FX_Free(m_pOwnedStream); | 46   m_pOwnedStream = NULL; | 
| 49     m_pOwnedStream = NULL; | 47   FX_Free(m_pGsubData); | 
| 50   } | 48   m_pGsubData = NULL; | 
| 51   if (m_pGsubData) { |  | 
| 52     FX_Free(m_pGsubData); |  | 
| 53     m_pGsubData = NULL; |  | 
| 54   } |  | 
| 55 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 49 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 
| 56   ReleasePlatformResource(); | 50   ReleasePlatformResource(); | 
| 57 #endif | 51 #endif | 
| 58 } | 52 } | 
| 59 void CFX_Font::DeleteFace() { | 53 void CFX_Font::DeleteFace() { | 
| 60   FXFT_Done_Face(m_Face); | 54   FXFT_Done_Face(m_Face); | 
| 61   m_Face = NULL; | 55   m_Face = NULL; | 
| 62 } | 56 } | 
| 63 FX_BOOL CFX_Font::LoadSubst(const CFX_ByteString& face_name, | 57 FX_BOOL CFX_Font::LoadSubst(const CFX_ByteString& face_name, | 
| 64                             FX_BOOL bTrueType, | 58                             FX_BOOL bTrueType, | 
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 423     if (encoding != FXFT_ENCODING_UNICODE) { | 417     if (encoding != FXFT_ENCODING_UNICODE) { | 
| 424       FXFT_Select_Charmap(face, encoding); | 418       FXFT_Select_Charmap(face, encoding); | 
| 425       break; | 419       break; | 
| 426     } | 420     } | 
| 427   } | 421   } | 
| 428   return FXFT_Get_Char_Index(face, charcode); | 422   return FXFT_Get_Char_Index(face, charcode); | 
| 429 } | 423 } | 
| 430 IFX_FontEncoding* FXGE_CreateUnicodeEncoding(CFX_Font* pFont) { | 424 IFX_FontEncoding* FXGE_CreateUnicodeEncoding(CFX_Font* pFont) { | 
| 431   return new CFX_UnicodeEncoding(pFont); | 425   return new CFX_UnicodeEncoding(pFont); | 
| 432 } | 426 } | 
| OLD | NEW | 
|---|