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 "../fpdf_page/pageint.h" | 9 #include "core/src/fpdfapi/fpdf_page/pageint.h" |
10 #include "core/include/fpdfapi/fpdf_module.h" | 10 #include "core/include/fpdfapi/fpdf_module.h" |
11 #include "core/include/fpdfapi/fpdf_page.h" | 11 #include "core/include/fpdfapi/fpdf_page.h" |
12 #include "core/include/fpdfapi/fpdf_pageobj.h" | 12 #include "core/include/fpdfapi/fpdf_pageobj.h" |
13 #include "core/include/fpdfapi/fpdf_resource.h" | 13 #include "core/include/fpdfapi/fpdf_resource.h" |
14 #include "core/include/fxge/fx_freetype.h" | 14 #include "core/include/fxge/fx_freetype.h" |
15 | 15 |
| 16 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
| 17 #include "core/src/fxge/apple/apple_int.h" |
| 18 #endif |
| 19 |
16 FX_BOOL FT_UseTTCharmap(FXFT_Face face, int platform_id, int encoding_id) { | 20 FX_BOOL FT_UseTTCharmap(FXFT_Face face, int platform_id, int encoding_id) { |
17 for (int i = 0; i < FXFT_Get_Face_CharmapCount(face); i++) { | 21 for (int i = 0; i < FXFT_Get_Face_CharmapCount(face); i++) { |
18 if (FXFT_Get_Charmap_PlatformID(FXFT_Get_Face_Charmaps(face)[i]) == | 22 if (FXFT_Get_Charmap_PlatformID(FXFT_Get_Face_Charmaps(face)[i]) == |
19 platform_id && | 23 platform_id && |
20 FXFT_Get_Charmap_EncodingID(FXFT_Get_Face_Charmaps(face)[i]) == | 24 FXFT_Get_Charmap_EncodingID(FXFT_Get_Face_Charmaps(face)[i]) == |
21 encoding_id) { | 25 encoding_id) { |
22 FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[i]); | 26 FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[i]); |
23 return TRUE; | 27 return TRUE; |
24 } | 28 } |
25 } | 29 } |
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 return FALSE; | 1046 return FALSE; |
1043 } | 1047 } |
1044 if (FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[0]) == | 1048 if (FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[0]) == |
1045 FXFT_ENCODING_UNICODE) { | 1049 FXFT_ENCODING_UNICODE) { |
1046 FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[1]); | 1050 FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[1]); |
1047 } else { | 1051 } else { |
1048 FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[0]); | 1052 FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[0]); |
1049 } | 1053 } |
1050 return TRUE; | 1054 return TRUE; |
1051 } | 1055 } |
1052 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | |
1053 #include "../../fxge/apple/apple_int.h" | |
1054 #endif | |
1055 int CPDF_Type1Font::GlyphFromCharCodeExt(FX_DWORD charcode) { | 1056 int CPDF_Type1Font::GlyphFromCharCodeExt(FX_DWORD charcode) { |
1056 if (charcode > 0xff) { | 1057 if (charcode > 0xff) { |
1057 return -1; | 1058 return -1; |
1058 } | 1059 } |
1059 int index = m_ExtGID[(uint8_t)charcode]; | 1060 int index = m_ExtGID[(uint8_t)charcode]; |
1060 if (index == 0xffff) { | 1061 if (index == 0xffff) { |
1061 return -1; | 1062 return -1; |
1062 } | 1063 } |
1063 return index; | 1064 return index; |
1064 } | 1065 } |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1788 rect = pChar->m_BBox; | 1789 rect = pChar->m_BBox; |
1789 } | 1790 } |
1790 | 1791 |
1791 CPDF_Type3Char::CPDF_Type3Char(CPDF_Form* pForm) | 1792 CPDF_Type3Char::CPDF_Type3Char(CPDF_Form* pForm) |
1792 : m_pForm(pForm), m_pBitmap(nullptr), m_bColored(FALSE) {} | 1793 : m_pForm(pForm), m_pBitmap(nullptr), m_bColored(FALSE) {} |
1793 | 1794 |
1794 CPDF_Type3Char::~CPDF_Type3Char() { | 1795 CPDF_Type3Char::~CPDF_Type3Char() { |
1795 delete m_pForm; | 1796 delete m_pForm; |
1796 delete m_pBitmap; | 1797 delete m_pBitmap; |
1797 } | 1798 } |
OLD | NEW |