| 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 "pageint.h" | 7 #include "pageint.h" |
| 8 | 8 |
| 9 #include "core/include/fpdfapi/fpdf_module.h" | 9 #include "core/include/fpdfapi/fpdf_module.h" |
| 10 #include "core/include/fpdfapi/fpdf_page.h" | 10 #include "core/include/fpdfapi/fpdf_page.h" |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 CPDF_Font* pFont = m_TextState.GetFont(); | 402 CPDF_Font* pFont = m_TextState.GetFont(); |
| 403 FX_BOOL bVertWriting = FALSE; | 403 FX_BOOL bVertWriting = FALSE; |
| 404 CPDF_CIDFont* pCIDFont = pFont->GetCIDFont(); | 404 CPDF_CIDFont* pCIDFont = pFont->GetCIDFont(); |
| 405 if (pCIDFont) { | 405 if (pCIDFont) { |
| 406 bVertWriting = pCIDFont->IsVertWriting(); | 406 bVertWriting = pCIDFont->IsVertWriting(); |
| 407 } | 407 } |
| 408 FX_FLOAT fontsize = m_TextState.GetFontSize(); | 408 FX_FLOAT fontsize = m_TextState.GetFontSize(); |
| 409 for (int i = 0; i < m_nChars; ++i) { | 409 for (int i = 0; i < m_nChars; ++i) { |
| 410 FX_DWORD charcode = | 410 FX_DWORD charcode = |
| 411 m_nChars == 1 ? (FX_DWORD)(uintptr_t)m_pCharCodes : m_pCharCodes[i]; | 411 m_nChars == 1 ? (FX_DWORD)(uintptr_t)m_pCharCodes : m_pCharCodes[i]; |
| 412 if (charcode == (FX_DWORD)-1) { | 412 if (i > 0) { |
| 413 curpos -= FXSYS_Mul(m_pCharPos[i - 1], fontsize) / 1000; | 413 if (charcode == (FX_DWORD)-1) { |
| 414 continue; | 414 curpos -= FXSYS_Mul(m_pCharPos[i - 1], fontsize) / 1000; |
| 415 } | 415 continue; |
| 416 if (i) { | 416 } |
| 417 m_pCharPos[i - 1] = curpos; | 417 m_pCharPos[i - 1] = curpos; |
| 418 } | 418 } |
| 419 FX_RECT char_rect; | 419 FX_RECT char_rect; |
| 420 pFont->GetCharBBox(charcode, char_rect, level); | 420 pFont->GetCharBBox(charcode, char_rect, level); |
| 421 FX_FLOAT charwidth; | 421 FX_FLOAT charwidth; |
| 422 if (!bVertWriting) { | 422 if (!bVertWriting) { |
| 423 if (min_y > char_rect.top) { | 423 if (min_y > char_rect.top) { |
| 424 min_y = (FX_FLOAT)char_rect.top; | 424 min_y = (FX_FLOAT)char_rect.top; |
| 425 } | 425 } |
| 426 if (max_y < char_rect.top) { | 426 if (max_y < char_rect.top) { |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1006 (FX_FLOAT)y0); | 1006 (FX_FLOAT)y0); |
| 1007 matrix = m_PageMatrix; | 1007 matrix = m_PageMatrix; |
| 1008 matrix.Concat(display_matrix); | 1008 matrix.Concat(display_matrix); |
| 1009 } | 1009 } |
| 1010 CPDF_ParseOptions::CPDF_ParseOptions() { | 1010 CPDF_ParseOptions::CPDF_ParseOptions() { |
| 1011 m_bTextOnly = FALSE; | 1011 m_bTextOnly = FALSE; |
| 1012 m_bMarkedContent = TRUE; | 1012 m_bMarkedContent = TRUE; |
| 1013 m_bSeparateForm = TRUE; | 1013 m_bSeparateForm = TRUE; |
| 1014 m_bDecodeInlineImage = FALSE; | 1014 m_bDecodeInlineImage = FALSE; |
| 1015 } | 1015 } |
| OLD | NEW |