Poppler incorrectly picks fonts from TTC font collections
Steps to reproduce:
- On Windows, using https://github.com/oschwartz10612/poppler-windows/releases/tag/v24.07.0-0
- Convert the attached ttc-issue.pdf to SVG or any other output format:
pdftocairo.exe -f 1 -l 1 -svg ttc-issue.pdf ttc-issue.pdf.svg
- Expected: the rendered text starts with an opening parenthesis, which does not overlap with the next character
- Actual: the parenthesis overlaps with the next character: ttc-issue.pdf.svg
The issue is caused by mishandling of TTC font collection files. The document references MS-PGothic font, which has proportional symbols, but Poppler picks MS-Gothic which is represented by the same TTC file msgothic.ttc but has fixed width symbols, causing the wrong positioninig.
The issue is also reproducible on Linux, as long as msgothic.ttc is installed on the system.