Fix encoding of type1 private dictionary arrays.
This commit is contained in:
		
							parent
							
								
									04f6e17e11
								
							
						
					
					
						commit
						82eb374fad
					
				
							
								
								
									
										10
									
								
								src/fonts.js
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/fonts.js
									
									
									
									
									
								
							| @ -5616,7 +5616,15 @@ Type1Font.prototype = { | |||||||
|       var field = fields[i]; |       var field = fields[i]; | ||||||
|       if (!properties.privateData.hasOwnProperty(field)) |       if (!properties.privateData.hasOwnProperty(field)) | ||||||
|         continue; |         continue; | ||||||
|       privateDict.setByName(field, properties.privateData[field]); |       var value = properties.privateData[field]; | ||||||
|  |       if (isArray(value)) { | ||||||
|  |         // All of the private dictionary array data in CFF must be stored as
 | ||||||
|  |         // "delta-encoded" numbers.
 | ||||||
|  |         for (var j = value.length - 1; j > 0; j--) { | ||||||
|  |           value[j] -= value[j - 1]; // ... difference from previous value
 | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |       privateDict.setByName(field, value); | ||||||
|     } |     } | ||||||
|     cff.topDict.privateDict = privateDict; |     cff.topDict.privateDict = privateDict; | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user