Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

font rendering error in pdf.js

1,083 views
Skip to first unread message

v+py...@g.nevcal.com

unread,
Oct 9, 2014, 7:30:54 AM10/9/14
to mozilla-d...@lists.mozilla.org
There _could_ be something weird about the font, I suppose, it is a music font called Bravura. Here is the URL to the page that renders improperly:
http://blog.steinberg.net/wp-content/uploads/2013/05/fibich-bravura.pdf

I downloaded the file and opened it in SumatraPDF, and it displays properly, leading me to think it is probably pdf.js rather than the font.

The problem I noticed in Firefox/pdf.js is that the treble & bass clefs are both truncated: the treble clef at both top and bottom, and the bass clef at the bottom.

If the person debugging this isn't a musician, the clefs are at the left end of the lines of music.... well, just to the right of the brace and vertical line, the leftmost items on the 5-horizontal-line thing (called a staff).

Nicholas Nethercote

unread,
Oct 9, 2014, 5:59:25 PM10/9/14
to v+py...@g.nevcal.com, mozilla-d...@lists.mozilla.org
Hi,

For what it's worth: I tried this on my Linux desktop machine (running
Firefox Nightly 35) and on my Mac laptop (running Firefox Beta 33) and
both the treble and bass clefs looked fine.

Nick
> _______________________________________________
> dev-pdf-js mailing list
> dev-p...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-pdf-js

v+py...@g.nevcal.com

unread,
Oct 9, 2014, 6:49:13 PM10/9/14
to mozilla-d...@lists.mozilla.org
Thanks, Nick, for the feedback. I had a friend with Win 8.1 try it, and it looked fine to him too. I'm on Win 7 pro 64-bit, here, and maybe that is the difference. Not sure why PDF.js would display it wrong on Win 7, and Sumatra would display it correctly on Win 7. Not sure if the PDF renderers do their own font rendering or pass it off to the OS... nor if they can pass it off to the OS for embedded fonts.

My friend just tried it on the Win 10 preview, and it works there too, in PDF.js in Firefox.

Since my first complaint, I noticed other deficiencies... the brace at the left is missing the top chunk, and so is the ƒƒ in the 4th staff missing its top part, the ƒ and mƒ and sƒz in various locations likewise, the p and pp all missing a chunk off the bottom. And the dotted quarter note for the rhythm notation (just right of Lento above the top staff) is missing the top of its stem. So whatever is wrong, is pretty well wrong for lots of characters.

My friend also had his son try it on Win 7 pro 64-bit and had the same problems, and so we have _a_ common denominator.

Yury Delendik

unread,
Oct 9, 2014, 7:08:33 PM10/9/14
to v+py...@g.nevcal.com
On 10/9/14, 5:35 PM, v+py...@g.nevcal.com wrote:
> Thanks, Nick, for the feedback. I had a friend with Win 8.1 try it, and it looked fine to him too. I'm on Win 7 pro 64-bit, here, and maybe that is the difference. Not sure why PDF.js would display it wrong on Win 7, and Sumatra would display it correctly on Win 7. Not sure if the PDF renderers do their own font rendering or pass it
off to the OS... nor if they can pass it off to the OS for embedded fonts.

PDF.js is trying to restore fonts embedded in PDFs (even broken and
corrupted) and use them during canvas text painting operation and those
are used by the browser's and then OS'es font rendering engine. We
noticed that sometimes configurations cannot handle some older or still
not fully restored fonts, e.g. Windows Vista or Windows 7 cannot display
some umlats, Chrome for Windows had bad font quality.

Most of PDF renders use their own font engines or feed fonts from the
PDFs directly to the OSes, which was big security risk and once was a
common vector attack from the web. (As experiment PDF.js has it's own
simple/safer font rendering engine, but it's disabled by
PDFJS.disableFontFace option)

> Since my first complaint, I noticed other deficiencies... the brace at the left is missing the top chunk, and so is the ƒƒ in the 4th staff missing its top part, the ƒ and mƒ and sƒz in various locations likewise, the p and pp all missing a chunk off the bottom. And the dotted quarter note for the rhythm notation (just right of Lento above the top staff) is missing the top of its stem. So whatever is wrong, is pretty well wrong for lots of characters.
>
> My friend also had his son try it on Win 7 pro 64-bit and had the same problems, and so we have _a_ common denominator.
>

It is very important that reported rendering issues are accompanied by
detailed OS configuration (for Windows 7, it matters if IE10 installed
or not and which graphics card/driver is used), web browser version, and
link to the broken PDF. See
https://github.com/mozilla/pdf.js/blob/master/CONTRIBUTING.md.

Thanks
0 new messages