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/fpdfdoc/ctypeset.h" | 7 #include "core/fpdfdoc/ctypeset.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 fLineDescent = std::min(fLineDescent, m_pVT->GetWordDescent(*pWord)); | 305 fLineDescent = std::min(fLineDescent, m_pVT->GetWordDescent(*pWord)); |
306 fWordWidth = m_pVT->GetWordWidth(*pWord); | 306 fWordWidth = m_pVT->GetWordWidth(*pWord); |
307 } else { | 307 } else { |
308 fLineAscent = | 308 fLineAscent = |
309 std::max(fLineAscent, m_pVT->GetWordAscent(*pWord, fFontSize)); | 309 std::max(fLineAscent, m_pVT->GetWordAscent(*pWord, fFontSize)); |
310 fLineDescent = | 310 fLineDescent = |
311 std::min(fLineDescent, m_pVT->GetWordDescent(*pWord, fFontSize)); | 311 std::min(fLineDescent, m_pVT->GetWordDescent(*pWord, fFontSize)); |
312 fWordWidth = m_pVT->GetWordWidth( | 312 fWordWidth = m_pVT->GetWordWidth( |
313 pWord->nFontIndex, pWord->Word, m_pVT->m_wSubWord, | 313 pWord->nFontIndex, pWord->Word, m_pVT->m_wSubWord, |
314 m_pVT->m_fCharSpace, m_pVT->m_nHorzScale, fFontSize, | 314 m_pVT->m_fCharSpace, m_pVT->m_nHorzScale, fFontSize, |
315 pWord->fWordTail, 0); | 315 pWord->fWordTail); |
316 } | 316 } |
317 if (!bOpened) { | 317 if (!bOpened) { |
318 if (IsOpenStylePunctuation(pWord->Word)) { | 318 if (IsOpenStylePunctuation(pWord->Word)) { |
319 bOpened = TRUE; | 319 bOpened = TRUE; |
320 bFullWord = TRUE; | 320 bFullWord = TRUE; |
321 } else if (pOldWord) { | 321 } else if (pOldWord) { |
322 if (NeedDivision(pOldWord->Word, pWord->Word)) { | 322 if (NeedDivision(pOldWord->Word, pWord->Word)) { |
323 bFullWord = TRUE; | 323 bFullWord = TRUE; |
324 } | 324 } |
325 } | 325 } |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 } | 484 } |
485 fPosX += m_pVT->GetWordWidth(*pWord); | 485 fPosX += m_pVT->GetWordWidth(*pWord); |
486 } | 486 } |
487 } | 487 } |
488 fPosY -= pLine->m_LineInfo.fLineDescent; | 488 fPosY -= pLine->m_LineInfo.fLineDescent; |
489 } | 489 } |
490 } | 490 } |
491 } | 491 } |
492 m_rcRet = CPVT_FloatRect(fMinX, fMinY, fMaxX, fMaxY); | 492 m_rcRet = CPVT_FloatRect(fMinX, fMinY, fMaxX, fMaxY); |
493 } | 493 } |
OLD | NEW |