Debug logging, work in progress for Unicode text support.

This commit is contained in:
Michael R Sweet 2023-10-07 12:05:18 -04:00
parent 59959bf0e5
commit ed88322496
No known key found for this signature in database
GPG Key ID: BE67C75EC81F3244
2 changed files with 6 additions and 3 deletions

View File

@ -136,7 +136,7 @@ install-shared:
# Test everything
test: testpdfio
./testpdfio
./testpdfio 2>test.log
valgrind: testpdfio
valgrind --leak-check=full ./testpdfio

View File

@ -1448,8 +1448,11 @@ pdfioFileCreateFontObjFromFile(
cmap = ttfGetCMap(font, &num_cmap);
PDFIO_DEBUG("pdfioFileCreateFontObjFromFile: num_cmap=%u\n", (unsigned)num_cmap);
for (i = 0, bufptr = buffer, bufend = buffer + sizeof(buffer); i < num_cmap; i ++)
{
PDFIO_DEBUG("pdfioFileCreateFontObjFromFile: cmap[%u]=%d\n", (unsigned)i, cmap[i]);
if (cmap[i] < 0)
{
// Map undefined glyph to .notdef...
@ -1505,7 +1508,7 @@ pdfioFileCreateFontObjFromFile(
// CIDSystemInfo mapping to Adobe UCS2 v0 (Unicode)
pdfioDictSetString(sidict, "Registry", "Adobe");
pdfioDictSetString(sidict, "Ordering", "Identity");
pdfioDictSetString(sidict, "Ordering", "Identity-H");
pdfioDictSetNumber(sidict, "Supplement", 0);
// Then the dictionary for the CID base font...
@ -2997,7 +3000,7 @@ write_string(pdfio_stream_t *st, // I - Stream
// Start the string...
if (!pdfioStreamPuts(st, unicode ? "<" : "("))
if (!pdfioStreamPuts(st, unicode ? "<FEFF" : "("))
return (false);
// Loop through the string, handling UTF-8 as needed...