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

Implement vertical writing for CJK text #2686

Merged
merged 1 commit into from
Feb 25, 2013

Conversation

vyv03354
Copy link
Contributor

@vyv03354 vyv03354 commented Feb 6, 2013

@jviereck
Copy link
Contributor

jviereck commented Feb 7, 2013

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Feb 7, 2013

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/536e9ba863d7cc6/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Feb 7, 2013

From: Bot.io (Linux)


Received

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

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

switch (textRenderingMode) {
default: // other unsupported rendering modes
case TextRenderingMode.FILL:
case TextRenderingMode.FILL_ADD_TO_PATH:
ctx.fillText(character, scaledX, 0);
if (vertical) {
ctx.fillText(character, 0 + vx, scaled + vy);
Copy link
Contributor

Choose a reason for hiding this comment

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

What the reason for the extra 0 + here and the following lines?

@jviereck
Copy link
Contributor

jviereck commented Feb 7, 2013

Thanks a lot for this patch!

The code for the rendering part looks good to me, but I don't know anything about fonts, so someone else has to do a review on that part.

@jviereck
Copy link
Contributor

jviereck commented Feb 7, 2013

Copy over image from https://bugzilla.mozilla.org/show_bug.cgi?id=770409 as reference:

incorrect-vertical-text-pdfjs-preview

@pdfjsbot
Copy link

pdfjsbot commented Feb 7, 2013

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/536e9ba863d7cc6/output.txt

Total script time: 19.77 mins

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

@pdfjsbot
Copy link

pdfjsbot commented Feb 7, 2013

From: Bot.io (Linux)


Success

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

Total script time: 21.67 mins

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

@jviereck
Copy link
Contributor

jviereck commented Feb 7, 2013

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Feb 7, 2013

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/1c3c0545e1a1422/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Feb 7, 2013

@jviereck
Copy link
Contributor

jviereck commented Feb 7, 2013

@vyv03354 the rendering looks good but the textLayer/selection is broken. The div is placed horizontal and not vertically. What's the correct behavior here? Should the div containing the letters have a new line-break after each letter or should the div be rotated by 90 degrees?

@vyv03354
Copy link
Contributor Author

vyv03354 commented Feb 7, 2013

Obviously "writing-mode: vertical-rl" would be the correct choice. But Firefox is unlikely to support writing-mode in near future, so I'll rotate the div at the moment. Individual rotated glyphs would not be a problem because textLayer texts are invisible anyway.

@mduan
Copy link
Contributor

mduan commented Feb 7, 2013

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Feb 7, 2013

From: Bot.io (Windows)


Received

Command cmd_test from @mduan received. Current queue size: 1

Live output at: http://107.22.172.223:8877/cd21954d23be9ba/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Feb 7, 2013

From: Bot.io (Linux)


Received

Command cmd_test from @mduan received. Current queue size: 1

Live output at: http://107.21.233.14:8877/3ad38673ed08ad7/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Feb 7, 2013

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/cd21954d23be9ba/output.txt

Total script time: 19.67 mins

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

@vyv03354
Copy link
Contributor Author

vyv03354 commented Feb 7, 2013

socket.error: [Errno 98] Address already in use

Infra error?

@yurydelendik
Copy link
Contributor

Infra error?

I think so

/botio-linux test

@pdfjsbot
Copy link

pdfjsbot commented Feb 7, 2013

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/359ea46350a5552/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Feb 7, 2013

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/359ea46350a5552/output.txt

Total script time: 21.55 mins

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

@vyv03354
Copy link
Contributor Author

vyv03354 commented Feb 8, 2013

What do I have to do to merge this? Just waiting for a review?

@gigaherz
Copy link
Contributor

gigaherz commented Feb 8, 2013

You should never merge anything yourself, even if you are allowed to. Let someone else review the code and decide. In this case, someone from the dev team (from Mozilla) may merge it if they like the PR after a review.

@vyv03354
Copy link
Contributor Author

vyv03354 commented Feb 8, 2013

I did not mean to say "merge it myself". I should have said "to be merged".

@jviereck
Copy link
Contributor

jviereck commented Feb 9, 2013

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Feb 9, 2013

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/14401a07bd060a9/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Feb 9, 2013

@jviereck
Copy link
Contributor

jviereck commented Feb 9, 2013

What do I have to do to merge this? Just waiting for a review?

Yes --- and if it takes too long for you taste (> 1 week?) poke someone kindly :)

@yurydelendik
Copy link
Contributor

(... as mentioned at https://github.com/mozilla/pdf.js/wiki/Contributing item 7)

@jviereck
Copy link
Contributor

jviereck commented Feb 9, 2013

Obviously "writing-mode: vertical-rl" would be the correct choice. But Firefox is unlikely to support writing-mode in near future [...]

Do you know if there is a bug on file for this already? Would you mind to open one if it is not? Sometimes magic things happens once a bug is filed and things get implemented faster then expected.

@brendandahl
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/916604a032a632e/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/30e234c279c3dff/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://107.22.172.223:8877/916604a032a632e/output.txt

Total script time: 19.74 mins

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

Image differences available at: http://107.22.172.223:8877/916604a032a632e/reftest-analyzer.xhtml#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/30e234c279c3dff/output.txt

Total script time: 21.68 mins

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

@vyv03354
Copy link
Contributor Author

I was unable to reproduce the reftest failure locally.
Also I have no idea why this patch affects PDFs without vertical text. Very weird...

@gigaherz
Copy link
Contributor

The failure may be an intermittent issue unrelated to your changes. There's still a few of those, I think.

@brendandahl
Copy link
Contributor

The changes look like they're from the FF19 update. I'll open a pr to update them and re-run here.

@vyv03354
Copy link
Contributor Author

Could you execute the test again? The reference image should be updated by #2785.
Like #2785, failures are differences between missing glyphs and blanks.

@yurydelendik
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/01a58d3201b5515/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/01a58d3201b5515/output.txt

Total script time: 19.61 mins

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

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

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

Total script time: 19.64 mins

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

@brendandahl
Copy link
Contributor

/botio makeref

@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/dc2aad9de6abfb8/output.txt

@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/18d48e6b1a3c10d/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/18d48e6b1a3c10d/output.txt

Total script time: 19.82 mins

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

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

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

Total script time: 25.41 mins

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

brendandahl added a commit that referenced this pull request Feb 25, 2013
@brendandahl brendandahl merged commit a13f796 into mozilla:master Feb 25, 2013
@brendandahl
Copy link
Contributor

Thanks for implementing this.

@mduan
Copy link
Contributor

mduan commented Mar 11, 2013

For reference, linking 2 bugzilla issues related to this:

@mitar
Copy link
Contributor

mitar commented Mar 31, 2013

As explained in #2817, this has not fixed the issue of displaying the vertical text for latin fonts (the hidden layer text, rendering itself is OK). BidiResult does not get "vertical" flag set. Examples are arXiv PDFs: http://arxiv.org/pdf/0707.3023.pdf

@mitar
Copy link
Contributor

mitar commented Mar 31, 2013

Uh, even the PDF which was used for testing in #2686 does have a bug and does not display text layer correctly.

@vyv03354
Copy link
Contributor Author

#2817 is a different problem from this bug. Latin vertical text is rendered by a different method from CJK one even if they are mixed (like http://blogs.adobe.com/CCJKType/files/2012/07/TaroUTR50SortedList112.pdf ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants