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/fx_stream.h" | 9 #include "core/fxcrt/fx_stream.h" |
10 #include "core/fxge/cfx_fontmapper.h" | 10 #include "core/fxge/cfx_fontmapper.h" |
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 | 862 |
863 unsigned long _ftStreamRead(FXFT_Stream stream, | 863 unsigned long _ftStreamRead(FXFT_Stream stream, |
864 unsigned long offset, | 864 unsigned long offset, |
865 unsigned char* buffer, | 865 unsigned char* buffer, |
866 unsigned long count) { | 866 unsigned long count) { |
867 if (count == 0) | 867 if (count == 0) |
868 return 0; | 868 return 0; |
869 | 869 |
870 IFX_SeekableReadStream* pFile = | 870 IFX_SeekableReadStream* pFile = |
871 (IFX_SeekableReadStream*)stream->descriptor.pointer; | 871 (IFX_SeekableReadStream*)stream->descriptor.pointer; |
872 int res = pFile->ReadBlock(buffer, offset, count); | 872 unsigned long readSize = |
873 if (res) | 873 static_cast<unsigned long>(pFile->ReadBlock(buffer, offset, count)); |
874 return count; | 874 if (readSize == count || pFile->IsEOF()) |
| 875 return readSize; |
875 return 0; | 876 return 0; |
876 } | 877 } |
877 | 878 |
878 void _ftStreamClose(FXFT_Stream stream) {} | 879 void _ftStreamClose(FXFT_Stream stream) {} |
879 | 880 |
880 }; // extern "C" | 881 }; // extern "C" |
881 | 882 |
882 FXFT_Face CFGAS_FontMgrImp::LoadFace(IFX_SeekableReadStream* pFontStream, | 883 FXFT_Face CFGAS_FontMgrImp::LoadFace(IFX_SeekableReadStream* pFontStream, |
883 int32_t iFaceIndex) { | 884 int32_t iFaceIndex) { |
884 if (!pFontStream) | 885 if (!pFontStream) |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1375 | 1376 |
1376 int32_t CFGAS_FontMgrImp::IsPartName(const CFX_WideString& Name1, | 1377 int32_t CFGAS_FontMgrImp::IsPartName(const CFX_WideString& Name1, |
1377 const CFX_WideString& Name2) { | 1378 const CFX_WideString& Name2) { |
1378 if (Name1.Find(Name2.c_str()) != -1) { | 1379 if (Name1.Find(Name2.c_str()) != -1) { |
1379 return 1; | 1380 return 1; |
1380 } | 1381 } |
1381 return 0; | 1382 return 0; |
1382 } | 1383 } |
1383 | 1384 |
1384 #endif | 1385 #endif |
OLD | NEW |