Skip to content
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

Kernings and trackings of vertical texts are incorrect #6387

Closed
hakatashi opened this issue Aug 27, 2015 · 4 comments · Fixed by #6391
Closed

Kernings and trackings of vertical texts are incorrect #6387

hakatashi opened this issue Aug 27, 2015 · 4 comments · Fixed by #6391

Comments

@hakatashi
Copy link

From my observation, kernings and trackings of vertical texts (in Japanese) are incorrect.

Test PDF: pdfjs-issue.pdf
(Generated by Adobe Illustrator CC pdfjs-issue.ai)

Adobe Acrobat Pro DC 2015.008.20082:
2015-08-27 15_21_43-pdfjs-issue pdf - adobe acrobat pro dc

PDF.JS (of Firefox 40.0 Stable):
2015-08-27 15_22_14-pdfjs-issue - pdfjs-issue pdf

Preceding screenshots are taken in Windows 10 Japanese. OS X may have the same error.

@CodingFabian
Copy link
Contributor

Thank you @hakatashi - I found the reason and have written a fix. can we use your pdf as regression test?

@hakatashi
Copy link
Author

Absolutely no problem, if you don't mind the embedded font, Noto Sans CJK JP, are licensed under Apache license 2.0.
Anyway, thank you for your quick reply and fix!

CodingFabian added a commit to CodingFabian/pdf.js that referenced this issue Aug 28, 2015
According to the PDF spec, a positive value means in horizontal, that
the next glyph is further to the left (so narrower), and in vertical that
it is further down (so wider).
This change fixes the way PDF.js has interpreted the value.
@Snuffleupagus
Copy link
Collaborator

This issue is a regression from PR #4832.

CodingFabian added a commit to CodingFabian/pdf.js that referenced this issue Aug 28, 2015
According to the PDF spec 5.3.2, a positive value means in horizontal,
that the next glyph is further to the left (so narrower), and in
vertical that it is further down (so wider).
This change fixes the way PDF.js has interpreted the value.
@CodingFabian
Copy link
Contributor

I tried to fix that, it also applies to the text layer size (which i noticed is offset in this document as well)

the fix is to use the vertical info to change the multiplication sign.

PS: Am I the only one who thinks the spec doesnt make sense? why will a positive value make the text narrow on horizontal, but wider on vertical?

CodingFabian added a commit to CodingFabian/pdf.js that referenced this issue Aug 28, 2015
According to the PDF spec 5.3.2, a positive value means in horizontal,
that the next glyph is further to the left (so narrower), and in
vertical that it is further down (so wider).
This change fixes the way PDF.js has interpreted the value.
CodingFabian added a commit to CodingFabian/pdf.js that referenced this issue Aug 28, 2015
According to the PDF spec 5.3.2, a positive value means in horizontal,
that the next glyph is further to the left (so narrower), and in
vertical that it is further down (so wider).
This change fixes the way PDF.js has interpreted the value.
CodingFabian added a commit to CodingFabian/pdf.js that referenced this issue Aug 30, 2015
According to the PDF spec 5.3.2, a positive value means in horizontal,
that the next glyph is further to the left (so narrower), and in
vertical that it is further down (so wider).
This change fixes the way PDF.js has interpreted the value.
CodingFabian added a commit to CodingFabian/pdf.js that referenced this issue Aug 31, 2015
According to the PDF spec 5.3.2, a positive value means in horizontal,
that the next glyph is further to the left (so narrower), and in
vertical that it is further down (so wider).
This change fixes the way PDF.js has interpreted the value.
CodingFabian added a commit to CodingFabian/pdf.js that referenced this issue Sep 15, 2015
According to the PDF spec 5.3.2, a positive value means in horizontal,
that the next glyph is further to the left (so narrower), and in
vertical that it is further down (so wider).
This change fixes the way PDF.js has interpreted the value.
brendandahl added a commit that referenced this issue Sep 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants