{"slug": "reverse-engineered-ms-word-with-pixel-perfect-rendering", "title": "Reverse engineered MS Word with pixel perfect rendering", "summary": "Onur Solmaz released F-Office, an open-source Rust library on crates.io that renders Microsoft Word DOCX files with page layouts matching Word's own, built as a black-box implementation from scratch without Microsoft code. F-Office draws documents using compatifont's open fonts, which carry the widths of fonts like Calibri, Aptos and Times New Roman so lines break in the same places, and it exposes each paragraph, table, row and cell by address so AI agents can submit edits that apply all-or-nothing. The engine, its command-line tool and the fonts are on GitHub, with headless `@f-office/core` and `@f-office/docs` packages on npm; the project states its API can still change at any time, and Excel and PowerPoint support is planned.", "body_md": "## \n [Rust library](#rust)\n\nThe 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.\n\n```\ncargo add f-office\njs\nuse f_office::{Document, FontDatabase, Options};\n\nlet mut fonts = FontDatabase::new();\nfonts.add_files(&[\"fonts/TinosCF-Regular.ttf\".into()])?;\nlet docx = std::fs::read(\"report.docx\")?;\nlet document = Document::open(&docx, &fonts, &Options::default())?.value;\nfor page in document.pages() {\n    println!(\"{:?} by {:?}\", page.width(), page.height());\n}\nstd::fs::write(\"report.pdf\", document.write_pdf(&fonts)?.value)?;\n```\n\nF-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.\n\nF-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.\n\n              A Word document asks for fonts such as Calibri, Aptos or Times New\n              Roman, which only Microsoft may give out. F-Office draws it with\n              [compatifont](https://compatifont.com)'s open fonts instead, and each one has the widths of the font\n              that it stands in for, so the lines break in the same places.\n            \n\nF-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.\n\n                The same Rust code builds for your computer and as WebAssembly\n                for a web page, so a page can draw documents in the browser with\n                no server. The headless engine (`@f-office/core`) and\n                drop-in F-Office Docs component (`@f-office/docs`)\n                are on npm, with\n                [compatifont](https://compatifont.com)'s open fonts (`@compatifont/fonts`).\n              \n\n```\nnpm install @f-office/core @f-office/docs @compatifont/fonts\n```\n\nThe F stands for Free. F-Office is free and open source, so you can use it at work or at home with no fee to pay and no EULA to accept. The engine with its command line tool and the open fonts are on GitHub.\n\nF-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.\n\n| Text, lists, tables, sections, columns, headers, footers, footnotes and fields | Done | \n| PDF files, page images and the browser | Done | \n| Floating pictures, text boxes and shapes that text wraps around | Done | \n| Comments and tracked changes as each Word prints them | Under way | \n| East Asian text | Under way | \n| Charts | Under way | \n| Pages identical to Word's, pixel for pixel, for each Word | Under way | \n| Excel and PowerPoint files | Planned | \n\n`curl -LsSf https://f-office.org/install.sh | sh`\n                F-Office opens, edits, and turns Word documents into PDFs and\n                page images so they look the same as in Microsoft Word. It is a\n                black-box implementation written from scratch in Rust, built by\n                matching Word's own output without using any Microsoft code. You\n                can run it on your computer, use it from your own programs, or\n                [try it right in your browser](./docs).\n              \n\n[Onur Solmaz](https://github.com/osolmaz). It started because Word documents break as soon as they leave\n                Windows, and AI agents need a reliable way to read, edit, and\n                check pages without Microsoft Word installed.\n              \n\nYes. 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.\n\nLibreOffice 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.\n\n                Word documents ask for fonts like Calibri, Aptos, Arial, and\n                Times New Roman that only ship with Windows and Office. F-Office\n                pairs with\n                [Compatifont](https://compatifont.com), a set of free open fonts whose letters take up the exact same\n                widths, so lines break in the same places. If you already have\n                Microsoft's fonts on your computer, F-Office uses those first.\n              \n\nThat 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.\n\nMac, Windows, and Linux computers, as well as any modern web browser. You do not need Windows or a copy of Microsoft Word.\n\n                Word (`.docx`) files today, with Excel and PowerPoint\n                planned next. It works with any AI coding agent that can run\n                terminal commands to read a document, make edits, and check how\n                the pages look before and after.\n              \n\nNo. Everything runs locally on your computer or inside your browser tab, so your documents are never uploaded to a server.\n\nScroll to the bottom", "url": "https://wpnews.pro/news/reverse-engineered-ms-word-with-pixel-perfect-rendering", "canonical_source": "https://f-office.org/", "published_at": "2026-12-05 10:26:30+00:00", "updated_at": "2026-12-05 10:45:15.666737+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools"], "entities": ["F-Office", "Onur Solmaz", "Microsoft Word", "compatifont", "Rust", "crates.io", "npm", "GitHub"], "also_reported_by": [], "takeaway": "F-Office's Rust engine and npm packages (`@f-office/core`, `@f-office/docs`) let an agent address each paragraph, table, row and cell, apply a batch of edits all-or-nothing, and receive the changed pages rendered as images or PDF.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/reverse-engineered-ms-word-with-pixel-perfect-rendering", "markdown": "https://wpnews.pro/news/reverse-engineered-ms-word-with-pixel-perfect-rendering.md", "text": "https://wpnews.pro/news/reverse-engineered-ms-word-with-pixel-perfect-rendering.txt", "jsonld": "https://wpnews.pro/news/reverse-engineered-ms-word-with-pixel-perfect-rendering.jsonld"}}