yob / pdf-reader

The PDF::Reader library implements a PDF parser conforming as much as possible to the PDF specification from Adobe.
MIT License
1.81k stars 271 forks source link

Fix glyph width calculations for some Type3 fonts #412

Closed yob closed 2 years ago

yob commented 2 years ago

Most type3 fonts have a FontMatrix entry of [ 0.001 0 0 0.001 0 0 ], which matches the glyph scale factor of 1000 that non-type3 fonts use. It's permitted for type3 fonts to use other FontMatrix values though, and now we use the FontMatrix for glyph width calculations in type3 fonts.

A few integration specs for non-type3 PDFs needed tweaking thanks to the the font size in the TextRun no longer being floored. The changes are whitespace only though, and don't seem to be significant.

Fixes the pending spec added #200