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_truetypefont.h" | 7 #include "core/fpdfapi/fpdf_font/cpdf_truetypefont.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_dictionary.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 } | 23 } |
24 | 24 |
25 const CPDF_TrueTypeFont* CPDF_TrueTypeFont::AsTrueTypeFont() const { | 25 const CPDF_TrueTypeFont* CPDF_TrueTypeFont::AsTrueTypeFont() const { |
26 return this; | 26 return this; |
27 } | 27 } |
28 | 28 |
29 CPDF_TrueTypeFont* CPDF_TrueTypeFont::AsTrueTypeFont() { | 29 CPDF_TrueTypeFont* CPDF_TrueTypeFont::AsTrueTypeFont() { |
30 return this; | 30 return this; |
31 } | 31 } |
32 | 32 |
33 FX_BOOL CPDF_TrueTypeFont::Load() { | 33 bool CPDF_TrueTypeFont::Load() { |
34 return LoadCommon(); | 34 return LoadCommon(); |
35 } | 35 } |
36 | 36 |
37 void CPDF_TrueTypeFont::LoadGlyphMap() { | 37 void CPDF_TrueTypeFont::LoadGlyphMap() { |
38 if (!m_Font.GetFace()) | 38 if (!m_Font.GetFace()) |
39 return; | 39 return; |
40 | 40 |
41 int baseEncoding = m_BaseEncoding; | 41 int baseEncoding = m_BaseEncoding; |
42 if (m_pFontFile && m_Font.GetFace()->num_charmaps > 0 && | 42 if (m_pFontFile && m_Font.GetFace()->num_charmaps > 0 && |
43 (baseEncoding == PDFFONT_ENCODING_MACROMAN || | 43 (baseEncoding == PDFFONT_ENCODING_MACROMAN || |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 m_Font.GetFace(), m_Encoding.m_Unicodes[charcode]); | 214 m_Font.GetFace(), m_Encoding.m_Unicodes[charcode]); |
215 if (m_GlyphIndex[charcode]) | 215 if (m_GlyphIndex[charcode]) |
216 bFound = true; | 216 bFound = true; |
217 } | 217 } |
218 if (bFound) | 218 if (bFound) |
219 return; | 219 return; |
220 } | 220 } |
221 for (int charcode = 0; charcode < 256; charcode++) | 221 for (int charcode = 0; charcode < 256; charcode++) |
222 m_GlyphIndex[charcode] = charcode; | 222 m_GlyphIndex[charcode] = charcode; |
223 } | 223 } |
OLD | NEW |