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

XFA - Add the possibily to layout and measure text #13560

Merged
merged 1 commit into from
Jun 17, 2021

Conversation

calixteman
Copy link
Contributor

  • some containers doesn't always have their 2 dimensions and those dimensions re based on contents;
  • so in order to measure text, we must get the glyph widths (for the xfa fonts) before starting the layout;
  • implement a word-wrap algorithm;
  • handle font change during text layout.

src/core/worker.js Outdated Show resolved Hide resolved
src/core/xfa/factory.js Outdated Show resolved Hide resolved
@marco-c
Copy link
Contributor

marco-c commented Jun 14, 2021

I'm assuming this is going to fix #13500?

@brendandahl
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/024157c707184a9/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://3.101.106.178:8877/44b592f323a5d15/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/024157c707184a9/output.txt

Total script time: 2.52 mins

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

Image differences available at: http://54.67.70.0:8877/024157c707184a9/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/44b592f323a5d15/output.txt

Total script time: 3.54 mins

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

Image differences available at: http://3.101.106.178:8877/44b592f323a5d15/reftest-analyzer.html#web=eq.log

@brendandahl
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/c0bedb569dd739b/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://3.101.106.178:8877/74415f0a80f3f8e/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/c0bedb569dd739b/output.txt

Total script time: 27.19 mins

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/74415f0a80f3f8e/output.txt

Total script time: 30.81 mins

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

Image differences available at: http://3.101.106.178:8877/74415f0a80f3f8e/reftest-analyzer.html#web=eq.log

@marco-c
Copy link
Contributor

marco-c commented Jun 15, 2021

There seems to be a regression at least in firefox-hsbc_closure-page1.

@calixteman
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/177fa5d3b897f54/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://3.101.106.178:8877/4c16fe39c8af849/output.txt

@calixteman
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/d3a567ff2d330b5/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://3.101.106.178:8877/e67cda9f6da3d13/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/177fa5d3b897f54/output.txt

Total script time: 26.96 mins

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

Image differences available at: http://54.67.70.0:8877/177fa5d3b897f54/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/4c16fe39c8af849/output.txt

Total script time: 30.92 mins

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

Image differences available at: http://3.101.106.178:8877/4c16fe39c8af849/reftest-analyzer.html#web=eq.log

@calixteman
Copy link
Contributor Author

calixteman commented Jun 16, 2021

There is still an issue with hsbc_closure-page3 so I slightly increase the width factor from 1.1 to 1.2.

@calixteman
Copy link
Contributor Author

/botio test

@marco-c
Copy link
Contributor

marco-c commented Jun 16, 2021

There is still an issue with hsbc_closure-page3 so I slightly increase the width factor from 1.1 to 1.2.

There's still a minor issue ("IBAN:" the ":" is on the following line)

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/e67cda9f6da3d13/output.txt

Total script time: 30.99 mins

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

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

@calixteman
Copy link
Contributor Author

I don't understand why the issue is still there (hsbc_closure-page3)...
Normally the font used to render the "Non" (bottom left) is Arial and is embedded in the pdf.
And on my screen at least the "o" is almost a circle when I load the pdf locally when it isn't really a circle on the images reftest.
So maybe something is wrong with fonts in xfa reftests, I need to investigate.

@calixteman
Copy link
Contributor Author

And of course I cannot reproduce locally, it seems that the font is correct.
The "O" are not the same from this png I generated locally.
3

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/9cd47a464f4a55c/output.txt

Total script time: 26.98 mins

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

Image differences available at: http://54.67.70.0:8877/9cd47a464f4a55c/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/85cb04cfc9308b6/output.txt

Total script time: 31.47 mins

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

Image differences available at: http://3.101.106.178:8877/85cb04cfc9308b6/reftest-analyzer.html#web=eq.log

@calixteman
Copy link
Contributor Author

Finally tests are ok...

src/core/worker.js Outdated Show resolved Hide resolved
src/core/xfa/template.js Outdated Show resolved Hide resolved
@calixteman
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/17e1eb3dd9e005a/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://3.101.106.178:8877/160bd29fb06f467/output.txt

  - some containers doesn't always have their 2 dimensions and those dimensions re based on contents;
  - so in order to measure text, we must get the glyph widths (for the xfa fonts) before starting the layout;
  - implement a word-wrap algorithm;
  - handle font change during text layout.
@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/17e1eb3dd9e005a/output.txt

Total script time: 27.19 mins

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

Image differences available at: http://54.67.70.0:8877/17e1eb3dd9e005a/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/160bd29fb06f467/output.txt

Total script time: 30.29 mins

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

Image differences available at: http://3.101.106.178:8877/160bd29fb06f467/reftest-analyzer.html#web=eq.log

@calixteman
Copy link
Contributor Author

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @calixteman received. Current queue size: 0

Live output at: http://54.67.70.0:8877/e95ad44d312a2eb/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_unittest from @calixteman received. Current queue size: 0

Live output at: http://3.101.106.178:8877/eaacfbaeb2c1a38/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/e95ad44d312a2eb/output.txt

Total script time: 3.88 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://3.101.106.178:8877/eaacfbaeb2c1a38/output.txt

Total script time: 5.40 mins

  • Unit Tests: Passed

@calixteman calixteman merged commit b300aba into mozilla:master Jun 17, 2021
@calixteman
Copy link
Contributor Author

/botio makeref

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/e677da5b09a9d75/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_makeref from @calixteman received. Current queue size: 1

Live output at: http://3.101.106.178:8877/aa321c218461a20/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/e677da5b09a9d75/output.txt

Total script time: 23.60 mins

  • Lint: Passed
  • Make references: FAILED

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/aa321c218461a20/output.txt

Total script time: 27.33 mins

  • Lint: Passed
  • Make references: FAILED

@timvandermeij timvandermeij removed the request for review from brendandahl June 18, 2021 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XFA use of CDATA in exData section causes unhandled exception
5 participants