Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: core/fpdfdoc/ctypeset.cpp

Issue 2337973004: Wordstyle not being used to calculate word width (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfdoc/cpdf_variabletext.cpp ('k') | core/fpdfdoc/include/cpdf_variabletext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « core/fpdfdoc/cpdf_variabletext.cpp ('k') | core/fpdfdoc/include/cpdf_variabletext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698