Clipped descenders in PDF
Describe the issue
For
https://www.ietf.org/archive/id/draft-ietf-core-dns-over-coap-11.html#figure-1
(using the XML in the I-D archive), I get in HTML:
and in PDF form:
In the PDF form, some descenders (apparently in the bottom lines in text boxes, and maybe not just the descenders) are clipped.
Code of Conduct
- [x] I agree to follow the IETF's Code of Conduct
Work around for this might be, removing text-anchor="middle" which will avoid the clipping issue in PDFs. But that needs SVG diagram to be adjusted manually.
That shouldn't be the problem, as text-anchor only affects text placement horizontally, though I wouldn't rule out bugs.
More seriously, that change would reposition the text in ways that are hard to rectify.
The current design here relies on centering of text (hence text-anchor=middle). Changing the anchor isn't straightforward because we don't have a precise understanding of the font metrics. Setting a different anchor and maintaining the same positioning means knowing how big the text will be. Right now, it doesn't matter too much what the metrics are because of text-anchor=middle.
There is an option on aasvg to stretch text. which uses textLength and lengthAdjust attributes. Those are not permitted by RFC 7996, but might be allowed by an upcoming replacement for that document. That could allow for using a different anchoring by normalizing font metrics through stretching. It might end up looking wonky though.
The RPC is also seeing this issue with a doc in AUTH48
See the figures in https://www.rfc-editor.org/authors/rfc9678.pdf Please note that this RFC is otherwise ready for publication.
Regarding 9678 pdfs over time, it appears:
OK - v1 was xml2rfc 3.23.2 and weasyprint 62.3
OK - v2 was xml2rfc 3.25.0 and weasyprint 62.3
OK - v3 was xml2rfc 3.25.0 and weasyprint 62.3
OK - v4 was xml2rfc 3.25.0 and weasyprint 62.3
bad v5 was xml2rfc 3.27.0 and weasyprint 61.2
I've copied rfc9678v*.pdf into https://www.rfc-editor.org/v3test/ (The version data is from the "Generator version information" in the corresponding HTML files, which were created at the same time.)
fwiw, the weasyprint 62.3 above is odd bc the pinning to weasyprint 61.2 was apparently in Aug 2024 w/ release v3.23.0 which included PR #1147
Regarding 9733 pdfs over time, it appears:
OK rfc9733v1.pdf xml2rfc 3.26.0 and weasyprint 62.3
bad rfc9733v2.pdf xml2rfc 3.27.0 and weasyprint 61.2
PR https://github.com/ietf-tools/xml2rfc/pull/1215 updates xml2rfc to WeasyPrint 64.1.
This change is in the main branch, but has not been release yet.
The plan is to make a release later today.
This has been fixed with WeasyPrint 64.1 update.
This pdf was generated from the current main branch.