In the example PDF, character bboxes are incorrectly computed. So XML output delivers wrong quad results for characters and hence lines. HTML output however seems correct, in that line heights equal to the font size are calculated. PyMuPDF issue https://github.com/pymupdf/PyMuPDF/issues/3600 File link: https://github.com/user-attachments/files/15911488/8989fa66-9bff-4f0c-9f05-37c8a393207e.pdf Reproducer XML: mutool draw -o test.xml -F stext test.pdf 1 Reproducer HTML: mutool draw -o test.html test.pdf 1 We have a workaround in PyMuPDF, which can recompute character bboxes based on font ascender / descender and span origin. So the user has a solution for now.