mirror of
				https://github.com/michaelrsweet/pdfio.git
				synced 2025-10-31 02:15:48 +01:00 
			
		
		
		
	Fiddle with Unicode support some more.
This commit is contained in:
		| @@ -1451,6 +1451,7 @@ pdfioFileCreateFontObjFromFile( | ||||
|     pdfioDictSetName(type2, "BaseFont", basefont); | ||||
|     pdfioDictSetDict(type2, "CIDSystemInfo", sidict); | ||||
|     pdfioDictSetObj(type2, "CIDToGIDMap", cid2gid_obj); | ||||
| //    pdfioDictSetName(type2, "CIDToGIDMap", "Identity"); | ||||
|     pdfioDictSetObj(type2, "FontDescriptor", desc_obj); | ||||
|  | ||||
|     if ((type2_obj = pdfioFileCreateObj(pdf, type2)) == NULL) | ||||
|   | ||||
							
								
								
									
										17
									
								
								testpdfio.c
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								testpdfio.c
									
									
									
									
									
								
							| @@ -1095,6 +1095,7 @@ write_font_test(pdfio_file_t *pdf,	// I - PDF file | ||||
|   pdfio_dict_t		*dict;		// Page dictionary | ||||
|   pdfio_stream_t	*st;		// Page contents stream | ||||
|   pdfio_obj_t		*opensans;	// OpenSans-Regular font | ||||
|   bool			unicode;	// Unicode? | ||||
|   int			i;		// Looping var | ||||
|   static const char * const welcomes[] =// "Welcome" in many languages | ||||
|   { | ||||
| @@ -1248,12 +1249,24 @@ write_font_test(pdfio_file_t *pdf,	// I - PDF file | ||||
|     "Ngiyakwemukela\n" | ||||
|   }; | ||||
|  | ||||
|  | ||||
|   unicode = true; | ||||
|  | ||||
| #if 1 | ||||
|   fputs("pdfioFileCreateFontObjFromFile(OpenSans-Regular.ttf): ", stdout); | ||||
|   if ((opensans = pdfioFileCreateFontObjFromFile(pdf, "testfiles/OpenSans-Regular.ttf", true)) != NULL) | ||||
|   if ((opensans = pdfioFileCreateFontObjFromFile(pdf, "testfiles/OpenSans-Regular.ttf", unicode)) != NULL) | ||||
|     puts("PASS"); | ||||
|   else | ||||
|     return (1); | ||||
|  | ||||
| #else | ||||
|   fputs("pdfioFileCreateFontObjFromFile(NotoSansJP-Regular.otf): ", stdout); | ||||
|   if ((opensans = pdfioFileCreateFontObjFromFile(pdf, "testfiles/NotoSansJP-Regular.otf", unicode)) != NULL) | ||||
|     puts("PASS"); | ||||
|   else | ||||
|     return (1); | ||||
| #endif // 1 | ||||
|  | ||||
|   fputs("pdfioDictCreate: ", stdout); | ||||
|   if ((dict = pdfioDictCreate(pdf)) != NULL) | ||||
|     puts("PASS"); | ||||
| @@ -1318,7 +1331,7 @@ write_font_test(pdfio_file_t *pdf,	// I - PDF file | ||||
|     } | ||||
|  | ||||
|     printf("pdfioContentTextShow(\"%s\"): ", welcomes[i]); | ||||
|     if (pdfioContentTextShow(st, true, welcomes[i])) | ||||
|     if (pdfioContentTextShow(st, unicode, welcomes[i])) | ||||
|       puts("PASS"); | ||||
|     else | ||||
|       return (1); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user