Created attachment 134819 [details] Input file with embedded fonts Steps to reproduce: 1. Save the attached file (EmbeddedFont.pdf) 2. Run: pdftocairo -pdf EmbeddedFont.pdf out.pdf Expected: - Output has same appearance as input (a serif font). Actual: - Output falls back to a system font (sans serif) because fonts are no longer embedded. Notes: - The other output formats (PNG, JPEG, SVG) appear to produce the correct/desired appearance. Only the PDF output is affected.
Created attachment 134820 [details] Before and After Comparison Screenshot comparing the input and output files using Evince
The font family name in the embedded font contained > 3000 chars of garbage. As a result the font name was truncated and missing the closing delimiter. Prevent long strings from being truncated in PDF file: https://cgit.freedesktop.org/cairo/commit/?id=202a9ed64e3d164307defddb41a9f8cf9e9b751b Sanity check the font name length and ignore it if too long: https://cgit.freedesktop.org/cairo/commit/?id=bb10bd10138a262759b37281135b5199e334f392
Interesting finding! Thank you for the explanation and fast fix. I'm assuming if I now build libcairo from master and then re-run pdftocairo, I should see a different result?
Yes, it works for me now. The missing delimiter caused viewers to fail to parse the font and as a result substitute it with something else.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.