Skip to content

RasgaPDF v0.4.1

Choose a tag to compare

@MartinsMessias MartinsMessias released this 03 Nov 23:58
· 4 commits to main since this release

RasgaPDF v0.4.1 — Stream-Level Sub-Character Glyph Coalescence & Dynamic Kerning

Highlights

  • Stream-Level Glyph Coalescence (ContentInterpreter::emit_text_string): Coalesces consecutive sub-character Tj + Td and TJ glyphs on the same baseline directly at interpretation time, reducing span allocations by 81%+ and speeding up parsing on glyph-by-glyph PDFs (e.g. Cairo, Skia, Chromium, airline tickets, DANFEs).
  • Dynamic Proportional Kerning & Intra-Word Thresholds (doc.rs & content.rs): Replaces fixed -1.0pt overlap bounds with proportional max_overlap = (font_size * 0.20).max(1.5) and char_spacing_limit = (font_size * 0.09).clamp(0.4, 1.35), eliminating split headings/words in 14pt–22pt fonts (such as "LA T AM" -> "LATAM", "T ermos" -> "Termos", "Car tão" -> "Cartão").
  • Horizontal Gap Validation in extract_text_bytes (spatial.rs): Prevents false inter-letter spaces when extracting plain text from character-by-character PDF streams.
  • Full Multi-Platform Sync: Synchronized across Rust (crates.io), Python (PyPI), Node.js (npm), C# (NuGet), Go (bindings/go/v0.4.1), WebAssembly (docs/ & space_hf/), and AGENTS.md.