Merge pull request #2562 from vyv03354/master
Fix a problem about Japanese PDFs without embedded fonts
This commit is contained in:
		
						commit
						5631e5ba54
					
				@ -791,6 +791,10 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
 | 
				
			|||||||
          };
 | 
					          };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        var cidEncoding = baseDict.get('Encoding');
 | 
				
			||||||
 | 
					        if (isName(cidEncoding))
 | 
				
			||||||
 | 
					          properties.cidEncoding = cidEncoding.name;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        var cidToGidMap = dict.get('CIDToGIDMap');
 | 
					        var cidToGidMap = dict.get('CIDToGIDMap');
 | 
				
			||||||
        if (isStream(cidToGidMap))
 | 
					        if (isStream(cidToGidMap))
 | 
				
			||||||
          properties.cidToGidMap = this.readCidToGidMap(cidToGidMap);
 | 
					          properties.cidToGidMap = this.readCidToGidMap(cidToGidMap);
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										13
									
								
								src/fonts.js
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								src/fonts.js
									
									
									
									
									
								
							@ -4126,6 +4126,15 @@ var Font = (function FontClosure() {
 | 
				
			|||||||
        } else
 | 
					        } else
 | 
				
			||||||
          cid++;
 | 
					          cid++;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      var cidEncoding = properties.cidEncoding;
 | 
				
			||||||
 | 
					      if (cidEncoding && cidEncoding.indexOf('Uni') === 0) {
 | 
				
			||||||
 | 
					        // input is already Unicode for Uni* CMap encodings.
 | 
				
			||||||
 | 
					        // However, Unicode-to-CID conversion is needed
 | 
				
			||||||
 | 
					        // regardless of the CMap encoding. So we can't reset
 | 
				
			||||||
 | 
					        // unicodeToCID.
 | 
				
			||||||
 | 
					        this.cidToUnicode = [];
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bindDOM: function Font_bindDOM() {
 | 
					    bindDOM: function Font_bindDOM() {
 | 
				
			||||||
@ -4205,16 +4214,12 @@ var Font = (function FontClosure() {
 | 
				
			|||||||
        case 'CIDFontType0':
 | 
					        case 'CIDFontType0':
 | 
				
			||||||
          if (this.noUnicodeAdaptation) {
 | 
					          if (this.noUnicodeAdaptation) {
 | 
				
			||||||
            width = this.widths[this.unicodeToCID[charcode] || charcode];
 | 
					            width = this.widths[this.unicodeToCID[charcode] || charcode];
 | 
				
			||||||
            fontCharCode = mapPrivateUseChars(charcode);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
          fontCharCode = this.toFontChar[charcode] || charcode;
 | 
					          fontCharCode = this.toFontChar[charcode] || charcode;
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
        case 'CIDFontType2':
 | 
					        case 'CIDFontType2':
 | 
				
			||||||
          if (this.noUnicodeAdaptation) {
 | 
					          if (this.noUnicodeAdaptation) {
 | 
				
			||||||
            width = this.widths[this.unicodeToCID[charcode] || charcode];
 | 
					            width = this.widths[this.unicodeToCID[charcode] || charcode];
 | 
				
			||||||
            fontCharCode = mapPrivateUseChars(charcode);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
          fontCharCode = this.toFontChar[charcode] || charcode;
 | 
					          fontCharCode = this.toFontChar[charcode] || charcode;
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										1
									
								
								test/pdfs/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								test/pdfs/.gitignore
									
									
									
									
										vendored
									
									
								
							@ -37,3 +37,4 @@
 | 
				
			|||||||
!basicapi.pdf
 | 
					!basicapi.pdf
 | 
				
			||||||
!mixedfonts.pdf
 | 
					!mixedfonts.pdf
 | 
				
			||||||
!shading_extend.pdf
 | 
					!shading_extend.pdf
 | 
				
			||||||
 | 
					!noembed-identity.pdf
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										
											BIN
										
									
								
								test/pdfs/noembed-identity.pdf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								test/pdfs/noembed-identity.pdf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							@ -795,5 +795,11 @@
 | 
				
			|||||||
      "md5": "9f11e815b485f7f0e1fa5c116c636cf9",
 | 
					      "md5": "9f11e815b485f7f0e1fa5c116c636cf9",
 | 
				
			||||||
      "rounds": 1,
 | 
					      "rounds": 1,
 | 
				
			||||||
      "type": "eq"
 | 
					      "type": "eq"
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    {  "id": "noembed-identity",
 | 
				
			||||||
 | 
					      "file": "pdfs/noembed-identity.pdf",
 | 
				
			||||||
 | 
					      "md5": "05d3803b6c22451e18cb60d8d8c75c0c",
 | 
				
			||||||
 | 
					      "rounds": 1,
 | 
				
			||||||
 | 
					      "type": "eq"
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user