Closed felixbuenemann closed 8 years ago
Interesting. Does this happen with all embedded fonts, or just that particular one? If it is just that font, can you send it to me privately for testing? My email is devongovett@gmail.com.
It happens with all TTF fonts I tested with: Univers, Droid Sans, The Sans. It also happens with the PDF from the PDFkit demo.
Screenshot:
@devongovett what are your plans about fixing it?
The root of this issue is the remapping of the glyphs to chars, since Illustrator use the installed font for editing and this font is not mapped the same way. I patched pdfkit not to remap the charMap, but now umlauts/compound glyphs not shown anymore. Any Ideas?
EDIT: it seems to be related to charCoder greater than 0x7F. If I change the encoding in subset.coffee to macroman, than it works.
Sorry about the delayed response. I'm working on a new font engine that should launch soon, using CID fonts. Some of that work is in the fontkit
branch. It's still experimental, but if you feel like trying that out to see if it fixes the problem, I'd appreciate it. I don't have access to Illustrator for testing, so it would be helpful. Thanks!
Are there instructions for installing the fontkit branch? I see the makefile, but I don't speak coffeescript or node, so it is not clear what dependencies I'd need to install to make it work.
@v-python just run npm install && make
and it should work ;)
@devongovett code on fontkit branch seems to work and fixes the problem. Can you tell the release date?
@denyskoch Thanks for the response... "npm install" gives a usage message "npm install pdfkit" gives me the non-fontkit version so I'm still missing something newbie of what goes where.
@v-python you need to checkout pdfkit by your own, because in npm-registry is only the compiled master version.
$ git clone -b fontkit https://github.com/devongovett/pdfkit.git
$ npm install && make
background:
in the packages.json are two(to be correct three) kinds of dependencies devDependencies
and dependencies
. devDependencies
are only installed if you run npm install
on the repository (if you checked out it) and dependencies
are installed when you install the package from npm registry (e.g. with npm install pdfkit
)
see: http://stackoverflow.com/a/22004559
@denyskoch Thanks for the helpful looking reply. Too late to try it tonight, but hopefully soon.
@devongovett have you find a solution? i really need it. :(
fontkit was released in v0.8.0, and should fix this issue.
Opening a PDFkit created PDF with embedded TTF subset in Illustrator CS6, CC or Corel Draw X7 shows the raw bytes used for the subsetting instead of the proper characters.
The text
Hello Wörld!
is shown as!"##$%&'(#)*
. This corresponds to the ASCII characters that would map to the bytes used by PDFkit for subsetting, beginning with33 | 0x21 | !
.Displaying in Mac Preview or Adobe Acrobat X is fine.
The embedded font is a TTF of Univers by Linotype, but the Problem happens with all TTF fonts I tried.
The issue does not occur, if a similar PDF is created using Prawn.
Sample Code PDFkit:
Sample Code Prawn:
Comparing the Prawn and PDFkit PDFs I noticed that they do subsetting/charmaps differently and that the font embedded by prawn has additional headers (prep, fpgm, cvt).