Debug output.

This commit is contained in:
Michael R Sweet 2021-06-29 20:39:31 -04:00
parent 90c7591190
commit 4f6a7ab03f
No known key found for this signature in database
GPG Key ID: BE67C75EC81F3244
2 changed files with 11 additions and 4 deletions

View File

@ -1374,7 +1374,9 @@ pdfioFileCreateFontObjFromFile(
return (NULL); return (NULL);
} }
#ifndef DEBUG
pdfioDictSetName(cid2gid, "Filter", "FlateDecode"); pdfioDictSetName(cid2gid, "Filter", "FlateDecode");
#endif // !DEBUG
if ((cid2gid_obj = pdfioFileCreateObj(pdf, cid2gid)) == NULL) if ((cid2gid_obj = pdfioFileCreateObj(pdf, cid2gid)) == NULL)
{ {
@ -1382,7 +1384,11 @@ pdfioFileCreateFontObjFromFile(
return (NULL); return (NULL);
} }
#ifdef DEBUG
if ((st = pdfioObjCreateStream(cid2gid_obj, PDFIO_FILTER_NONE)) == NULL)
#else
if ((st = pdfioObjCreateStream(cid2gid_obj, PDFIO_FILTER_FLATE)) == NULL) if ((st = pdfioObjCreateStream(cid2gid_obj, PDFIO_FILTER_FLATE)) == NULL)
#endif // DEBUG
{ {
ttfDelete(font); ttfDelete(font);
return (NULL); return (NULL);
@ -1447,7 +1453,7 @@ pdfioFileCreateFontObjFromFile(
// CIDSystemInfo mapping to Adobe UCS2 v0 (Unicode) // CIDSystemInfo mapping to Adobe UCS2 v0 (Unicode)
pdfioDictSetString(sidict, "Registry", "Adobe"); pdfioDictSetString(sidict, "Registry", "Adobe");
pdfioDictSetString(sidict, "Ordering", "UCS2"); pdfioDictSetString(sidict, "Ordering", "Identity");
pdfioDictSetNumber(sidict, "Supplement", 0); pdfioDictSetNumber(sidict, "Supplement", 0);
// Then the dictionary for the CID base font... // Then the dictionary for the CID base font...
@ -1485,8 +1491,7 @@ pdfioFileCreateFontObjFromFile(
pdfioDictSetName(dict, "Subtype", "Type0"); pdfioDictSetName(dict, "Subtype", "Type0");
pdfioDictSetName(dict, "BaseFont", basefont); pdfioDictSetName(dict, "BaseFont", basefont);
pdfioDictSetArray(dict, "DescendantFonts", descendants); pdfioDictSetArray(dict, "DescendantFonts", descendants);
// pdfioDictSetName(dict, "Encoding", "Identity-H"); pdfioDictSetName(dict, "Encoding", "Identity-H");
pdfioDictSetName(dict, "Encoding", "UniCNS-UCS2-H");
if ((obj = pdfioFileCreateObj(pdf, dict)) == NULL) if ((obj = pdfioFileCreateObj(pdf, dict)) == NULL)
return (NULL); return (NULL);

View File

@ -1253,6 +1253,7 @@ write_font_test(pdfio_file_t *pdf, // I - PDF file
}; };
#if 0
if (unicode) if (unicode)
{ {
fputs("pdfioFileCreateFontObjFromFile(NotoSansJP-Regular.otf): ", stdout); fputs("pdfioFileCreateFontObjFromFile(NotoSansJP-Regular.otf): ", stdout);
@ -1262,9 +1263,10 @@ write_font_test(pdfio_file_t *pdf, // I - PDF file
return (1); return (1);
} }
else else
#endif // 0
{ {
fputs("pdfioFileCreateFontObjFromFile(OpenSans-Regular.ttf): ", stdout); fputs("pdfioFileCreateFontObjFromFile(OpenSans-Regular.ttf): ", stdout);
if ((opensans = pdfioFileCreateFontObjFromFile(pdf, "testfiles/OpenSans-Regular.ttf", false)) != NULL) if ((opensans = pdfioFileCreateFontObjFromFile(pdf, "testfiles/OpenSans-Regular.ttf", unicode)) != NULL)
puts("PASS"); puts("PASS");
else else
return (1); return (1);