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

Fix text spacing with vertical fonts (#6387) #6391

Merged
merged 1 commit into from
Sep 15, 2015

Conversation

CodingFabian
Copy link
Contributor

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.

Fixes #6387.

"md5": "08c39ac6d0aab1596e6e59793eaf3ee4",
"rounds": 1,
"type": "eq"
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this patch fixes the textLayer as well, how about also adding a text test, since we currently don't have that many of those, e.g.

{  "id": "issue6387-text",
   "file": "pdfs/issue6387.pdf",
   "md5": "08c39ac6d0aab1596e6e59793eaf3ee4",
   "rounds": 1,
   "type": "text"
},

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a second block in addition, or can i mark a test as eq and text?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll have to add another block, since there isn't support for specifying multiple types for one test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@CodingFabian CodingFabian force-pushed the fix-vertical-kernings-6387 branch 2 times, most recently from 38e1297 to 8a8f6d6 Compare August 28, 2015 20:52
"rounds": 1,
"type": "eq"
},
{ "id": "issue6387",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ids must be unique, otherwise the reference image for the second test will replace the first one and thus cause test failures. Please change it to "id": "issue6387-text".

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/7518aedf6938602/output.txt

@timvandermeij
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/b289d90d976bd43/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.22.172.223:8877/3b3566cd159f0a8/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://107.22.172.223:8877/3b3566cd159f0a8/output.txt

Total script time: 18.79 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://107.22.172.223:8877/3b3566cd159f0a8/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Linux)


Failed

Full output at http://107.21.233.14:8877/b289d90d976bd43/output.txt

Total script time: 19.89 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://107.21.233.14:8877/b289d90d976bd43/reftest-analyzer.html#web=eq.log

@CodingFabian
Copy link
Contributor Author

note that the test failures are expected, because the previous rendering is incorrect (compared to other pdf viewers, for example the height of the vertical font on page 3 figure 4 should be the same for all except the first column)

@timvandermeij
Copy link
Contributor

@yurydelendik Could you review this PR?

@timvandermeij
Copy link
Contributor

@CodingFabian Could you rebase this PR to resolve the merge conflicts?

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 Author

conflict in gitignore :-) rebased.

@brendandahl
Copy link
Contributor

/botio makeref

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_makeref from @brendandahl received. Current queue size: 0

Live output at: http://107.22.172.223:8877/5b25edb822b626e/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_makeref from @brendandahl received. Current queue size: 0

Live output at: http://107.21.233.14:8877/964b2fb8465bd9e/output.txt

brendandahl added a commit that referenced this pull request Sep 15, 2015
@brendandahl brendandahl merged commit f06aa6a into mozilla:master Sep 15, 2015
@CodingFabian CodingFabian deleted the fix-vertical-kernings-6387 branch September 15, 2015 20:57
@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/964b2fb8465bd9e/output.txt

Total script time: 19.55 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/5b25edb822b626e/output.txt

Total script time: 19.94 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

kalley added a commit to kalley/pdf.js that referenced this pull request Oct 16, 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 this pull request may close these issues.

Kernings and trackings of vertical texts are incorrect
6 participants