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

some pdfs won't render correctly if ff uses standard fonts for all sites #2414

Closed
Patroklos opened this issue Nov 28, 2012 · 17 comments
Closed

Comments

@Patroklos
Copy link

Most of the links in this page won't be displayed correctly http://www.porlidas.gr/Papers/Papers.htm For example this papaer here http://www.porlidas.gr/Papers/AC.pdf or this one here http://www.porlidas.gr/Papers/SuccsTheor.pdf This is my first comment so i am sorry if i have not done something the right way. Please make pdf viewer even better it is essential to my workflow -thank you.

@yurydelendik
Copy link
Contributor

pdf.js and and adobe reader output looks the same (at least for me on my computer). could you explain what we are looking for? also, provide info about your browser, os, and pdf.js versions

@Patroklos
Copy link
Author

ok! 1) i use dual boot a} ubuntu with firefox 16.0.2 and pdf viewer 0.6.39 b}windows7 with firefox 17 and the same viewer verson. 2) the pdf files are there if you download them and then open them with evince or foxit reader you don't have any problems. Also chrome opens them in both OSes online without any problems. the context is just text about circuits. I can see the math simbols and the electrical circuits but everything else is just unreadable. thank you._

@yurydelendik
Copy link
Contributor

@Patroklos , tried on ubuntu http://dl.dropbox.com/u/8884325/screenshots/pdfjs-2414-2.png and win7 http://dl.dropbox.com/u/8884325/screenshots/pdfjs-2414-1.png and still don't see a problem. Can some other plug-in or add-on that you are using conflict with pdf.js?

@Patroklos
Copy link
Author

So here is what i did: in w7 i disabled everything and restarted but it was still unreadable the pdf but when i re-enabled all my addons and went back to the pdf the fonts were crystal clear... Unfortunately in ubuntu nothing happened, i still see this https://www.dropbox.com/s/cz67q8w0p628j1i/shot1.png i have all language packages installed though... Here is the list with all the installed addons: download helper, clearly, flashblock and turn off the lights. All of them are in their latest version.I forgot to mention that i had all the plug-ins disabled in ubuntu although in w7 i didn't need to... Thank you for your time._

@yurydelendik
Copy link
Contributor

@Patroklos , I wonder if http://askubuntu.com/questions/209743/pdfs-dont-render-correctly-with-firefox-and-pdf-js will help. Also, check if creating of a new Firefox profile solves the issue.

@Patroklos
Copy link
Author

i already had seen these links... ok listen to this: i took the big decision to delete every thing and open a new profile you know firefox -P etc... so i reinstall my addons and everything is good ff renders all the fonts.So far so good but when i log in to my ff sync account pdf viewer gets messed up... ok now you are thinking it has to be something with my preferences... Ha it is NOT! because i checked it... i only use the sync for my bookmarks and there is no way that some urls can have anything to do with the font render... so now i am again in need for fresh ideas!! thank you for your time._

@Patroklos
Copy link
Author

Oh my god i got it!! you have to use the site's fonts not your systems... i checked that box in ff preferences and it worked... it has to be some bug that doesn't allow ff viewer to use fixed fonts for all sites. If you know how to report this so that it gets fixed please do. thank you for your time._

@yurydelendik
Copy link
Contributor

Thanks for looking into that. You may just found a solution for some of the "4-font-linux" bugs here

@gigaherz
Copy link
Contributor

It makes sense that it doesn't work if you disable loading web fonts and force the system defaults instead, since pdf.js uses web fonts to draw everything.

@Patroklos
Copy link
Author

Firstly, how could i know that pdf.js uses web fonts to draw? i am just a noob after all. Although if my issue wasn't new then the creators had to put it in the description of the addon so people could be informed... Secondly i don't think what you are saying is right because then the viewer wouldn't be able to render any other pdfs... or so i think. thank you all for your replies._

@gigaherz
Copy link
Contributor

I wasn't blaming you, just exposing my thoughts. There's no blame involved in this issue since no one thought of that possibility until now. I'm sorry if my answer sounded wrong.

@yurydelendik
Copy link
Contributor

This issue is interesting since a user chooses to use only specific fonts. We are trying to treat a PDF resource as a regular HTML page and it to be as a part of the browser. From http://support.mozilla.org/en-US/kb/settings-fonts-languages-pop-ups-javascript#w_fonts-dialog "Allow pages to choose their own fonts, instead of my selections above: By default Firefox uses the fonts specified by the web page author. Disabling this option will force all sites to use your default fonts instead." Do we want to force the web font usage against a user will?

PDF contains glyphs and not text, and sometimes it's impossible to match glyphs to letters. So by choosing some standard system fonts you will get that effect.

@Patroklos
Copy link
Author

I have been thinking and testing for a while... Well i tested many fonts in the advanced window in the content preferences and none worked for the above pdfs so i do not think that this might be a font problem, although i don't know why there are many that CAN be rendered properly with my standard ubuntu fonts.I think it might be an encoding problem(?!). Ok then i show the Pull Request #2425 from above and i thought what if i still use my standard font for all sites BUT when a tab opens for pdf.js ff makes an exception and loads the web's fonts? that way i still get to use my comfortable in my eyes font sizes and also have all my pdfs rendered correctly. {{I feel totaly like Neo now even if i don't know shit about coding and i can't fly of course...}} If this exception thing is not very easy to do then please pdf.js guys think something else 'cause it is very frustrating to have to turn my fonts off every time a pdf is not rendered right. PS. I have to change my title in this issue (the current one is totaly off topic) but i can't think of a proper one please someone suggest a descriptive one or else i will come up with something in a couple of days._

@gigaherz
Copy link
Contributor

gigaherz commented Dec 1, 2012

A PDF is free to use different character codes in the embedded fonts than they originally had. Although many PDFs play nice and keep the standard glyph<->code mappings, there are some that do use the wrong mapping, possibly on purpose, since it makes it impossible to copy or extract the text of the PDF by any means other than OCR.

I tried to copy from your PDF into Word 2010, and it seems to work, so I guess it may not be the case for this example, but in any case where it is, using non-embedded fonts would not work.

I am only a contributor so I can't really comment on the topic of allowing a tab to have different settings, but I think I read elsewhere they were saying it was wrong to go against the user's explicit wishes and use web fonts regardless of what was said in the options dialog.

@Patroklos
Copy link
Author

I get what you are saying after all i use ff over chrome cause it gives me more liberty and options to do what i want with my browser (in chrome you can't even use incognito with extensions... lame) and of course it is open source. I also get "it was wrong to go against the user's explicit wishes and use web fonts" it is the right thing after all.

But my opinion is that Until the creators of pdf.js find a way to overcome this issue, they could add to the prescription of the addon to inform the end user that the pdf.js tab will always use the web fonts. After all I, as a pdf.js user, may explicitly choose to use my own fonts But i implicitly want all the pdfs out there in the web to be correctly rendered. Lastly, i think that maybe the most correct approach would be to give the user the liberty to choose for himself what is going to be happening on HIS pdf tab. WE are open (source) after all...

PS i always had that question about not being able to copy all my pdfs into a .doc... Now i know...
PS2 i think i went a little to far for someone who doesn't contribute in code nonetheless i ask for more work... am truly selfish. Thank you all for your time._

@gkranis
Copy link

gkranis commented May 1, 2013

I have also permanently unchecked "Allow pages to use their own fonts..." in firefox and most pdf's are unreadable.
Pdf.js needs to disregard this option.I don't get the whole "disrespecting the users' wishes" argument.Do you think someone watching pdf.js not rendering any pdf correctly will appreciate you respecting his wishes?

@yurydelendik
Copy link
Contributor

Resolved by #3195

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

No branches or pull requests

4 participants