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_font/font_int.h" | 7 #include "core/src/fpdfapi/fpdf_font/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 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1538 return charcode == 0 ? -1 : (int)charcode; | 1538 return charcode == 0 ? -1 : (int)charcode; |
1539 } | 1539 } |
1540 if (index == 0 || index == 0xffff) { | 1540 if (index == 0 || index == 0xffff) { |
1541 return charcode == 0 ? -1 : (int)charcode; | 1541 return charcode == 0 ? -1 : (int)charcode; |
1542 } | 1542 } |
1543 return index; | 1543 return index; |
1544 } | 1544 } |
1545 if (m_Charset == CIDSET_JAPAN1) { | 1545 if (m_Charset == CIDSET_JAPAN1) { |
1546 if (unicode == '\\') { | 1546 if (unicode == '\\') { |
1547 unicode = '/'; | 1547 unicode = '/'; |
| 1548 #if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ |
| 1549 } else if (unicode == 0xa5) { |
| 1550 unicode = 0x5c; |
| 1551 #endif |
1548 } | 1552 } |
1549 #if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ | |
1550 else if (unicode == 0xa5) { | |
1551 unicode = 0x5c; | |
1552 } | |
1553 #endif | |
1554 } | 1553 } |
1555 if (!face) | 1554 if (!face) |
1556 return unicode; | 1555 return unicode; |
1557 | 1556 |
1558 int err = FXFT_Select_Charmap(face, FXFT_ENCODING_UNICODE); | 1557 int err = FXFT_Select_Charmap(face, FXFT_ENCODING_UNICODE); |
1559 if (err != 0) { | 1558 if (err != 0) { |
1560 int i; | 1559 int i; |
1561 for (i = 0; i < FXFT_Get_Face_CharmapCount(face); i++) { | 1560 for (i = 0; i < FXFT_Get_Face_CharmapCount(face); i++) { |
1562 FX_DWORD ret = FT_CharCodeFromUnicode( | 1561 FX_DWORD ret = FT_CharCodeFromUnicode( |
1563 FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[i]), | 1562 FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[i]), |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1731 | 1730 |
1732 const uint8_t* CPDF_CIDFont::GetCIDTransform(FX_WORD CID) const { | 1731 const uint8_t* CPDF_CIDFont::GetCIDTransform(FX_WORD CID) const { |
1733 if (m_Charset != CIDSET_JAPAN1 || m_pFontFile) | 1732 if (m_Charset != CIDSET_JAPAN1 || m_pFontFile) |
1734 return nullptr; | 1733 return nullptr; |
1735 | 1734 |
1736 const struct CIDTransform* found = (const struct CIDTransform*)FXSYS_bsearch( | 1735 const struct CIDTransform* found = (const struct CIDTransform*)FXSYS_bsearch( |
1737 &CID, g_Japan1_VertCIDs, FX_ArraySize(g_Japan1_VertCIDs), | 1736 &CID, g_Japan1_VertCIDs, FX_ArraySize(g_Japan1_VertCIDs), |
1738 sizeof(g_Japan1_VertCIDs[0]), CompareCIDTransform); | 1737 sizeof(g_Japan1_VertCIDs[0]), CompareCIDTransform); |
1739 return found ? &found->a : nullptr; | 1738 return found ? &found->a : nullptr; |
1740 } | 1739 } |
OLD | NEW |