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/fpdfapi/fpdf_parser/include/cfdf_document.h" | 7 #include "core/fpdfapi/fpdf_parser/include/cfdf_document.h" |
8 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 8 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_number.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_number.h" |
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1047 CFX_ByteString DA; | 1047 CFX_ByteString DA; |
1048 if (CPDF_Object* pObj_t = FPDF_GetFieldAttr(m_pDict, "DA")) { | 1048 if (CPDF_Object* pObj_t = FPDF_GetFieldAttr(m_pDict, "DA")) { |
1049 DA = pObj_t->GetString(); | 1049 DA = pObj_t->GetString(); |
1050 } | 1050 } |
1051 if (DA.IsEmpty() && m_pForm->m_pFormDict) { | 1051 if (DA.IsEmpty() && m_pForm->m_pFormDict) { |
1052 DA = m_pForm->m_pFormDict->GetStringBy("DA"); | 1052 DA = m_pForm->m_pFormDict->GetStringBy("DA"); |
1053 } | 1053 } |
1054 if (DA.IsEmpty()) { | 1054 if (DA.IsEmpty()) { |
1055 return; | 1055 return; |
1056 } | 1056 } |
1057 CPDF_SimpleParser syntax(DA.AsByteStringC()); | 1057 CPDF_SimpleParser syntax(DA.AsStringC()); |
1058 syntax.FindTagParamFromStart("Tf", 2); | 1058 syntax.FindTagParamFromStart("Tf", 2); |
1059 CFX_ByteString font_name = syntax.GetWord(); | 1059 CFX_ByteString font_name = syntax.GetWord(); |
1060 CPDF_Dictionary* pFontDict = NULL; | 1060 CPDF_Dictionary* pFontDict = NULL; |
1061 if (m_pForm->m_pFormDict && m_pForm->m_pFormDict->GetDictBy("DR") && | 1061 if (m_pForm->m_pFormDict && m_pForm->m_pFormDict->GetDictBy("DR") && |
1062 m_pForm->m_pFormDict->GetDictBy("DR")->GetDictBy("Font")) | 1062 m_pForm->m_pFormDict->GetDictBy("DR")->GetDictBy("Font")) |
1063 pFontDict = m_pForm->m_pFormDict->GetDictBy("DR") | 1063 pFontDict = m_pForm->m_pFormDict->GetDictBy("DR") |
1064 ->GetDictBy("Font") | 1064 ->GetDictBy("Font") |
1065 ->GetDictBy(font_name.AsByteStringC()); | 1065 ->GetDictBy(font_name.AsStringC()); |
1066 | 1066 |
1067 if (!pFontDict) { | 1067 if (!pFontDict) { |
1068 return; | 1068 return; |
1069 } | 1069 } |
1070 m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict); | 1070 m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict); |
1071 m_FontSize = FX_atof(syntax.GetWord()); | 1071 m_FontSize = FX_atof(syntax.GetWord()); |
1072 } | 1072 } |
OLD | NEW |