galkahana / HummusJS

Node.js module for high performance creation, modification and parsing of PDF files and streams
http://www.pdfhummus.com
Other
1.15k stars 170 forks source link

electron 2.0.7 cant open dfont #411

Closed julianhille closed 2 years ago

julianhille commented 5 years ago

On electron 2.0.7 (also tested 2.0.18) there is an issue with .dfont font types. This might be forwarded to pdfwriter im not sure though:

strace /home/ubuntu/.nvm/versions/node/v11.2.0/lib/node_modules/electron/dist/electron /home/ubuntu/.nvm/versions/node/v11.2.0/lib/node_modules/electron-mocha/lib/main.js ./tests/DFontTest.js
....
stat("/home/ubuntu/module", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/home/ubuntu/module/PDFRStreamForFile", 0x7ffc54cc5420) = -1 ENOENT (No such file or directory)
stat("/home/ubuntu/module/PDFRStreamForFile.js", {st_mode=S_IFREG|0644, st_size=1279, ...}) = 0
lstat("/home/ubuntu/module/PDFRStreamForFile.js", {st_mode=S_IFREG|0644, st_size=1279, ...}) = 0
open("/home/ubuntu/module/PDFRStreamForFile.js", O_RDONLY|O_CLOEXEC) = 64
fstat(64, {st_mode=S_IFREG|0644, st_size=1279, ...}) = 0
read(64, "var fs = require('fs');\n/*\n    P"..., 1279) = 1279
close(64)                               = 0
madvise(0x27f3c0d83000, 36864, MADV_DONTNEED) = 0
madvise(0x27f3c0d83000, 36864, MADV_DONTNEED) = 0
stat("/home/ubuntu/module", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/home/ubuntu/module/PDFRStreamForBuffer", 0x7ffc54cc5420) = -1 ENOENT (No such file or directory)
stat("/home/ubuntu/module/PDFRStreamForBuffer.js", {st_mode=S_IFREG|0644, st_size=1065, ...}) = 0
lstat("/home/ubuntu/module/PDFRStreamForBuffer.js", {st_mode=S_IFREG|0644, st_size=1065, ...}) = 0
open("/home/ubuntu/module/PDFRStreamForBuffer.js", O_RDONLY|O_CLOEXEC) = 64
fstat(64, {st_mode=S_IFREG|0644, st_size=1065, ...}) = 0
read(64, "/*\n    PDFRStreamForBuffer is an"..., 1065) = 1065
close(64)                               = 0
open("/home/ubuntu/module/tests/output/DFontTest.pdf", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 64
fstat(64, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
fstat(64, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
lseek(64, 0, SEEK_SET)                  = 0
open("/home/ubuntu/module/tests/TestMaterials/fonts/Courier.dfont", O_RDONLY) = 66
lseek(66, 0, SEEK_CUR)                  = 0
fstat(66, {st_mode=S_IFREG|0644, st_size=1342469, ...}) = 0
fstat(66, {st_mode=S_IFREG|0644, st_size=1342469, ...}) = 0
lseek(66, 1339392, SEEK_SET)            = 1339392
read(66, "\0\2\0\0\0\7\0\0\0\34\0\0\0000\0\0\0Z\0\0\0\204\0\0\0\214\0\0\0\234\0\10"..., 3077) = 3077
lseek(66, 0, SEEK_SET)                  = 0
lseek(66, 0, SEEK_SET)                  = 0
lseek(66, 0, SEEK_SET)                  = 0
read(66, "\0\0\1\0\0\24z\256\0\24y\256\0\0\1W\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 262144) = 262144
lseek(66, 0, SEEK_SET)                  = 0
lseek(66, 0, SEEK_SET)                  = 0
read(66, "\0\0\1\0\0\24z\256\0\24y\256\0\0\1W\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 262144) = 262144
lseek(66, 0, SEEK_SET)                  = 0
lseek(66, 0, SEEK_SET)                  = 0
read(66, "\0\0\1\0\0\24z\256\0\24y\256\0\0\1W\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 262144) = 262144
lseek(66, 0, SEEK_SET)                  = 0
read(66, "\0\0\1", 3)                   = 3
read(66, "\0\0\24z\256\0\24y\256\0\0\1W\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 262144) = 262144
lseek(66, 0, SEEK_SET)                  = 0
lseek(66, 0, SEEK_SET)                  = 0
read(66, "\0\0\1\0\0\24z\256\0\24y\256\0\0\1W\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 262144) = 262144
lseek(66, 0, SEEK_SET)                  = 0
lseek(66, 0, SEEK_SET)                  = 0
read(66, "\0\0\1\0\0\24z\256\0\24y\256\0\0\1W\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 262144) = 262144
lseek(66, 0, SEEK_SET)                  = 0
lseek(66, 0, SEEK_SET)                  = 0
read(66, "\0\0\1\0\0\24z\256\0\24y\256\0\0\1W\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 262144) = 262144
lseek(66, 0, SEEK_SET)                  = 0
lseek(66, 0, SEEK_SET)                  = 0
read(66, "\0\0\1\0\0\24z\256\0\24y\256\0\0\1W\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 262144) = 262144
lseek(66, 0, SEEK_SET)                  = 0
lseek(66, 0, SEEK_SET)                  = 0
read(66, "\0\0\1\0\0\24z\256\0\24y\256\0\0\1W\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 262144) = 262144
close(66)                               = 0
madvise(0x27f3c0df9000, 954368, MADV_DONTNEED) = 0
write(22, "  \33[31m  1) should complete with"..., 46    1) should complete without error
) = 46
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x27f3c0723608, FUTEX_WAKE_PRIVATE, 1) = 1
recvmsg(19, 0x7ffc54cc9850, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(27, 0x7ffc54cc9860, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=19, events=POLLIN}, {fd=20, events=POLLIN}, {fd=27, events=POLLIN}, {fd=35, events=POLLIN}], 4, 0) = 0 (Timeout)
recvmsg(27, 0x7ffc54cc9890, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(19, 0x7ffc54cc9850, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(27, 0x7ffc54cc9860, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=19, events=POLLIN}, {fd=20, events=POLLIN}, {fd=27, events=POLLIN}, {fd=35, events=POLLIN}], 4, 0) = 0 (Timeout)
recvmsg(27, 0x7ffc54cc9890, 0)          = -1 EAGAIN (Resource temporarily unavailable)
epoll_wait(9, [{EPOLLIN, {u32=12, u64=12}}], 1024, 0) = 1
read(12, "\2\0\0\0\0\0\0\0", 1024)      = 8
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x27f3c0723608, FUTEX_WAKE_PRIVATE, 1) = 1
recvmsg(19, 0x7ffc54cc9850, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(27, 0x7ffc54cc9860, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=19, events=POLLIN}, {fd=20, events=POLLIN}, {fd=27, events=POLLIN}, {fd=35, events=POLLIN}], 4, 0) = 0 (Timeout)
recvmsg(27, 0x7ffc54cc9890, 0)          = -1 EAGAIN (Resource temporarily unavailable)
madvise(0x27f3c0be0000, 20480, MADV_DONTNEED) = 0
epoll_wait(9, [{EPOLLIN, {u32=12, u64=12}}], 1024, 0) = 1
read(12, "\1\0\0\0\0\0\0\0", 1024)      = 8
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x27f3c0723608, FUTEX_WAKE_PRIVATE, 1) = 1
recvmsg(19, 0x7ffc54cc9850, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(27, 0x7ffc54cc9860, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=19, events=POLLIN}, {fd=20, events=POLLIN}, {fd=27, events=POLLIN}, {fd=35, events=POLLIN}], 4, 0) = 0 (Timeout)
recvmsg(27, 0x7ffc54cc9890, 0)          = -1 EAGAIN (Resource temporarily unavailable)
epoll_wait(9, [{EPOLLIN, {u32=12, u64=12}}], 1024, 0) = 1
read(12, "\1\0\0\0\0\0\0\0", 1024)      = 8
write(22, "\n", 1
)                      = 1
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x27f3c0723608, FUTEX_WAKE_PRIVATE, 1) = 1
epoll_wait(9, [{EPOLLIN, {u32=12, u64=12}}], 1024, 0) = 1
read(12, "\2\0\0\0\0\0\0\0", 1024)      = 8
write(22, "\n", 1
)                      = 1
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
write(22, "\33[92m \33[0m\33[32m 0 passing\33[0m\33[9"..., 47  0 passing (351ms)
) = 47
write(22, "\33[31m  1 failing\33[0m\n", 21  1 failing
) = 21
madvise(0x27f3c0d8d000, 147456, MADV_DONTNEED) = 0
write(22, "\n", 1
)                      = 1
madvise(0x27f3c0d8d000, 147456, MADV_DONTNEED) = 0
write(22, "\33[0m  1) DFontTest\n       should"..., 269  1) DFontTest
       should complete without error:
     TypeError: unable to create font object. verify that the target is an existing and supported font type (ttf,otf,type1,dfont,ttc)
      at Context.<anonymous> (tests/DFontTest.js:7:14)

) = 269
write(22, "\n", 1
)                      = 1
write(22, "\n", 1
)                      = 1
close(25)                               = 0
close(26)                               = 0
futex(0x27f3c07f797c, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x27f3c07f7978, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1
futex(0x27f3c07f7950, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c08453a0, FUTEX_WAKE_PRIVATE, 1) = 1
madvise(0x27f3c0d8d000, 147456, MADV_DONTNEED) = 0
pipe2([25, 26], O_CLOEXEC)              = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
read(7, "*", 1)                         = 1
rt_sigaction(SIGCHLD, {0x7f7b43d58340, ~[RTMIN RT_1], SA_RESTORER, 0x7f7b42956390}, NULL, 8) = 0
write(8, "*", 1)                        = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f7b43f99d50) = 18798
close(26)                               = 0
read(25, "", 4)                         = 0
close(25)                               = 0
futex(0x27f3c0723608, FUTEX_WAKE_PRIVATE, 1) = 1
recvmsg(19, 0x7ffc54cc9850, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(27, 0x7ffc54cc9860, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=19, events=POLLIN}, {fd=20, events=POLLIN}, {fd=27, events=POLLIN}, {fd=35, events=POLLIN}], 4, 0) = 0 (Timeout)
recvmsg(27, 0x7ffc54cc9890, 0)          = -1 EAGAIN (Resource temporarily unavailable)
gettid()                                = 18769
epoll_wait(9, [{EPOLLIN, {u32=12, u64=12}}], 1024, 0) = 1
read(12, "\2\0\0\0\0\0\0\0", 1024)      = 8
futex(0x27f3c0723608, FUTEX_WAKE_PRIVATE, 1) = 1
recvmsg(19, 0x7ffc54cc9850, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(27, 0x7ffc54cc9860, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=19, events=POLLIN}, {fd=20, events=POLLIN}, {fd=27, events=POLLIN}, {fd=35, events=POLLIN}], 4, 0) = 0 (Timeout)
recvmsg(27, 0x7ffc54cc9890, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(19, 0x7ffc54cc9850, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(27, 0x7ffc54cc9860, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=19, events=POLLIN}, {fd=20, events=POLLIN}, {fd=27, events=POLLIN}, {fd=35, events=POLLIN}], 4, 0) = 0 (Timeout)
recvmsg(27, 0x7ffc54cc9890, 0)          = -1 EAGAIN (Resource temporarily unavailable)
gettid()                                = 18769
gettid()                                = 18769
write(61, "\0", 1)                      = 1
gettid()                                = 18769
write(36, "!", 1)                       = 1
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
write(61, "\0", 1)                      = 1
futex(0x27f3c0971334, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x27f3c0971330, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1
futex(0x27f3c0971298, FUTEX_WAKE_PRIVATE, 1) = 1
gettid()                                = 18769
write(61, "\0", 1)                      = 1
gettid()                                = 18769
gettid()                                = 18769
futex(0x27f3c06ed9d8, FUTEX_WAKE_PRIVATE, 1) = 0
gettid()                                = 18769
gettid()                                = 18769
gettid()                                = 18769
futex(0x27f3c0c163a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x27f3c07f7260, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f7b28b899d0, FUTEX_WAIT, 18793, NULL) = 0
futex(0x7f7b29389abc, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f7b29389a90, 2) = 1
futex(0x7f7b29389a90, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c0830328, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f7b29389abc, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f7b29389a90, 2) = 1
futex(0x7f7b29389a90, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c0830328, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c08523f8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f7b29b8aabc, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f7b29b8aa90, 2) = 1
futex(0x7f7b29b8aa90, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c0830418, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f7b29b8aabc, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f7b29b8aa90, 2) = 1
futex(0x7f7b29b8aa90, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c0830418, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c0852388, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f7b2a38babc, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f7b2a38ba90, 2) = 1
futex(0x7f7b2a38ba90, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c0830508, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f7b2a38babc, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f7b2a38ba90, 2) = 1
futex(0x7f7b2a38ba90, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c0830508, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c08fc468, FUTEX_WAKE_PRIVATE, 1) = 1
gettid()                                = 18769
futex(0x7f7b2ab8cabc, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f7b2ab8ca90, 2) = 1
futex(0x7f7b2ab8ca90, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c0817b98, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f7b2ab8cabc, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f7b2ab8ca90, 2) = 1
futex(0x7f7b2ab8ca90, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c0817b98, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f7b2ab8cabc, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f7b2ab8ca90, 2) = 1
futex(0x7f7b2ab8ca90, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c0817b98, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c08524d8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f7b2b38dabc, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f7b2b38da90, 2) = 1
futex(0x7f7b2b38da90, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c0817c38, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f7b2b38dabc, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f7b2b38da90, 2) = 1
futex(0x7f7b2b38da90, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c0817c38, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c08fc548, FUTEX_WAKE_PRIVATE, 1) = 1
gettid()                                = 18769
futex(0x7f7b273e89fc, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f7b273e89d0, 2) = 1
futex(0x7f7b273e89d0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c0912828, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f7b273e89fc, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f7b273e89d0, 2) = 1
futex(0x7f7b273e89d0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c0912828, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x27f3c0b61934, FUTEX_WAKE_PRIVATE, 1) = 1
write(50, "\0", 1)                      = 1
write(50, "\0", 1)                      = 1
futex(0x27f3c0b615f4, FUTEX_WAKE_PRIVATE, 1) = 1
gettid()                                = 18769
gettid()                                = 18769
madvise(0x27f3c0cdd000, 20480, MADV_DONTNEED) = 0
madvise(0x27f3c0ad2000, 20480, MADV_DONTNEED) = 0
madvise(0x27f3c0bda000, 20480, MADV_DONTNEED) = 0
gettid()                                = 18769
gettid()                                = 18769
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
munmap(0x7f7b273ea000, 8392704)         = 0
write(20, "\1\0\0\0\0\0\0\0", 8)        = 8
write(41, "\0", 1)                      = 1
futex(0x27f3c08105f4, FUTEX_WAKE_PRIVATE, 1) = 1
munmap(0x7f7b28389000, 8392704)         = 0
write(20, "\1\0\0\0\0\0\0\0", 8)        = 8
close(35)                               = 0
close(36)                               = 0
madvise(0x27f3c0d4a000, 4096, MADV_DONTNEED) = 0
madvise(0x27f3c0c02000, 61440, MADV_DONTNEED) = 0
close(17)                               = 0
close(14)                               = 0
futex(0x7f7b333ec9d0, FUTEX_WAIT, 18771, NULL) = 0
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=18798, si_uid=1000, si_status=0, si_utime=11, si_stime=4} ---
read(7, "*", 1)                         = 1
write(11, "\200\21\343C{\177\0\0\21\0\0\0\0\0\0\0", 16) = 16
write(8, "*", 1)                        = 1
rt_sigreturn({mask=[]})                 = 0
munmap(0x7f7b26be9000, 8392704)         = 0
close(16)                               = 0
close(15)                               = 0
close(3)                                = 0
exit_group(1)                           = ?
+++ exited with 1 +++