| 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 "font_int.h" | 7 #include "font_int.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 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 face); | 1336 face); |
| 1337 } | 1337 } |
| 1338 } | 1338 } |
| 1339 } else { | 1339 } else { |
| 1340 rect = FX_RECT(0, 0, 0, 0); | 1340 rect = FX_RECT(0, 0, 0, 0); |
| 1341 } | 1341 } |
| 1342 if (m_pFontFile == NULL && m_Charset == CIDSET_JAPAN1) { | 1342 if (m_pFontFile == NULL && m_Charset == CIDSET_JAPAN1) { |
| 1343 FX_WORD CID = CIDFromCharCode(charcode); | 1343 FX_WORD CID = CIDFromCharCode(charcode); |
| 1344 const uint8_t* pTransform = GetCIDTransform(CID); | 1344 const uint8_t* pTransform = GetCIDTransform(CID); |
| 1345 if (pTransform && !bVert) { | 1345 if (pTransform && !bVert) { |
| 1346 CFX_AffineMatrix matrix(CIDTransformToFloat(pTransform[0]), | 1346 CFX_Matrix matrix(CIDTransformToFloat(pTransform[0]), |
| 1347 CIDTransformToFloat(pTransform[1]), | 1347 CIDTransformToFloat(pTransform[1]), |
| 1348 CIDTransformToFloat(pTransform[2]), | 1348 CIDTransformToFloat(pTransform[2]), |
| 1349 CIDTransformToFloat(pTransform[3]), | 1349 CIDTransformToFloat(pTransform[3]), |
| 1350 CIDTransformToFloat(pTransform[4]) * 1000, | 1350 CIDTransformToFloat(pTransform[4]) * 1000, |
| 1351 CIDTransformToFloat(pTransform[5]) * 1000); | 1351 CIDTransformToFloat(pTransform[5]) * 1000); |
| 1352 CFX_FloatRect rect_f(rect); | 1352 CFX_FloatRect rect_f(rect); |
| 1353 rect_f.Transform(&matrix); | 1353 rect_f.Transform(&matrix); |
| 1354 rect = rect_f.GetOutterRect(); | 1354 rect = rect_f.GetOutterRect(); |
| 1355 } | 1355 } |
| 1356 } | 1356 } |
| 1357 if (charcode < 256) { | 1357 if (charcode < 256) { |
| 1358 m_CharBBox[charcode].Bottom = (short)rect.bottom; | 1358 m_CharBBox[charcode].Bottom = (short)rect.bottom; |
| 1359 m_CharBBox[charcode].Left = (short)rect.left; | 1359 m_CharBBox[charcode].Left = (short)rect.left; |
| 1360 m_CharBBox[charcode].Right = (short)rect.right; | 1360 m_CharBBox[charcode].Right = (short)rect.right; |
| 1361 m_CharBBox[charcode].Top = (short)rect.top; | 1361 m_CharBBox[charcode].Top = (short)rect.top; |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1722 | 1722 |
| 1723 const uint8_t* CPDF_CIDFont::GetCIDTransform(FX_WORD CID) const { | 1723 const uint8_t* CPDF_CIDFont::GetCIDTransform(FX_WORD CID) const { |
| 1724 if (m_Charset != CIDSET_JAPAN1 || m_pFontFile) | 1724 if (m_Charset != CIDSET_JAPAN1 || m_pFontFile) |
| 1725 return nullptr; | 1725 return nullptr; |
| 1726 | 1726 |
| 1727 const struct CIDTransform* found = (const struct CIDTransform*)FXSYS_bsearch( | 1727 const struct CIDTransform* found = (const struct CIDTransform*)FXSYS_bsearch( |
| 1728 &CID, g_Japan1_VertCIDs, FX_ArraySize(g_Japan1_VertCIDs), | 1728 &CID, g_Japan1_VertCIDs, FX_ArraySize(g_Japan1_VertCIDs), |
| 1729 sizeof(g_Japan1_VertCIDs[0]), CompareCIDTransform); | 1729 sizeof(g_Japan1_VertCIDs[0]), CompareCIDTransform); |
| 1730 return found ? &found->a : nullptr; | 1730 return found ? &found->a : nullptr; |
| 1731 } | 1731 } |
| OLD | NEW |