| 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/cfgas_fontmgr.h" | 7 #include "xfa/fgas/font/cfgas_fontmgr.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 if (!hFont) | 902 if (!hFont) |
| 903 return nullptr; | 903 return nullptr; |
| 904 | 904 |
| 905 uint32_t dwFileSize = pSystemFontInfo->GetFontData(hFont, 0, nullptr, 0); | 905 uint32_t dwFileSize = pSystemFontInfo->GetFontData(hFont, 0, nullptr, 0); |
| 906 if (dwFileSize == 0) | 906 if (dwFileSize == 0) |
| 907 return nullptr; | 907 return nullptr; |
| 908 | 908 |
| 909 uint8_t* pBuffer = FX_Alloc(uint8_t, dwFileSize + 1); | 909 uint8_t* pBuffer = FX_Alloc(uint8_t, dwFileSize + 1); |
| 910 dwFileSize = pSystemFontInfo->GetFontData(hFont, 0, pBuffer, dwFileSize); | 910 dwFileSize = pSystemFontInfo->GetFontData(hFont, 0, pBuffer, dwFileSize); |
| 911 | 911 |
| 912 return FX_CreateMemoryStream(pBuffer, dwFileSize, true); | 912 return IFX_MemoryStream::Create(pBuffer, dwFileSize, true); |
| 913 } | 913 } |
| 914 | 914 |
| 915 IFX_SeekableReadStream* CFGAS_FontMgr::CreateFontStream( | 915 IFX_SeekableReadStream* CFGAS_FontMgr::CreateFontStream( |
| 916 const CFX_ByteString& bsFaceName) { | 916 const CFX_ByteString& bsFaceName) { |
| 917 CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr(); | 917 CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr(); |
| 918 CFX_FontMapper* pFontMapper = pFontMgr->GetBuiltinMapper(); | 918 CFX_FontMapper* pFontMapper = pFontMgr->GetBuiltinMapper(); |
| 919 | 919 |
| 920 if (!pFontMapper) | 920 if (!pFontMapper) |
| 921 return nullptr; | 921 return nullptr; |
| 922 | 922 |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 } | 1207 } |
| 1208 | 1208 |
| 1209 int32_t CFGAS_FontMgr::IsPartName(const CFX_WideString& Name1, | 1209 int32_t CFGAS_FontMgr::IsPartName(const CFX_WideString& Name1, |
| 1210 const CFX_WideString& Name2) { | 1210 const CFX_WideString& Name2) { |
| 1211 if (Name1.Find(Name2.c_str()) != -1) | 1211 if (Name1.Find(Name2.c_str()) != -1) |
| 1212 return 1; | 1212 return 1; |
| 1213 return 0; | 1213 return 0; |
| 1214 } | 1214 } |
| 1215 | 1215 |
| 1216 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 1216 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| OLD | NEW |