| OLD | NEW |
| 1 // Copyright 2015 PDFium Authors. All rights reserved. | 1 // Copyright 2015 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 "xfa/fgas/font/fgas_stdfontmgr.h" | 7 #include "xfa/fgas/font/fgas_stdfontmgr.h" |
| 8 | 8 |
| 9 #include "core/fxcrt/include/fx_stream.h" | 9 #include "core/fxcrt/include/fx_stream.h" |
| 10 #include "core/fxge/include/fx_ge.h" | 10 #include "core/fxge/include/fx_ge.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 m_CPFonts.RemoveAll(); | 35 m_CPFonts.RemoveAll(); |
| 36 m_FamilyFonts.RemoveAll(); | 36 m_FamilyFonts.RemoveAll(); |
| 37 m_UnicodeFonts.RemoveAll(); | 37 m_UnicodeFonts.RemoveAll(); |
| 38 m_BufferFonts.RemoveAll(); | 38 m_BufferFonts.RemoveAll(); |
| 39 m_StreamFonts.RemoveAll(); | 39 m_StreamFonts.RemoveAll(); |
| 40 m_DeriveFonts.RemoveAll(); | 40 m_DeriveFonts.RemoveAll(); |
| 41 for (int32_t i = m_Fonts.GetUpperBound(); i >= 0; i--) | 41 for (int32_t i = m_Fonts.GetUpperBound(); i >= 0; i--) |
| 42 m_Fonts[i]->Release(); | 42 m_Fonts[i]->Release(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void CFGAS_StdFontMgrImp::Release() { |
| 46 delete this; |
| 47 } |
| 48 |
| 45 CFGAS_GEFont* CFGAS_StdFontMgrImp::GetDefFontByCodePage( | 49 CFGAS_GEFont* CFGAS_StdFontMgrImp::GetDefFontByCodePage( |
| 46 uint16_t wCodePage, | 50 uint16_t wCodePage, |
| 47 uint32_t dwFontStyles, | 51 uint32_t dwFontStyles, |
| 48 const FX_WCHAR* pszFontFamily) { | 52 const FX_WCHAR* pszFontFamily) { |
| 49 uint32_t dwHash = FGAS_GetFontHashCode(wCodePage, dwFontStyles); | 53 uint32_t dwHash = FGAS_GetFontHashCode(wCodePage, dwFontStyles); |
| 50 CFGAS_GEFont* pFont = NULL; | 54 CFGAS_GEFont* pFont = NULL; |
| 51 if (m_CPFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) { | 55 if (m_CPFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) { |
| 52 return pFont ? LoadFont(pFont, dwFontStyles, wCodePage) : NULL; | 56 return pFont ? LoadFont(pFont, dwFontStyles, wCodePage) : NULL; |
| 53 } | 57 } |
| 54 FX_FONTDESCRIPTOR const* pFD; | 58 FX_FONTDESCRIPTOR const* pFD; |
| (...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1344 } | 1348 } |
| 1345 } | 1349 } |
| 1346 int32_t CFGAS_FontMgrImp::IsPartName(const CFX_WideString& Name1, | 1350 int32_t CFGAS_FontMgrImp::IsPartName(const CFX_WideString& Name1, |
| 1347 const CFX_WideString& Name2) { | 1351 const CFX_WideString& Name2) { |
| 1348 if (Name1.Find(Name2.c_str()) != -1) { | 1352 if (Name1.Find(Name2.c_str()) != -1) { |
| 1349 return 1; | 1353 return 1; |
| 1350 } | 1354 } |
| 1351 return 0; | 1355 return 0; |
| 1352 } | 1356 } |
| 1353 #endif | 1357 #endif |
| OLD | NEW |