Subsetting fonts in some PDFs messes up horizontal glyph placement (original) (raw)
Describe the bug (mandatory)
A clear and concise description of what the bug is.
Subsetting fonts using subset_fonts() in PDFs produced by rinohtype changes the horizontal placement of individual glyphs. An example PDF with embedded fonts is google_fonts.pdf.
To Reproduce (mandatory)
import fitz
d = fitz.open('google_fonts.pdf')
d.subset_fonts()
d.save('gf_subset.pdf', garbage=3, deflate=True)
$ python subset.py
Subset built for 'Asap-Bold'.
Subset built for 'NotoSerif'.
Subset built for 'NotoSerif-Italic'.
Subset built for 'NotoSerif-Bold'.
Subset built for 'RobotoMono-Regular'.
Subset built for 'RobotoMono-Medium'.
Screenshots (optional)
Your configuration (mandatory)
3.9.5 (default, May 26 2021, 10:31:42)
[Clang 12.0.0 (clang-1200.0.32.29)]
darwin
PyMuPDF 1.18.14: Python bindings for the MuPDF 1.18.0 library.
Version date: 2021-06-01 08:11:38.
Built for Python 3.9 on darwin (64-bit).
Collecting pymupdf
Downloading PyMuPDF-1.18.14-cp39-cp39-macosx_10_9_x86_64.whl (5.6 MB)
|████████████████████████████████| 5.6 MB 3.6 MB/s
Installing collected packages: pymupdf
Successfully installed pymupdf-1.18.14
