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 <limits.h> | 7 #include <limits.h> |
8 | 8 |
9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
10 #include "core/fpdfapi/fpdf_page/pageint.h" | 10 #include "core/fpdfapi/fpdf_page/pageint.h" |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 pBaseDict->SetAtName("Subtype", "TrueType"); | 917 pBaseDict->SetAtName("Subtype", "TrueType"); |
918 pBaseDict->SetAtName("BaseFont", basefont); | 918 pBaseDict->SetAtName("BaseFont", basefont); |
919 pBaseDict->SetAtNumber("FirstChar", 32); | 919 pBaseDict->SetAtNumber("FirstChar", 32); |
920 pBaseDict->SetAtNumber("LastChar", 255); | 920 pBaseDict->SetAtNumber("LastChar", 255); |
921 pBaseDict->SetAt("Widths", pWidths); | 921 pBaseDict->SetAt("Widths", pWidths); |
922 } else { | 922 } else { |
923 flags |= PDFFONT_NONSYMBOLIC; | 923 flags |= PDFFONT_NONSYMBOLIC; |
924 pFontDict = new CPDF_Dictionary; | 924 pFontDict = new CPDF_Dictionary; |
925 CFX_ByteString cmap; | 925 CFX_ByteString cmap; |
926 CFX_ByteString ordering; | 926 CFX_ByteString ordering; |
927 int supplement; | 927 int supplement = 0; |
928 CPDF_Array* pWidthArray = new CPDF_Array; | 928 CPDF_Array* pWidthArray = new CPDF_Array; |
929 switch (charset) { | 929 switch (charset) { |
930 case FXFONT_CHINESEBIG5_CHARSET: | 930 case FXFONT_CHINESEBIG5_CHARSET: |
931 cmap = bVert ? "ETenms-B5-V" : "ETenms-B5-H"; | 931 cmap = bVert ? "ETenms-B5-V" : "ETenms-B5-H"; |
932 ordering = "CNS1"; | 932 ordering = "CNS1"; |
933 supplement = 4; | 933 supplement = 4; |
934 pWidthArray->AddInteger(1); | 934 pWidthArray->AddInteger(1); |
935 _InsertWidthArray1(pFont, pEncoding.get(), 0x20, 0x7e, pWidthArray); | 935 _InsertWidthArray1(pFont, pEncoding.get(), 0x20, 0x7e, pWidthArray); |
936 break; | 936 break; |
937 case FXFONT_GB2312_CHARSET: | 937 case FXFONT_GB2312_CHARSET: |
938 cmap = bVert ? "GBK-EUC-V" : "GBK-EUC-H"; | 938 cmap = bVert ? "GBK-EUC-V" : "GBK-EUC-H"; |
939 ordering = "GB1", supplement = 2; | 939 ordering = "GB1"; |
| 940 supplement = 2; |
940 pWidthArray->AddInteger(7716); | 941 pWidthArray->AddInteger(7716); |
941 _InsertWidthArray1(pFont, pEncoding.get(), 0x20, 0x20, pWidthArray); | 942 _InsertWidthArray1(pFont, pEncoding.get(), 0x20, 0x20, pWidthArray); |
942 pWidthArray->AddInteger(814); | 943 pWidthArray->AddInteger(814); |
943 _InsertWidthArray1(pFont, pEncoding.get(), 0x21, 0x7e, pWidthArray); | 944 _InsertWidthArray1(pFont, pEncoding.get(), 0x21, 0x7e, pWidthArray); |
944 break; | 945 break; |
945 case FXFONT_HANGEUL_CHARSET: | 946 case FXFONT_HANGEUL_CHARSET: |
946 cmap = bVert ? "KSCms-UHC-V" : "KSCms-UHC-H"; | 947 cmap = bVert ? "KSCms-UHC-V" : "KSCms-UHC-H"; |
947 ordering = "Korea1"; | 948 ordering = "Korea1"; |
948 supplement = 2; | 949 supplement = 2; |
949 pWidthArray->AddInteger(1); | 950 pWidthArray->AddInteger(1); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, | 1148 void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, |
1148 const CFX_ByteStringC& name) { | 1149 const CFX_ByteStringC& name) { |
1149 if (pPageDict->KeyExist(name)) { | 1150 if (pPageDict->KeyExist(name)) { |
1150 return; | 1151 return; |
1151 } | 1152 } |
1152 CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name); | 1153 CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name); |
1153 if (pObj) { | 1154 if (pObj) { |
1154 pPageDict->SetAt(name, pObj->Clone()); | 1155 pPageDict->SetAt(name, pObj->Clone()); |
1155 } | 1156 } |
1156 } | 1157 } |
OLD | NEW |