gastongouron/ironpress
 Watch   
 Star   
 Fork   
18 days ago
ironpress

v1.4.1

What's New

Architecture

  • Module split: engine.rs (16,500 lines) → 12 focused modules (block, flex, grid, table, text, images, helpers, paginate, inline, context)
  • LayoutContext: single struct replacing scattered width/height/containing-block parameters
  • LayoutEnv: bundles rules, fonts, counter_state (-3 params per function)

Bug Fixes

  • CSS descendant selectors in text runs (pre code, div span) now match correctly
  • margin-left/margin-right on block elements properly reduces width and offsets
  • Borders in flex containers — 4 rendering paths fixed (nested TextBlocks, TableRows, Container children, merged flex cells)
  • float: right now positions elements at the right edge (Container + TextBlock)
  • Percentage width resolves against layout parent, not style-time parent (fixes skill bars, progress indicators)
  • Inline text spacing — single BT/ET block per line eliminates cumulative positioning errors
  • Times-Roman font metrics — proper AFM widths replace Helvetica approximation
  • vw/vh units resolve against actual page size, not hardcoded A4
  • SVG clip-path now works on shape elements (rect, circle, path), not just groups
  • List indentation uses padding-left matching Chrome UA (user CSS padding-left: 0 works)

Features

  • Box-shadow blur — multi-layer concentric approximation replacing solid rectangles
  • Python bindingpip install ironpress (PyO3 + maturin)
  • Ruby bindinggem install ironpress (Magnus)

Testing

  • 2,170+ tests (up from 2,081)
  • 93% line coverage
19 days ago
ironpress

v1.4.0 — Chromium Parity Round 2 & 3

Rendering Engine

Transforms

  • Correct CSS→PDF Y-axis flip for rotate, translate, and composed matrix transforms
  • Support scaleX(), scaleY(), translateX(), translateY(), skew(), skewX(), skewY()
  • Chained transforms composed into single affine matrix

SVG

  • viewBox placement fixed in flex cell nested elements (fixes invoice logo)
  • Quadratic bezier (Q/T) path commands converted to proper cubic curves
  • radialGradient support with objectBoundingBox and userSpaceOnUse
  • text-anchor attribute (start, middle, end)

Flexbox

  • Inline-block shrink-to-fit width (fixes pill shapes taking full width)
  • Flex-grow second pass relayout for percentage-width children (progress bars)
  • Separate flex-basis from child layout width (fixes flex-wrap with flex: 1)

Grid

  • Grid rows wrapped in Container for border + padding around all rows
  • Cell backgrounds and borders offset by container padding

Box Model

  • border-radius: 50% percentage resolution (circles)
  • Rounded rect background + border stroke for FlexCell elements

Pseudo-elements

  • Absolute ::before/::after positioned from container top (not mutated cursor)
  • Skip inline text collection to prevent double-rendering

Other

  • Container height constrained for overflow: hidden
  • Unicode character width estimates for CJK, emoji, Hebrew, Arabic, Greek
  • dir="rtl" attribute support

Parity Dashboard

  • Compare ALL pages per fixture, not just page 1
  • Visual diff images (red = different, white = identical)
  • Fixed ImageMagick compare exit code handling

CI

  • workflow_dispatch trigger for manual deploys
  • apt package caching, lighter font packages