Merge pull request #2628 from mduan/issue2128
Add support for GBK-EUC-H encoding for cid fonts
This commit is contained in:
		
						commit
						8c78268a12
					
				| @ -410,7 +410,8 @@ var CMapConverterList = { | ||||
|   '90ms-RKSJ-H': sjisToUnicode, | ||||
|   '90ms-RKSJ-V': sjisToUnicode, | ||||
|   '90msp-RKSJ-H': sjisToUnicode, | ||||
|   '90msp-RKSJ-V': sjisToUnicode | ||||
|   '90msp-RKSJ-V': sjisToUnicode, | ||||
|   'GBK-EUC-H': gbkToUnicode | ||||
| }; | ||||
| 
 | ||||
| // CMaps using Hankaku (Halfwidth) Latin glyphs instead of proportional one.
 | ||||
| @ -428,6 +429,8 @@ var HalfwidthCMaps = { | ||||
| 
 | ||||
| var decodeBytes; | ||||
| if (typeof TextDecoder !== 'undefined') { | ||||
|   // The encodings supported by TextDecoder can be found at:
 | ||||
|   // http://encoding.spec.whatwg.org/#concept-encoding-get
 | ||||
|   decodeBytes = function(bytes, encoding) { | ||||
|     return new TextDecoder(encoding).decode(bytes); | ||||
|   }; | ||||
| @ -457,6 +460,10 @@ function sjisToUnicode(str) { | ||||
|   return decodeBytes(stringToBytes(str), 'shift_jis'); | ||||
| } | ||||
| 
 | ||||
| function gbkToUnicode(str) { | ||||
|   return decodeBytes(stringToBytes(str), 'gbk'); | ||||
| } | ||||
| 
 | ||||
| // Some characters, e.g. copyrightserif, mapped to the private use area and
 | ||||
| // might not be displayed using standard fonts. Mapping/hacking well-known chars
 | ||||
| // to the similar equivalents in the normal characters range.
 | ||||
|  | ||||
							
								
								
									
										1
									
								
								test/pdfs/issue2128.pdf.link
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								test/pdfs/issue2128.pdf.link
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | ||||
| http://www.bookcool.com/pdf/6/ts006006.pdf | ||||
| @ -44,6 +44,14 @@ | ||||
|        "rounds": 1, | ||||
|        "type": "eq" | ||||
|     }, | ||||
|     {  "id": "issue2128", | ||||
|        "file": "pdfs/issue2128.pdf", | ||||
|        "md5": "b3f4d9ed3c41e1f1768264a3f8b93aad", | ||||
|        "link": true, | ||||
|        "pageLimit": 2, | ||||
|        "rounds": 1, | ||||
|        "type": "eq" | ||||
|     }, | ||||
|     {  "id": "pdfspec-load", | ||||
|        "file": "pdfs/pdf.pdf", | ||||
|        "md5": "dbdb23c939d2be09b43126c3c56060c7", | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user