Merge pull request #5634 from Snuffleupagus/cmap-0,0
Add support for TrueType (0, 0) cmap tables (issue 5501, issue 5574, and bug 1037973)
This commit is contained in:
		
						commit
						fb8200096b
					
				| @ -3175,7 +3175,11 @@ var Font = (function FontClosure() { | |||||||
|           var offset = font.getInt32() >>> 0; |           var offset = font.getInt32() >>> 0; | ||||||
|           var useTable = false; |           var useTable = false; | ||||||
| 
 | 
 | ||||||
|           if (platformId === 1 && encodingId === 0) { |           if (platformId === 0 && encodingId === 0) { | ||||||
|  |             useTable = true; | ||||||
|  |             // Continue the loop since there still may be a higher priority
 | ||||||
|  |             // table.
 | ||||||
|  |           } else if (platformId === 1 && encodingId === 0) { | ||||||
|             useTable = true; |             useTable = true; | ||||||
|             // Continue the loop since there still may be a higher priority
 |             // Continue the loop since there still may be a higher priority
 | ||||||
|             // table.
 |             // table.
 | ||||||
| @ -4148,6 +4152,12 @@ var Font = (function FontClosure() { | |||||||
|               } |               } | ||||||
|             } |             } | ||||||
|           } |           } | ||||||
|  |         } else if (cmapPlatformId === 0 && cmapEncodingId === 0) { | ||||||
|  |           // Default Unicode semantics, use the charcodes as is.
 | ||||||
|  |           for (i = 0; i < cmapMappingsLength; ++i) { | ||||||
|  |             charCodeToGlyphId[cmapMappings[i].charCode] = | ||||||
|  |               cmapMappings[i].glyphId; | ||||||
|  |           } | ||||||
|         } else { |         } else { | ||||||
|           // For (3, 0) cmap tables:
 |           // For (3, 0) cmap tables:
 | ||||||
|           // The charcode key being stored in charCodeToGlyphId is the lower
 |           // The charcode key being stored in charCodeToGlyphId is the lower
 | ||||||
|  | |||||||
							
								
								
									
										1
									
								
								test/pdfs/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								test/pdfs/.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -70,6 +70,7 @@ | |||||||
| !issue5291.pdf | !issue5291.pdf | ||||||
| !issue5421.pdf | !issue5421.pdf | ||||||
| !issue5470.pdf | !issue5470.pdf | ||||||
|  | !issue5501.pdf | ||||||
| !issue5599.pdf | !issue5599.pdf | ||||||
| !gradientfill.pdf | !gradientfill.pdf | ||||||
| !bug903856.pdf | !bug903856.pdf | ||||||
|  | |||||||
							
								
								
									
										
											BIN
										
									
								
								test/pdfs/issue5501.pdf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								test/pdfs/issue5501.pdf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| @ -499,6 +499,13 @@ | |||||||
|        "link": false, |        "link": false, | ||||||
|        "type": "eq" |        "type": "eq" | ||||||
|     }, |     }, | ||||||
|  |     {  "id": "issue5501", | ||||||
|  |        "file": "pdfs/issue5501.pdf", | ||||||
|  |        "md5": "55a60699728fc92f491a2d7d490474e4", | ||||||
|  |        "rounds": 1, | ||||||
|  |        "link": false, | ||||||
|  |        "type": "eq" | ||||||
|  |     }, | ||||||
|     {  "id": "issue5509", |     {  "id": "issue5509", | ||||||
|        "file": "pdfs/issue5509.pdf", |        "file": "pdfs/issue5509.pdf", | ||||||
|        "md5": "1975ef8db7355b1d691bc79d0749574b", |        "md5": "1975ef8db7355b1d691bc79d0749574b", | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user