Skip to content

v0.8.2

Choose a tag to compare

@danmolitor danmolitor released this 31 Mar 14:52
· 584 commits to main since this release

Forme 0.8.2

Fixed

Custom font weight resolution

When multiple weights are registered for the same font family, the PDF now correctly embeds and renders each weight as a distinct font. Previously, all weights were silently collapsed to 400 or 700 regardless of what was registered.

Font.register({ family: 'Geist', fontWeight: 200, src: '...Geist-UltraLight.ttf' });
Font.register({ family: 'Geist', fontWeight: 300, src: '...Geist-Light.ttf' });
Font.register({ family: 'Geist', fontWeight: 400, src: '...Geist-Regular.ttf' });
 
// All three now render with their correct font files
<Text style={{ fontFamily: 'Geist', fontWeight: 200 }}>Ultra Light</Text>
<Text style={{ fontFamily: 'Geist', fontWeight: 300 }}>Light</Text>
<Text style={{ fontFamily: 'Geist', fontWeight: 400 }}>Regular</Text>

The bug was in the PDF serializer — four sites were snapping font_weight to 400 or 700 before building the font lookup key, discarding the actual registered weight. All four sites now use the raw weight value, with a fallback chain (exact → snapped → Helvetica) for cases where the requested weight has no registered variant.


Improved

  • Docker build — Added .dockerignore to exclude target/ and node_modules/ from the build context, fixing out-of-space errors during multi-platform builds.
  • Release process — Documented SDK WASM rebuild steps (Python + Go), PyPI dist cleanup, and README update checklist.

Upgrading

npm install @formepdf/react@0.8.2 @formepdf/core@0.8.2
 
# Docker
docker pull formepdf/forme:0.8.2
 
# Go SDK
go get github.com/formepdf/forme-go@v0.8.2
 
# Rust crate
cargo add forme-pdf@0.8.2

No breaking changes. Drop-in upgrade from 0.8.1.


All Packages

@formepdf/react · @formepdf/core · @formepdf/cli · @formepdf/renderer · @formepdf/hono · @formepdf/next · @formepdf/resend · @formepdf/mcp · @formepdf/sdk · @formepdf/tailwind · @formepdf/templates · forme-pdf (VS Code) · forme-pdf (crates.io) · formepdf (PyPI) · formepdf/forme (Docker) · github.com/formepdf/forme-go