-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DIsplay glyfs #6
Comments
Thanks for reports! I am investigating both |
only 160 symbols(160 =.128-32) |
Test code would be welcome, thanks! |
var Document = require('pdfjs');
var fs = require('fs');
var doc;
fs.readFile('open-sans.regular.ttf', function(err, b) {
if (err) throw err
doc = new Document(new Document.Font(b));
doc.text("абвгдеёжзийклмнопрстуфхцчшщъыьэюя АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ", {size: 12});
fs.writeFile(__dirname + '/test.pdf', doc.toString(), 'ascii')
}) when copy string from pdf file to another editor - all symbols visible. |
This is a tricky one... It seems, that embedded font subsets cannot contain glyphs with a code > 127. That is, I've to split such a subset into two. This fix will required some time. A workaround would be, to add a font multiple times, e.g. doc = new Document(new Document.Font(b));
doc.text("абвгдеёжзийклмнопрстуфхцчшщъыьэюя АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ", {size: 12})
doc.text("abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ", {
size: 12,
font: new Document.Font(b)
}) |
generate in itext file with above chars...
Encoding/Identity-H
result file: |
They are using CID fonts. Seems to be another possible solution. Thanks for |
Seems to work just fine! But I'll do some additional testing before releasing a new version to NPM. |
Thanks! Displayed fine. But copy-past to another application broken... |
I knew I forgot something 😉 But this is easy to fix |
Thanks all work fine! |
Unfortunately, it broke the text align option |
at the end have error with glyfs
"PЮocter&GambleW" - don't display correctly
only first 128 symbols embeded correctly from subsets...
The text was updated successfully, but these errors were encountered: