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_type3font.h" | 7 #include "core/fpdfapi/fpdf_font/cpdf_type3font.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_font/cpdf_type3char.h" | 9 #include "core/fpdfapi/fpdf_font/cpdf_type3char.h" |
10 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" | 10 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 m_CharWidthL[StartChar + i] = | 66 m_CharWidthL[StartChar + i] = |
67 FXSYS_round(pWidthArray->GetNumberAt(i) * xscale * 1000); | 67 FXSYS_round(pWidthArray->GetNumberAt(i) * xscale * 1000); |
68 } | 68 } |
69 } | 69 } |
70 m_pCharProcs = m_pFontDict->GetDictBy("CharProcs"); | 70 m_pCharProcs = m_pFontDict->GetDictBy("CharProcs"); |
71 CPDF_Object* pEncoding = m_pFontDict->GetDirectObjectBy("Encoding"); | 71 CPDF_Object* pEncoding = m_pFontDict->GetDirectObjectBy("Encoding"); |
72 if (pEncoding) { | 72 if (pEncoding) { |
73 LoadPDFEncoding(pEncoding, m_BaseEncoding, m_pCharNames, FALSE, FALSE); | 73 LoadPDFEncoding(pEncoding, m_BaseEncoding, m_pCharNames, FALSE, FALSE); |
74 if (m_pCharNames) { | 74 if (m_pCharNames) { |
75 for (int i = 0; i < 256; i++) { | 75 for (int i = 0; i < 256; i++) { |
76 m_Encoding.m_Unicodes[i] = PDF_UnicodeFromAdobeName(m_pCharNames[i]); | 76 m_Encoding.m_Unicodes[i] = |
| 77 PDF_UnicodeFromAdobeName(m_pCharNames[i].c_str()); |
77 if (m_Encoding.m_Unicodes[i] == 0) { | 78 if (m_Encoding.m_Unicodes[i] == 0) { |
78 m_Encoding.m_Unicodes[i] = i; | 79 m_Encoding.m_Unicodes[i] = i; |
79 } | 80 } |
80 } | 81 } |
81 } | 82 } |
82 } | 83 } |
83 return TRUE; | 84 return TRUE; |
84 } | 85 } |
85 | 86 |
86 void CPDF_Type3Font::CheckType3FontMetrics() { | 87 void CPDF_Type3Font::CheckType3FontMetrics() { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 return m_CharWidthL[charcode]; | 152 return m_CharWidthL[charcode]; |
152 | 153 |
153 const CPDF_Type3Char* pChar = LoadChar(charcode, level); | 154 const CPDF_Type3Char* pChar = LoadChar(charcode, level); |
154 return pChar ? pChar->m_Width : 0; | 155 return pChar ? pChar->m_Width : 0; |
155 } | 156 } |
156 | 157 |
157 FX_RECT CPDF_Type3Font::GetCharBBox(uint32_t charcode, int level) { | 158 FX_RECT CPDF_Type3Font::GetCharBBox(uint32_t charcode, int level) { |
158 const CPDF_Type3Char* pChar = LoadChar(charcode, level); | 159 const CPDF_Type3Char* pChar = LoadChar(charcode, level); |
159 return pChar ? pChar->m_BBox : FX_RECT(); | 160 return pChar ? pChar->m_BBox : FX_RECT(); |
160 } | 161 } |
OLD | NEW |