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

Highlight went wrong when the text font-size less than the minimum font-size of the browser #14426

Closed
helianthuswhite opened this issue Jan 7, 2022 · 3 comments · Fixed by #18283

Comments

@helianthuswhite
Copy link

Attach (recommended) or Link to PDF file here:

Configuration:

  • Web browser and its version: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
  • Operating system and its version: Intel Mac OS X 10_15_7
  • PDF.js version: the latest
  • Is a browser extension: no

Steps to reproduce the problem:

  1. open the demo in chrome https://mozilla.github.io/pdf.js/web/viewer.html
  2. search any word in the pdf, such as 'JavaScript'
  3. zoom out the pdf until the minimum font-size less than 12px, and you will see the problem

What is the expected behavior? (add screenshot)
image

What went wrong? (add screenshot)
image

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):
https://mozilla.github.io/pdf.js/web/viewer.html

@helianthuswhite
Copy link
Author

I have created a pr for this #14427 , thank you for feedback.

@Snuffleupagus
Copy link
Collaborator

Web browser and its version: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36

Unfortunately it's not immediately clear exactly which browser this actually is; I'm assuming you mean Google Chrome here.

PDF.js version: the latest

Sorry, but "the latest" isn't helpful; please always provide an actual version number.

zoom out the pdf until the minimum font-size less than 12px, and you will see the problem

I cannot reproduce this (when testing on Windows) in either Mozilla Firefox Nightly 97.0a1 or Google Chrome Beta 97.0.4692.71 unless I manually specify a minimum font-size in the browser settings (that part wasn't entirely clear from the STR).

I have created a pr for this #14427 , thank you for feedback.

Looking very briefly at the patch, it doesn't seem great having to constantly re-compute something that in most browsers won't be set at all. Is there really no way to ensure that these font-properties are always enforced, regardless of browser settings, by using e.g. CSS-rules instead?

@simpleoo0o

This comment was marked as duplicate.

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