| 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/src/fpdfapi/fpdf_page/pageint.h" | 7 #include "core/src/fpdfapi/fpdf_page/pageint.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 CPDF_CIDFont* pCIDFont = pFont->GetCIDFont(); | 239 CPDF_CIDFont* pCIDFont = pFont->GetCIDFont(); |
| 240 if (pCIDFont) { | 240 if (pCIDFont) { |
| 241 bVertWriting = pCIDFont->IsVertWriting(); | 241 bVertWriting = pCIDFont->IsVertWriting(); |
| 242 } | 242 } |
| 243 FX_FLOAT fontsize = m_TextState.GetFontSize(); | 243 FX_FLOAT fontsize = m_TextState.GetFontSize(); |
| 244 for (int i = 0; i < m_nChars; ++i) { | 244 for (int i = 0; i < m_nChars; ++i) { |
| 245 FX_DWORD charcode = | 245 FX_DWORD charcode = |
| 246 m_nChars == 1 ? (FX_DWORD)(uintptr_t)m_pCharCodes : m_pCharCodes[i]; | 246 m_nChars == 1 ? (FX_DWORD)(uintptr_t)m_pCharCodes : m_pCharCodes[i]; |
| 247 if (i > 0) { | 247 if (i > 0) { |
| 248 if (charcode == (FX_DWORD)-1) { | 248 if (charcode == (FX_DWORD)-1) { |
| 249 curpos -= FXSYS_Mul(m_pCharPos[i - 1], fontsize) / 1000; | 249 curpos -= (m_pCharPos[i - 1] * fontsize) / 1000; |
| 250 continue; | 250 continue; |
| 251 } | 251 } |
| 252 m_pCharPos[i - 1] = curpos; | 252 m_pCharPos[i - 1] = curpos; |
| 253 } | 253 } |
| 254 FX_RECT char_rect; | 254 FX_RECT char_rect; |
| 255 pFont->GetCharBBox(charcode, char_rect, level); | 255 pFont->GetCharBBox(charcode, char_rect, level); |
| 256 FX_FLOAT charwidth; | 256 FX_FLOAT charwidth; |
| 257 if (!bVertWriting) { | 257 if (!bVertWriting) { |
| 258 if (min_y > char_rect.top) { | 258 if (min_y > char_rect.top) { |
| 259 min_y = (FX_FLOAT)char_rect.top; | 259 min_y = (FX_FLOAT)char_rect.top; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 if (pTextAdvanceX) { | 329 if (pTextAdvanceX) { |
| 330 *pTextAdvanceX = 0; | 330 *pTextAdvanceX = 0; |
| 331 } | 331 } |
| 332 if (pTextAdvanceY) { | 332 if (pTextAdvanceY) { |
| 333 *pTextAdvanceY = curpos; | 333 *pTextAdvanceY = curpos; |
| 334 } | 334 } |
| 335 min_x = min_x * fontsize / 1000; | 335 min_x = min_x * fontsize / 1000; |
| 336 max_x = max_x * fontsize / 1000; | 336 max_x = max_x * fontsize / 1000; |
| 337 } else { | 337 } else { |
| 338 if (pTextAdvanceX) { | 338 if (pTextAdvanceX) { |
| 339 *pTextAdvanceX = FXSYS_Mul(curpos, horz_scale); | 339 *pTextAdvanceX = curpos * horz_scale; |
| 340 } | 340 } |
| 341 if (pTextAdvanceY) { | 341 if (pTextAdvanceY) { |
| 342 *pTextAdvanceY = 0; | 342 *pTextAdvanceY = 0; |
| 343 } | 343 } |
| 344 min_y = min_y * fontsize / 1000; | 344 min_y = min_y * fontsize / 1000; |
| 345 max_y = max_y * fontsize / 1000; | 345 max_y = max_y * fontsize / 1000; |
| 346 } | 346 } |
| 347 CFX_Matrix matrix; | 347 CFX_Matrix matrix; |
| 348 GetTextMatrix(&matrix); | 348 GetTextMatrix(&matrix); |
| 349 m_Left = min_x; | 349 m_Left = min_x; |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 matrix = m_PageMatrix; | 760 matrix = m_PageMatrix; |
| 761 matrix.Concat(display_matrix); | 761 matrix.Concat(display_matrix); |
| 762 } | 762 } |
| 763 | 763 |
| 764 CPDF_ParseOptions::CPDF_ParseOptions() { | 764 CPDF_ParseOptions::CPDF_ParseOptions() { |
| 765 m_bTextOnly = FALSE; | 765 m_bTextOnly = FALSE; |
| 766 m_bMarkedContent = TRUE; | 766 m_bMarkedContent = TRUE; |
| 767 m_bSeparateForm = TRUE; | 767 m_bSeparateForm = TRUE; |
| 768 m_bDecodeInlineImage = FALSE; | 768 m_bDecodeInlineImage = FALSE; |
| 769 } | 769 } |
| OLD | NEW |