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/include/cfx_fontmapper.h" | 7 #include "core/fxge/cfx_fontmapper.h" |
8 #include "core/fxge/include/ifx_systemfontinfo.h" | 8 #include "core/fxge/ifx_systemfontinfo.h" |
9 | 9 |
10 static CFX_ByteString GetStringFromTable(const uint8_t* string_ptr, | 10 static CFX_ByteString GetStringFromTable(const uint8_t* string_ptr, |
11 uint32_t string_ptr_length, | 11 uint32_t string_ptr_length, |
12 uint16_t offset, | 12 uint16_t offset, |
13 uint16_t length) { | 13 uint16_t length) { |
14 if (string_ptr_length < static_cast<uint32_t>(offset + length)) { | 14 if (string_ptr_length < static_cast<uint32_t>(offset + length)) { |
15 return CFX_ByteString(); | 15 return CFX_ByteString(); |
16 } | 16 } |
17 return CFX_ByteString(string_ptr + offset, length); | 17 return CFX_ByteString(string_ptr + offset, length); |
18 } | 18 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 CFX_ByteString fontTables, | 82 CFX_ByteString fontTables, |
83 uint32_t fontOffset, | 83 uint32_t fontOffset, |
84 uint32_t fileSize) | 84 uint32_t fileSize) |
85 : m_FilePath(filePath), | 85 : m_FilePath(filePath), |
86 m_FaceName(faceName), | 86 m_FaceName(faceName), |
87 m_FontTables(fontTables), | 87 m_FontTables(fontTables), |
88 m_FontOffset(fontOffset), | 88 m_FontOffset(fontOffset), |
89 m_FileSize(fileSize), | 89 m_FileSize(fileSize), |
90 m_Styles(0), | 90 m_Styles(0), |
91 m_Charsets(0) {} | 91 m_Charsets(0) {} |
OLD | NEW |