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 chars scaling #4908

Closed
wants to merge 1 commit into from
Closed

Conversation

tavwizard
Copy link

The chars with measuredWidth less then width look terrible after scaling. Let to move it in center instead of scaling.

@timvandermeij
Copy link
Contributor

Please fix the nit and squash the commits into one (see https://github.com/mozilla/pdf.js/wiki/Squashing-Commits).

The chars with measuredWidth less then width look terrible after scaling. Let to move it in center instead of scaling.
@tavwizard
Copy link
Author

done

@timvandermeij
Copy link
Contributor

Do you have a PDF file for us so we can test this patch, i.e. a PDF file with chars with measuredWidth less then width?

@tavwizard
Copy link
Author

Yes. Is it possible to attach it here?

@Snuffleupagus
Copy link
Collaborator

Is it possible to attach it here?

No, GitHub doesn't support attachments. You will have to use a hosting service, such as: Dropbox, Google Drive or similar.

@CodingFabian
Copy link
Contributor

#3853 has a PDF which has quite a few with measuredWidth < width. and it has quite many where measuredWidth == width, which this PR would also improve by skipping the scaling.

ctx.scale(characterScaleX, 1);
scaledX /= characterScaleX;
} else if (width > measuredWidth) {
var d = (width - measuredWidth) / 2000;
Copy link
Contributor

Choose a reason for hiding this comment

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

A more descriptive variable is needed here. What is 'd'?

@brendandahl
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Oct 8, 2014

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/32729af34b3dab5/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Oct 8, 2014

From: Bot.io (Linux)


Received

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

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

@pdfjsbot
Copy link

pdfjsbot commented Oct 8, 2014

From: Bot.io (Windows)


Failed

Full output at http://107.22.172.223:8877/32729af34b3dab5/output.txt

Total script time: 2.95 mins

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

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

@brendandahl
Copy link
Contributor

I didn't see #4964. @yurydelendik Should this be closed in favor of your PR?

@pdfjsbot
Copy link

pdfjsbot commented Oct 8, 2014

From: Bot.io (Linux)


Failed

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

Total script time: 22.92 mins

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

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

@CodingFabian
Copy link
Contributor

@brendandahl I also proposed a different solution. However I think yurys code produced the best results on the pdfs I looked at. But what actually remains open is to solve the problem the original scaling code aimed to solve.

@timvandermeij
Copy link
Contributor

Superseded by #6651 as that appears to solve this in a better way.

brendandahl added a commit that referenced this pull request Dec 10, 2015
Fix chars scaling for standard fonts. (redo of #4908)
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.

6 participants