Skip to content

HTML to PDF 0.4.0 — CSS1 text spacing and indentation

Choose a tag to compare

@roukmoute roukmoute released this 09 Nov 08:24
· 14 commits to main since this release
2adb5be

CSS1 text spacing and first-line indentation are now rendered by the native PHP engine.

  • Add inherited word-spacing and letter-spacing with signed lengths, and text-indent with signed lengths or percentages.
  • Keep wrapping, PDF glyph positions, link bounds and inline decorations on the same adjusted advances. Combining marks stay with their base character; normal/zero spacing preserves shaping.
  • Preserve indentation across line/page breaks, percentage bases beside floats and in lists, collapsed-space ownership, and whole words across inline elements.
  • Add a three-page example with native previews, English/French guides and independent Chromium/Firefox and PDF witnesses.

CSS1 remains incomplete: 52 requirements are partial and 10 unsupported. Complete font matching, text transformation, justification and remaining decoration contexts are future work. Preserved tabs with nonzero spacing and ambiguous cross-run grapheme shaping are explicitly rejected. No PDF/A or PDF/UA certification is claimed.

Validation of the exact release commit: PHP 8.3/8.4/8.5, PHPUnit, PHPStan, code style, Composer audits, qpdf, pypdf, Poppler, independent browser geometry and negative oracle controls. Detailed receipts and all rendered examples are attached.


Les espacements CSS1 et le retrait de première ligne sont désormais rendus par le moteur PHP natif.

  • Ajout de word-spacing, letter-spacing et text-indent, avec héritage, longueurs signées et pourcentages pour le retrait.
  • Mesure commune aux retours à la ligne, glyphes PDF, liens et décorations ; préservation des accents combinants et du façonnage avec un espacement normal ou nul.
  • Gestion des changements de page, des flottants, des listes, des espaces fusionnés et des mots répartis entre plusieurs balises.
  • Nouvel exemple de trois pages, aperçus réels, guides FR/EN et témoins indépendants Chromium/Firefox/PDF.

CSS1 reste incomplet : 52 exigences partielles et 10 non prises en charge. Les limites et les preuves sont documentées ; aucune certification PDF/A ou PDF/UA n’est annoncée.