OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/fpdfapi/fpdf_font/cpdf_simplefont.h" | 7 #include "core/fpdfapi/fpdf_font/cpdf_simplefont.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_font/font_int.h" | 9 #include "core/fpdfapi/fpdf_font/font_int.h" |
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
11 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" | 11 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" |
12 #include "core/include/fxge/fx_freetype.h" | 12 #include "core/fxge/include/fx_freetype.h" |
13 | 13 |
14 CPDF_SimpleFont::CPDF_SimpleFont() | 14 CPDF_SimpleFont::CPDF_SimpleFont() |
15 : m_pCharNames(nullptr), m_BaseEncoding(PDFFONT_ENCODING_BUILTIN) { | 15 : m_pCharNames(nullptr), m_BaseEncoding(PDFFONT_ENCODING_BUILTIN) { |
16 FXSYS_memset(m_CharWidth, 0xff, sizeof m_CharWidth); | 16 FXSYS_memset(m_CharWidth, 0xff, sizeof m_CharWidth); |
17 FXSYS_memset(m_GlyphIndex, 0xff, sizeof m_GlyphIndex); | 17 FXSYS_memset(m_GlyphIndex, 0xff, sizeof m_GlyphIndex); |
18 FXSYS_memset(m_ExtGID, 0xff, sizeof m_ExtGID); | 18 FXSYS_memset(m_ExtGID, 0xff, sizeof m_ExtGID); |
19 } | 19 } |
20 | 20 |
21 CPDF_SimpleFont::~CPDF_SimpleFont() { | 21 CPDF_SimpleFont::~CPDF_SimpleFont() { |
22 delete[] m_pCharNames; | 22 delete[] m_pCharNames; |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 return CFX_WideString(); | 213 return CFX_WideString(); |
214 return ret; | 214 return ret; |
215 } | 215 } |
216 | 216 |
217 uint32_t CPDF_SimpleFont::CharCodeFromUnicode(FX_WCHAR unicode) const { | 217 uint32_t CPDF_SimpleFont::CharCodeFromUnicode(FX_WCHAR unicode) const { |
218 uint32_t ret = CPDF_Font::CharCodeFromUnicode(unicode); | 218 uint32_t ret = CPDF_Font::CharCodeFromUnicode(unicode); |
219 if (ret) | 219 if (ret) |
220 return ret; | 220 return ret; |
221 return m_Encoding.CharCodeFromUnicode(unicode); | 221 return m_Encoding.CharCodeFromUnicode(unicode); |
222 } | 222 } |
OLD | NEW |