[go: up one dir, main page]

F-Office

F-Office: A drop-in replacement for Microsoft Word, for the agentic era

F-Office is a DOCX editor for AI agents as well as humans that lays out each page the way Microsoft Word does. The page below is drawn by F-Office in Tinos CF (the open font with the same layout as Times New Roman), and the slider over it shows Word's own page of the same file.

The title page as F-Office draws it
The same page as Microsoft Word draws it

Pages laid out as Word lays them out.

F-Office follows Word's rules for lines, paragraphs, lists, tables and pictures. The documents below are real ones in the fonts that Word documents use most, with Word's page to the left of the line and F-Office's page of the same file to the right.

F-Office's page of the document
Word's page of the document

The pages did not load.

Drag the line to compare. The same rasterizer drew both pages, so each pixel can be compared. With open fonts, F-Office's page uses compatifont's fonts, whose letters are as wide as those of Word's fonts, so every line breaks in the same place. Want to compare your own file against Word? Try Fidelity Check.

Same line breaks with open fonts.

A Word document asks for fonts such as Calibri, Aptos or Times New Roman, which only Microsoft may give out. F-Office draws it with compatifont's open fonts instead, and each one has the widths of the font that it stands in for, so the lines break in the same places.

compatifont SIL Open Font License 1.1

Celeborn CF

Stands in for Calibri 12,188 of 12,188 widths equal

Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz 0123456789

Each letter is as wide as the same letter of the font that it stands in for, so every line of a document breaks in the same place. Type here to try it.

x = − b ± b2 − 4 a c 2a ∫ −∞ ∞ e − x2 d x = π ∑ n=1 ∞ 1 n2 = π2 6

α β γ δ π Σ Ω ∞ ≤ ≥ → ← ✓ ✂ ✈ ⌛ ☼ ❄ ☺ ★ ♥ ♦ ♣ ♠ ● ■ ▲ ◆

The font did not load.

Pick a font to load it, and type in the sample to try it. compatifont measured each font against the font that Windows and Office install.

Agents edit Word files and check the pages.

F-Office gives each paragraph, table, row and cell of a document an address. An agent sends a list of edits by address, F-Office makes all of them or none, and then it shows the agent the pages that changed.

F-Office's page of the report
edits.json All or none
  1. {"op": "comment", "at": "p1",
     "text": "Check the sums."}
  2. {"op": "replace", "at": "p8",
     "find": "6500 eur", "with": "6600 eur"}
  3. {"op": "set-text", "at": "t1/r3/c3",
     "text": "0,00 €"}
  4. {"op": "insert-row-after", "at": "t1/r4",
     "cells": ["SPOLU/rok", "3723,00 €", "1027,68 €"]}
The page is the report from above, drawn by F-Office. Point at an edit to see the block that it changes.

Rust library

The engine is a Rust library on crates.io. A program opens a file once and then takes its pages for its own drawing code, as images or as a PDF file.

cargo add f-office
use f_office::{Document, FontDatabase, Options};

let mut fonts = FontDatabase::new();
fonts.add_files(&["fonts/TinosCF-Regular.ttf".into()])?;
let docx = std::fs::read("report.docx")?;
let document = Document::open(&docx, &fonts, &Options::default())?.value;
for page in document.pages() {
    println!("{:?} by {:?}", page.width(), page.height());
}
std::fs::write("report.pdf", document.write_pdf(&fonts)?.value)?;

Native and in the browser

The same Rust code builds for your computer and as WebAssembly for a web page, so a page can draw documents in the browser with no server. The headless engine (@f-office/core) and drop-in F-Office Docs component (@f-office/docs) are on npm, with compatifont's open fonts (@compatifont/fonts).

npm install @f-office/core @f-office/docs @compatifont/fonts

Status

F-Office is early work, and its API can still change at any time. It renders Word documents today, and the other Office files will follow.

Text, lists, tables, sections, columns, headers, footers, footnotes and fields Done
PDF files, page images and the browser Done
Floating pictures, text boxes and shapes that text wraps around Done
Comments and tracked changes as each Word prints them Under way
East Asian text Under way
Charts Under way
Pages identical to Word's, pixel for pixel, for each Word Under way
Excel and PowerPoint files Planned

Install F-Office and open a DOCX file.

curl -LsSf https://f-office.org/install.sh | sh

FAQ

What is F-Office?

F-Office opens, edits, and turns Word documents into PDFs and page images so they look the same as in Microsoft Word. It is a black-box implementation written from scratch in Rust, built by matching Word's own output without using any Microsoft code. You can run it on your computer, use it from your own programs, or try it right in your browser.

Who built F-Office?

Onur Solmaz. It started because Word documents break as soon as they leave Windows, and AI agents need a reliable way to read, edit, and check pages without Microsoft Word installed.

Is it free?

Yes. F-Office and its open fonts are free and open source. You can use them for personal work, open source projects, or commercial products with no fees and no Microsoft license.

How is it different from LibreOffice?

LibreOffice uses its own page layout rules, so Word documents often shift onto different lines and pages when you open them there. F-Office is built to match Microsoft Word's line breaks and page breaks, and it is small enough to run from the terminal, inside an app, or in a browser tab.

How does it work without Windows fonts?

Word documents ask for fonts like Calibri, Aptos, Arial, and Times New Roman that only ship with Windows and Office. F-Office pairs with Compatifont, a set of free open fonts whose letters take up the exact same widths, so lines break in the same places. If you already have Microsoft's fonts on your computer, F-Office uses those first.

Is it really pixel-perfect with Word?

That is the goal. With the same fonts, pages on supported features already match Word down to the line and pixel. Complex parts like charts, tracked changes, and East Asian scripts are still in progress. Whenever a font or feature has to be approximated, F-Office tells you instead of quietly shifting the page.

Which systems does it run on?

Mac, Windows, and Linux computers, as well as any modern web browser. You do not need Windows or a copy of Microsoft Word.

Which files and agents does it work with?

Word (.docx) files today, with Excel and PowerPoint planned next. It works with any AI coding agent that can run terminal commands to read a document, make edits, and check how the pages look before and after.

Do my files leave my machine?

No. Everything runs locally on your computer or inside your browser tab, so your documents are never uploaded to a server.