mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2024-12-27 05:48:20 +01:00
Debug output.
This commit is contained in:
parent
90c7591190
commit
4f6a7ab03f
@ -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);
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user