Garbled text in Illustrator and Corel Draw
See original GitHub issueOpening 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 with 33 | 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:
var PDFDocument = require('pdfkit'),
fs = require('fs'),
doc = new PDFDocument()
doc.pipe(fs.createWriteStream('hello-pdfkit.pdf'))
doc.font('resources/assets/fonts/LT_21218.ttf')
.fontSize(12)
.text('Hello Wörld!', 25, 25)
doc.end()
Sample Code Prawn:
require "prawn"
Prawn::Document.generate("hello-prawn.pdf") do
font "resources/assets/fonts/LT_21218.ttf" do
text "Hello Wörld!"
end
end
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).
Issue Analytics
- State:
- Created 9 years ago
- Comments:12 (7 by maintainers)
Top GitHub Comments
fontkit was released in v0.8.0, and should fix this issue.
@devongovett have you find a solution? i really need it. 😦