You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a PDF using printpdf, I've noticed that with custom fonts (specifically Roboto Slab and B612 Mono), when you try to select text in a PDF viewer the selection will be much taller than the text and will overlap adjacent lines (rendering them invisible). If I use the built-in courier fonts with exactly the same text settings, the problem goes away. Here's a screenshot of the issue in Evince:
This is most notable when opening the PDF in Evince. In Firefox and Chrome the selected text is the right height. You can get a copy of an example PDF with this problem here.
The text was updated successfully, but these errors were encountered:
The "problem" with those fonts is that the unitsPerEm field is set to 2000 instead of the default 1000 and Evince is the only PDF viewer that doesn't respect that.
I can work around it by dividing the ascender / descender by 2.0, but then the text appears "spaced out", because the glyph widths still expect 2000 units per em:
I also need to debug why the ascender / descender doesn't use the sTypoMetrics field as it should. The fix is to scale the ascender / descender AND the glyph widths to 1000em and also to submit a bug report to Evince.
Same problem with Okular. I think both depend on Poppler for pdf parsing/rendering, so if that's really a viewer bug, it might be located there.
I opened a bug for Okular: https://bugs.kde.org/show_bug.cgi?id=470091
When creating a PDF using printpdf, I've noticed that with custom fonts (specifically Roboto Slab and B612 Mono), when you try to select text in a PDF viewer the selection will be much taller than the text and will overlap adjacent lines (rendering them invisible). If I use the built-in courier fonts with exactly the same text settings, the problem goes away. Here's a screenshot of the issue in Evince:
This is most notable when opening the PDF in Evince. In Firefox and Chrome the selected text is the right height. You can get a copy of an example PDF with this problem here.
The text was updated successfully, but these errors were encountered: