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/fx_font.h" | 7 #include "core/fxge/fx_font.h" |
8 | 8 |
9 #include "core/fpdfapi/font/cpdf_font.h" | 9 #include "core/fpdfapi/font/cpdf_font.h" |
10 #include "core/fxge/cfx_facecache.h" | 10 #include "core/fxge/cfx_facecache.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 unsigned long FTStreamRead(FXFT_Stream stream, | 35 unsigned long FTStreamRead(FXFT_Stream stream, |
36 unsigned long offset, | 36 unsigned long offset, |
37 unsigned char* buffer, | 37 unsigned char* buffer, |
38 unsigned long count) { | 38 unsigned long count) { |
39 if (count == 0) | 39 if (count == 0) |
40 return 0; | 40 return 0; |
41 | 41 |
42 IFX_SeekableReadStream* pFile = | 42 IFX_SeekableReadStream* pFile = |
43 static_cast<IFX_SeekableReadStream*>(stream->descriptor.pointer); | 43 static_cast<IFX_SeekableReadStream*>(stream->descriptor.pointer); |
44 return pFile->ReadBlock(buffer, offset, count) ? count : 0; | 44 return static_cast<unsigned long>(pFile->ReadBlock(buffer, offset, count)); |
45 } | 45 } |
46 | 46 |
47 void FTStreamClose(FXFT_Stream stream) {} | 47 void FTStreamClose(FXFT_Stream stream) {} |
48 | 48 |
49 bool LoadFileImp(FXFT_Library library, | 49 bool LoadFileImp(FXFT_Library library, |
50 FXFT_Face* Face, | 50 FXFT_Face* Face, |
51 IFX_SeekableReadStream* pFile, | 51 IFX_SeekableReadStream* pFile, |
52 int32_t faceIndex, | 52 int32_t faceIndex, |
53 std::unique_ptr<FXFT_StreamRec>* stream) { | 53 std::unique_ptr<FXFT_StreamRec>* stream) { |
54 std::unique_ptr<FXFT_StreamRec> stream1(new FXFT_StreamRec()); | 54 std::unique_ptr<FXFT_StreamRec> stream1(new FXFT_StreamRec()); |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 const CFX_PathData* CFX_Font::LoadGlyphPath(uint32_t glyph_index, | 707 const CFX_PathData* CFX_Font::LoadGlyphPath(uint32_t glyph_index, |
708 int dest_width) const { | 708 int dest_width) const { |
709 return GetFaceCache()->LoadGlyphPath(this, glyph_index, dest_width); | 709 return GetFaceCache()->LoadGlyphPath(this, glyph_index, dest_width); |
710 } | 710 } |
711 | 711 |
712 #ifdef _SKIA_SUPPORT_ | 712 #ifdef _SKIA_SUPPORT_ |
713 CFX_TypeFace* CFX_Font::GetDeviceCache() const { | 713 CFX_TypeFace* CFX_Font::GetDeviceCache() const { |
714 return GetFaceCache()->GetDeviceCache(this); | 714 return GetFaceCache()->GetDeviceCache(this); |
715 } | 715 } |
716 #endif | 716 #endif |
OLD | NEW |