PDF Text Clipping
I have two PDFs that I designed and uploaded to our website, but the headline in both displays with clipped characters in Firefox. Different fonts were used in both and the issue is the same. I even tried adding more tracking then re-uploading, the issue persists.
I checked in other browsers and the text displays as intended. The attached screenshots show the issue in Firefox, compared to how it should look (viewed in Chrome).
It's only this one line of text that is affected and I don't know why.
Endret
Valgt løsning
I got to the bottom of the issue: variable weight fonts.
I normally avoid installing them, for this exact reason, but I must have overlooked when I installed these two.
I just deleted the variable weight versions and installed the static fonts instead. Issue fixed.
Les dette svaret i sammenhengen 👍 0All Replies (8)
Firefox's PDF viewer reconstructs the PDF as an HTML document and writes the text to an HTML canvas. Sometimes there are problems with unusual fonts, but I can't tell whether that is the issue in this case.
To try to isolate a program problem vs. a setting/add-on/data problem:
New Profile Test
This takes about 3 minutes, plus the time to test your document.
Inside Firefox, type or paste about:profiles in the address bar and press Enter/Return to load it.
Take a quick glance at the page and make a mental note of which Profile has this notation: This is the profile in use and it cannot be deleted. That is your current default profile.
Click the "Create a New Profile" button, then click Next. Assign a name like Feb2022, ignore the option to relocate the profile folder, and click the Finish button.
Firefox will switch your default profile to the new one, so click the Set as Default Profile button for your regular one to avoid an unwanted surprise at your next startup.
Scroll down to Feb2022 and click its Launch profile in new browser button.
Firefox should open a new window that looks like a brand new, uncustomized installation. (Your existing Firefox window(s) should not be affected.) Please ignore any tabs enticing you to connect to a Sync account or to activate extensions found on your system to get a clean test.
Does the document render any differently in the new profile?
When you are done with the experiment, you can close the extra window without affecting your regular Firefox profile. (Feb2022 will remain available for future testing.)
Hey @jscher2000,
I just tried your test and the issue persists.
The two fonts in question are Spartan and Oswald, both of which are Google fonts I've used extensively without issue. The fonts are both used throughout the document with no issue, it's just this one area in both my PDFs that have this clipping.
I've tried deleting the text and retyping it by hand, applying styles manually rather than from my InDesign paragraph styles but it still clips.
Hi, can you create a new issue with attached exemplary PDF file on https://github.com/mozilla/pdf.js/issues ? Thanks.
Do you notice any pattern of problems with bold vs. normal weight text?
Valgt løsning
I got to the bottom of the issue: variable weight fonts.
I normally avoid installing them, for this exact reason, but I must have overlooked when I installed these two.
I just deleted the variable weight versions and installed the static fonts instead. Issue fixed.
I'm not sure that has been filed as an issue, so if you think it's a kind of font that will gain increasing use, it might be worth submitting one.
I'm not sure about the popularity of Spartan, but Oswald is very widely used. Google began rolling out the variable weight versions of their fonts...I'm not exactly sure, but I believe sometime in the past year or two, so this could become a bigger issue since they default to variable weight versions when you download many of their fonts now.
I'll submit an issue about variable fonts in general.
Thanks for the help; your tip about font weight is what got me thinking.
I've opened a ticket which demonstrates the issue when rendering variable weight fonts - this looks to be the same issue being discussed here.