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 "xfa/fgas/layout/fgas_textbreak.h" | 7 #include "xfa/fgas/layout/fgas_textbreak.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1432 rtBBox.Reset(); | 1432 rtBBox.Reset(); |
1433 if (pFont->GetCharBBox(wForm, rtBBox, FALSE)) { | 1433 if (pFont->GetCharBBox(wForm, rtBBox, FALSE)) { |
1434 pCharPos->m_OriginY = | 1434 pCharPos->m_OriginY = |
1435 fYBase + fFontSize - | 1435 fYBase + fFontSize - |
1436 fFontSize * (FX_FLOAT)rtBBox.height / (FX_FLOAT)iMaxHeight; | 1436 fFontSize * (FX_FLOAT)rtBBox.height / (FX_FLOAT)iMaxHeight; |
1437 } | 1437 } |
1438 if (wForm == wch && wLast != 0xFEFF) { | 1438 if (wForm == wch && wLast != 0xFEFF) { |
1439 uint32_t dwLastProps = FX_GetUnicodeProperties(wLast); | 1439 uint32_t dwLastProps = FX_GetUnicodeProperties(wLast); |
1440 if ((dwLastProps & FX_CHARTYPEBITSMASK) == | 1440 if ((dwLastProps & FX_CHARTYPEBITSMASK) == |
1441 FX_CHARTYPE_Combination) { | 1441 FX_CHARTYPE_Combination) { |
1442 CFX_Rect rtBBox; | 1442 CFX_Rect rtBox; |
1443 rtBBox.Reset(); | 1443 rtBox.Reset(); |
1444 if (pFont->GetCharBBox(wLast, rtBBox, FALSE)) { | 1444 if (pFont->GetCharBBox(wLast, rtBox, FALSE)) { |
1445 pCharPos->m_OriginY -= fFontSize * rtBBox.height / iMaxHeight; | 1445 pCharPos->m_OriginY -= fFontSize * rtBox.height / iMaxHeight; |
1446 } | 1446 } |
1447 } | 1447 } |
1448 } | 1448 } |
1449 } | 1449 } |
1450 CFX_PointF ptOffset; | 1450 CFX_PointF ptOffset; |
1451 FX_BOOL bAdjusted = FALSE; | 1451 FX_BOOL bAdjusted = FALSE; |
1452 if (pAdjustPos) { | 1452 if (pAdjustPos) { |
1453 bAdjusted = pAdjustPos(wForm, bCharCode, pFont, fFontSize, | 1453 bAdjusted = pAdjustPos(wForm, bCharCode, pFont, fFontSize, |
1454 bVerticalChar, ptOffset); | 1454 bVerticalChar, ptOffset); |
1455 } | 1455 } |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1652 rtBBoxF.height = fHeight; | 1652 rtBBoxF.height = fHeight; |
1653 rtBBoxF.top = std::max(rtBBoxF.top, 0.0f); | 1653 rtBBoxF.top = std::max(rtBBoxF.top, 0.0f); |
1654 } | 1654 } |
1655 rtArray.SetAt(i, rtBBoxF); | 1655 rtArray.SetAt(i, rtBBoxF); |
1656 continue; | 1656 continue; |
1657 } | 1657 } |
1658 rtArray.SetAt(i, rect); | 1658 rtArray.SetAt(i, rect); |
1659 } | 1659 } |
1660 return iLength; | 1660 return iLength; |
1661 } | 1661 } |
OLD | NEW |