Repository navigation
Releases
F-Office v0.3.1
Upgrades Compatifont to v0.2.2 (adding Arimo Black CF for Arial Black), updates the default Compatifont CDN to https://cdn.compatifont.com/v0.2.2, and includes layout, chart, table, and font-resolution improvements.
v0.3.0
Compatifont 0.2.0 & East Asian Stand-In Support
- Compatifont
0.2.0(f-office-docx,f-office-fonts,@f-office/docs): Upgradescompatifontto0.2.0(adding all 10 Wave 1 East Asian stand-in families tocompatifont::known()) and updatesDEFAULT_COMPATIFONT_CDNtohttps://cdn.compatifont.com/v0.2.0(23 families, 60 faces). - Verified metric stand-ins as
Exact: Classifies verified Compatifont metric stand-ins (Basis::Check,Level::Widths, matchingGroup::Linemetrics) asSubstituteLayout::Metrics/FontMatchKind::MetricStandInunderFidelityLevel::Exact, matches legacy Compatifont names against typographic family/style entries (e.g.Aptos Display,Arial Narrow), and differentiates approximate fidelity banner copy for unverified widths, version mismatches, and unrelated fallbacks. - Stand-in synthetic styles & em-grid precision: Computes synthetic bold and italic on stand-in faces (
FontChoice::draw_stand_in) and preserves targetunits_per_emrounding granularity (256/1024upem) for East Asian single-line room, synthetic-bold advance widening, and whole-line checks.
Viewer & Web Packages (@f-office/docs, @f-office/docs-react)
- Monotonic load progress (
OpenProgressTracker): NormalizesOpenProgress.fractioninto a single monotonic0..1sequence across engine, scan, fonts, layout, and render stages for both cold and warm loads, buffering pre-open engine progress while idle. - Document download: Adds
File → Download (.docx)in@f-office/docs-reactwith the OOXML DOCX MIME type.
DOCX Layout & Rendering Improvements
- 3-D clustered column charts: Adds 3-D clustered column chart rendering in
f-office-docxandf-office-effects. - Borders & tables: Refines multi-line page border corner joining, nesting, and white gap painting; cuts table borders at page foot and split-row junctions; and places spacing-zero cell-box borders by their inner edges.
- Text, bidi, fields, and metafiles: Adds pixel-depth single underlines for East Asian faces, device-width tab leader stepping and stop placement,
FILENAMEfield resolution in headers/footers, run splitting after leading unmapped symbols with non-default East Asian fonts,w:rtl/w:csgating for complex-script slots/sizes, mixed-run RTL ordering and bracket mirroring, and scaled0.14 ptcosmetic/sub-hairline EMF/WMF pens.
v0.2.4
Document Rendering Fidelity & Font Status
- Typed fidelity reporting (
f-office-docx,f-office,f-office-wasm): Distinguishes exact metric stand-ins from fallback substitutions (SubstituteLayout::Fallback), records natively matched fonts, emits privacy-safe missing-glyph warnings grouped by font and Unicode block (Warning::GlyphMissing), and exposes a typedFidelityReportviaDocument::fidelity()andSession::fidelity(). - Worker & Web Component events (
@f-office/docs): Streams typedFidelityReportthrough the worker and<f-office-docs>(el.fidelity,docs.fidelity,fidelitychangeevent,onFidelityChangeoption). - Document Fidelity UI (
@f-office/docs-react): Adds a quiet check icon beside the document title when fonts match exactly, an amber/red warning pill and dismissible banner (DocsFidelityBanner) when fonts fall back or glyphs/elements degrade, aDocument Fidelitypopover showing the font match table, missing characters, and render notes, plusView → Fonts → Document fonts…in the menu bar andonFidelityChangeon headless<FOfficeDocs />.
DOCX Layout & Formatting Fixes
- Preserve body-level
w:customXmlcontent in the streamed XML reader. - Improve SmartArt line placement and last-line spacing, and fix zero
atLeastline-spacing handling with the document line grid. - Include numbering list-label fonts and chosen math font families when scanning document font needs.
v0.2.3
Progressive Page-1-First DOCX Loading & Open Progress
- Single-parse staged opening & incremental layout (
f-office-docx,f-office,f-office-docs,f-office-wasm): Parses the DOCX once, scans font needs without a full dummy layout pass, yields as soon as Page 1 is ready, and lays out remaining pages in short non-blocking slices while preserving scroll state and invalidating only pages affected by multi-pass fields (NUMPAGES,PAGEREF, TOC). - Worker scheduler & structured progress (
@f-office/docs): Prioritizes interactive input and visible page draws over background layout slices and print copies; emitsprogress(engine,scan,fonts,layout,render) andpageschangeevents alongsideonProgressonFOfficeDocs. - React 19 progress UI (
@f-office/docs-react):<DocsCanvas />renders a top progress bar (role="progressbar") during streaming,DocsPageControlsshowsPage X of Y…until layout completes, and<FOfficeDocs />exposesonProgressandonPagesChange.
Viewer & Theme Fixes
- Forward
DocsProvidertheme to Radix portals and scope:root[data-theme]fallbacks and print styles cleanly when embedded. - Apply
zoom="fit-width"/zoom="fit-page"before"open"fires on<f-office-docs>and keep the floating outline toggle hidden underchrome="none"unlessoutline-button/outlineButtonis opted in.
DOCX Layout Fidelity
- Support
w:beforeLines/w:afterLinesparagraph spacing. - Honor
layoutInCelland VMLo:allowincellfor page-relative floating drawings inside table cells. - Improve table style
basedOnmargin resolution and East Asian trailing auto-space / punctuation compression handling.
v0.2.2
What's Changed
- New Rust crate
f-office-docs: Interactive DOCX viewport, hit-testing, selection, outline, find, and optionaldatagenbinary (f-office-docs-data) for building ICU4X word-break dictionaries. - New npm package
@f-office/docs-react: Composable React 19 UI primitives (DocsProvider,useDocs,FOfficeDocs,DocsHeader,DocsCanvas,DocsDialogs,DocsApp) with precompiled stylesheet (@f-office/docs-react/styles.css). @f-office/docs@0.2.2: Bundles lazydictionaries.postcard(@f-office/docs/dictionaries), fixes bundler resolution for@f-office/coreinside the Web Worker, adds@f-office/docs/chromehelpers, and verifies Compatifont CDN fonts (https://cdn.compatifont.com/v0.1.2).- Performance & Mobile: Zero-clone
ImageBitmappage transfers, streaming DOCX/PDF I/O, 2-pass progressive draft rendering, smooth pinch zoom, and HiDPI viewport fixes. - DOCX Layout: Numerous Microsoft Word layout fidelity improvements across tables, floating drawings, line spacing, East Asian typography, and style toggle properties.
v0.2.1
Highlights
- Browser & Node.js packaging (
@f-office/core,@f-office/docs):- Split
"browser"and"node"conditional exports in@f-office/coreso browser bundles and Web Workers never importnode:fs/promises. - Fixed
"sideEffects"declarations (["./dist/worker.js"]in@f-office/core,["./dist/element.js"]in@f-office/docs) and added Content Security Policy (CSP) guidance to both READMEs.
- Split
- Whole-document search,
scrollTo, and lazy highlights:- Added worker-backed
Document.search(query, options)over the compactTextMapinf-office-wasm/@f-office/core, returning lightweight{ page, rects, range, snippet }matches without rendering offscreen pages. - Added
FOfficeDocs.search(),scrollTo(page, rect, options), and lazy per-pagesetHighlights()/clearHighlights(kind?)in@f-office/docs(and<f-office-docs>).
- Added worker-backed
- Optional pure-Rust WOFF2 font decoding:
- Added the optional
woff2feature inf-office-fonts(pure Rust viawuff, no C++ dependency), enabled inf-office-wasm/@f-office/coresoRenderer.addFont()transparently decodes.woff2fonts.
- Added the optional
- DOCX layout & PDF writer improvements:
- Restored Type 2 Shading Pattern fills for gradients in the streaming PDF writer and preserved image clips on unrewritable CMYK JPEGs and large pre-
IDATPNG headers. - Improved RTL reading order, East Asian punctuation kerning, inline table wrap clearing, continuous section adoption after empty page breaks, split-row vertical alignment, and blanks-only line heights before manual breaks.
- Restored Type 2 Shading Pattern fills for gradients in the streaming PDF writer and preserved image clips on unrewritable CMYK JPEGs and large pre-
F-Office v0.2.0
Memory efficiency, streaming PDF export, zero-copy browser file I/O, and the new @f-office/viewer drop-in browser component.
Install
CLI (foffice) — bundles metric-compatible open fonts from Compatifont (OFL-1.1):
# From crates.io
cargo install f-office-cli
# Or via cargo-binstall / prebuilt archives attached to this release
cargo binstall f-office-cli
# Or via Homebrew (macOS and Linux)
brew install osolmaz/tap/fofficeRust library:
cargo add f-officeJavaScript / TypeScript (browser and Node.js):
npm install @f-office/wasm @compatifont/fonts
# Drop-in browser viewer component:
npm install @f-office/viewer @f-office/wasm @compatifont/fontsWhat's new in v0.2.0
- Handle-based lazy images (
ImageRef):Document::opennow reads only image headers for layout dimensions instead of eagerly pinning image byte buffers in memory; rasterization and PDF export decode images on demand behind a bounded LRU cache. - Flat-arena XML, streaming
<w:body>, and compact text index (TextMap):f-office-xml::Documentuses flat arenas and a single string buffer while preserving exact byte spans forfoffice edit;<w:body>top-level blocks stream during layout;Documentretains a compact reading-orderTextMapinstead of fullVec<PlacedLine>. - Streaming PDF export: Replaced in-memory PDF assembly with a streaming
Write-based PDF emitter (Document::write_pdf_to,foffice convert --to pdf, and@f-office/wasmwritePdfTo/ workerwritePdfBlob). - Zero-copy browser & random-access file I/O: Added
RandomAccessRead+Package::open_source/Document::open_source, pluscreateBlobSource(File.slice()/FileReaderSync),createOpfsSource(FileSystemSyncAccessHandle),openDocxFile, andopenDocxOpfsin@f-office/wasmso large DOCX files do not need to be copied into WASM linear memory. - New
@f-office/viewerpackage: Drop-in<f-office-viewer>Web Component andcreateDocxViewer()API with virtualized page scrolling, HiDPI tiledrenderRegionrendering + bounded LRU tile cache, zoom/fit modes, selectable text layer, on-demand@compatifont/fontsloading + worker-recycle font replay, and streaming PDF export. - Layout and graphics fixes: DrawingML
a:grpFillgroup fill inheritance, improved EMF/WMF shape and gradient rendering, math operator spacing fixes, and updated logo spacing.
Notes
- Licensed under Apache-2.0 (bundled Compatifont font files are OFL-1.1).
- Building from source requires Rust 1.100 or newer.
@f-office/wasmuses WebAssembly SIMD (Chrome 91+, Firefox 89+, Safari 16.4+, Node.js 18+).
F-Office v0.1.0
First public release of F-Office, a Rust and WebAssembly engine for laying out, rendering, editing, and visually comparing DOCX documents with Microsoft Word's pagination (word-win).
Install
CLI (foffice) — bundles metric-compatible open fonts from Compatifont (OFL-1.1):
# From crates.io
cargo install f-office-cli
# Or via cargo-binstall / prebuilt archives attached to this release
cargo binstall f-office-cli
# Or via Homebrew (macOS and Linux)
brew install osolmaz/tap/fofficeRust library:
cargo add f-officeJavaScript / TypeScript (browser and Node.js):
npm install @f-office/wasm @compatifont/fontsWhat's included in v0.1.0
- DOCX layout and export: Open DOCX documents and export paginated PDFs and PNG page images (
foffice convert,f-office,@f-office/wasm). - Structured reading and atomic editing: Inspect paragraphs and tables by stable address with page spans (
foffice read) and apply atomic JSON edit lists that report which pages shifted (foffice edit). - Visual diffing: Compare two DOCX files page-by-page and render cropped changed regions (
foffice diff). - WebAssembly engine: Lazy ZIP reading, reusable tiled rendering for mobile memory budgets, Web Worker helper (
@f-office/wasm/worker), and on-demand font loading with@compatifont/fonts. - Prebuilt binaries: macOS (
aarch64,x86_64), Linux (x86_64,aarch64), and Windows (x86_64) archives withSHA256SUMS.txtattached to this release.
Notes
- Licensed under Apache-2.0 (bundled Compatifont font files are OFL-1.1).
- Building from source requires Rust 1.100 or newer.
@f-office/wasmuses WebAssembly SIMD (Chrome 91+, Firefox 89+, Safari 16.4+, Node.js 18+).