Skip to content

About

RustPad is a fast, standalone, offline-first native desktop document studio built 100% in Pure Rust — zero web server, zero HTML/CSS/JavaScript, zero WebView, and zero external runtime bloat.

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

 
 

Repository files navigation

RustPad Studio v3.0.13 — Native, Inline Math Library & Pure Offline Word/PDF Suite

committers.top badge Release v3.0.13 Zero Crates.io Deps Live Showcase Portfolio

RustPad Studio (rustpad) v3.0.13 is a native, sovereign, zero-dependency (0 external crates.io crates) desktop & CLI document intelligence engine written in 100% pure Rust. Built directly on native Win32 GDI + Windows 11 DWM & Linux X11 with a custom TrueType (.ttf) 4×4 supersampled rasterizer, 83+ classical multi-span inline math templates (Alt+= / /math), non-blocking LazyZipArchive 100+ MB .docx streaming parser, OOXML validator & corrupt-archive repair engine, character/paragraph redline & conflict-aware 3-way .docx smart merger, permanent .docx redactor plus modeled-content PDF redaction tools, and pure-Rust offline OCR — shipping as a ~4.1 MB standalone native executable (< 90 ms cold start, 0 Electron/Chromium/WebView bloat, no bundled AI agent, no telemetry).

Portfolio Case Study: nour-yahyaoui.vercel.app/projects/rustpad · Interactive Studio Showcase: rustpad-studio.vercel.app · Latest Release (v3.0.13): GitHub Releases

RustPad v3.0 Word Studio — Smooth Native Canvas, Dark Mode, Inline Math & Track Changes


Download v3.0.13 Prebuilt Native Binaries

Platform Architecture Artifact
Windows 10 / 11 x86_64 (Win32 GDI + DWM Dark Titlebar + Zero Console Window + Spooler) rustpad-v3.0.13-windows-x86_64.exe · rustpad.exe
Linux Desktop & CLI x86_64 (dlopen X11 _GTK_THEME_VARIANT + CUPS/LP + Headless CLI) rustpad-v3.0.13-linux-x86_64
SHA-256 Checksums Cryptographic release manifest (windows + linux) SHA256SUMS.txt

What's New in v3.0.13 — Pure Offline Document, Math & PDF Engine (Zero AI Agent Integration)

  • 100% AI-Free Offline Core: Removed all AI agent modules (ai_agent), HTTP/WinHTTP client bridges, the right-side AI Dock (Ctrl+J), floating selection "AI Polish", and rustpad ai CLI subcommands so RustPad operates without the bundled AI agent or its HTTP/WinHTTP integration. Core document editing is local/offline; operating-system services (for example printing) may still use system facilities.
  • Streamlined Studio Header & Home Launchpad: Replaced AI controls on the Home Hub with 1-click access to the Inline Math Library (Alt+= / Ctrl+Shift+L) and tightened the contextual selection toolbar to pure typography & review controls (B, I, U, Highlight, Ink, +Note).

What's New in v3.0.12 — Zero Windows Console Window + Linear Algebra & Probability Math Pack

  • Pure Win32 GUI Subsystem (windows_subsystem = "windows" + CREATE_NO_WINDOW): Launching rustpad.exe on Windows no longer opens or keeps a background cmd.exe console window open, while CLI subcommands (rustpad --version, rustpad convert, etc.) automatically attach to an existing PowerShell/cmd terminal via AttachConsole(ATTACH_PARENT_PROCESS).
  • 83+ Inline Math Templates (LinearAlgebra & Probability Expansion): Added 24 ready-to-insert inline Linear Algebra and Probability/Statistics formulas (Dot Product, L1/L2/Frobenius Norms, Cosine Similarity, Ax = b, Matrix Product, Eigenvalues, SVD, QR/Cholesky, OLS, Orthogonal Projection, Cauchy–Schwarz, Kronecker/Hadamard, Bayes' Theorem, Conditional/Total Probability, Expectation, Variance, Correlation, Gaussian PDF, Z-Score/CI, Binomial/Poisson PMF, MLE, Chebyshev).

What's New in v3.0.11 — Core Inline Math Function & Formula Library (Ctrl+Shift+L / /math)

  • Searchable Inline Math Template Picker (Ctrl+Shift+L, Alt+=, Ribbon ∑ Math, /math): Added doc_model::math_library with 50+ ready-to-insert inline mathematical building blocks, algebraic identities, trigonometric formulas, calculus derivatives/integrals/series, and Greek/domain symbols (∑, ∏, ∫, ∮, √, ∇, ∂, ℝ, ℤ, ℕ, ℚ, ℂ, ∀, ∃, ⇒, ⇔) that insert as classical multi-span TextSpans (SerifItalic variables + real <w:vertAlign> superscript/subscript bounds) fitting naturally inside prose line height with automatic clean-prose style continuation.
  • TrueType Math Symbol Fallback (FontBook::face_for_char): Non-ASCII mathematical glyphs absent from Serif or Mono slots automatically fall back to Sans vector outlines with zero missing-glyph boxes.

What's New in v3.0.1 — Rich-Span Typography, Inline Typing Styles & PDF AFM Calibration

  • Adobe Standard-14 AFM PDF Metrics & Calibrated PDF Viewer: Replaced coarse average-glyph width approximations and .trim() space stripping in pdf_create / pdf_engine / pdf_view with official per-codepoint Adobe AFM width tables (Helvetica, Helvetica-Bold, Times-Roman, Times-Bold, Courier) and calibrated Surface::draw_text_to_width rendering — eliminating missing inter-span spaces, truncated underlines, and overlapping runs after bold/styled words.
  • 12-Slot TrueType Styling (Bold + Italic + BoldItalic): Expanded FontBook / FontSlot across all (Sans | Serif | Mono) × (Regular | Bold | Italic | BoldItalic) combinations with 4×4 supersampled oblique italic shear and non-zero-winding span-dilated synthetic bold.
  • Word-Style Pending Typing Style & Lossless Span Editing: Toggling Bold, Italic, Underline, Strikethrough, Superscript, Subscript, font family, font size, ink color, or highlight at a caret without a selection now queues pending_typing_style for newly typed text instead of overwriting existing paragraph runs; Enter, Backspace, and Delete preserve all rich TextSpan styles across paragraph splits and merges; rich-span line wrapping, centering, and right-alignment measure per-span glyph advances with sub-pixel precision.

What's New in v3.0.0 — Native Dark Mode & Document Intelligence Upgrade

Native Three-Mode Dark Studio (Ctrl+Shift+D)

  • Three Precision Studio Themes: Toggle effortlessly via the header Moon / Sun Theme Pill, Ctrl+Shift+D, or Command Palette (Ctrl+K) across:
    1. Daylight (Warm Architectural Paper): #FAF8F3 sheet on #ECE8E0 linen desk with terracotta editorial accents.
    2. Midnight (Full Dark Studio): #1B1E24 low-glare slate sheet on #121417 obsidian desk with #E6E8EE crisp chalk typography and #E07A5F warm accents.
    3. Hybrid Dark Desk: #121417 dark studio chrome framing a #FAF8F3 print-true warm paper sheet — zero glare around the margins while preserving 100% WYSIWYG print colors.
  • Zero-Mutation Render-Time Ink Adaptation: Dark Mode never mutates underlying Document or SpanStyle colors in saved .docx / .pdf files. Near-black document ink, table borders, and light cell shading adapt purely at render time (StudioTheme::adapt_doc_ink), while explicit highlights and colored legal redlines remain high-contrast and print/PDF exports stay crisp white paper by default.
  • Native OS Integration & Persistence: Syncs Windows 11 DWMWA_USE_IMMERSIVE_DARK_MODE native titlebars and Linux X11 _GTK_THEME_VARIANT, auto-detects OS dark preference on first boot (Win32 AppsUseLightTheme / GTK_THEME), and persists user choice in ~/.rustpad/theme.conf.

Pillar A — Lossless OOXML Intelligence, Validation & Corruption Repair

  • Zero-Copy Lossless OOXML Passthrough: Unparsed archive entries (word/theme/*, customXml/*, docProps/*, word/embeddings/*, OLE packages, custom styles, unknown relationships) are carried via reference-counted SharedBytes (Arc<[u8]>) without heap duplication and written back byte-for-byte on save.
  • Structural .docx Validator (rustpad validate): Verifies PKZIP Central Directory CRC32 integrity, mandatory [Content_Types].xml & _rels/.rels, XML tag nesting balance, relationship target resolution (word/_rels/document.xml.rels), and cross-linked footnote/endnote/comment IDs.
  • Corrupt / Truncated .docx Salvage Engine (rustpad repair + Auto-Recovery on Open): Scans raw PK\x03\x04 local file headers when Central Directories are truncated or damaged, salvages intact XML/media streams, synthesizes missing OOXML scaffolding, and automatically recovers damaged .docx files on desktop open.
  • Formatting & Security Layer Inspector (Ctrl+Shift+J / Header Shield Icon / rustpad inspect --security --quality): Audits font/heading hierarchy drift, <w:vanish/> hidden text runs, near-white stealth text, external TargetMode="External" hyperlinks/remote template injection, vbaProject.bin macros, embedded OLE objects, and author/company metadata.

Pillar B — Advanced Document Editing & Pagination

  • Rich Typography & Inline Semantics: Superscript (<w:vertAlign w:val="superscript"/>), Subscript (subscript), clickable/preserved <w:hyperlink r:id="..."/> links, <w:vanish/> hidden spans, multi-span styling, and multi-column/shaded 8×8 interactive tables.
  • Section Breaks, First-Page Headers/Footers & Real Pagination: Explicit Block::SectionBreak (NextPage, Continuous, EvenPage, OddPage), <w:titlePg/> (different_first_page) distinct cover headers/footers, and multi-page layout with cached glyph measurement.
  • First-Class Footnotes & Endnotes (word/footnotes.xml & word/endnotes.xml): Insert footnotes and endnotes directly from the toolbar or Command Palette (AddFootnote / AddEndnote); renders superscript reference markers inline and numbered note dividers at page footers / document end in both Word Canvas and Vector PDF exports, with full ECMA-376 XML round-trip.

Pillar C — Character-Level Comparison & Conflict-Aware Smart Merge

  • Multi-Granularity Document Comparison (rustpad compare): Produces structured reports covering paragraph-level edits, character-level inline diffs (--char-level), formatting attribute drift (bold, italic, font, size, color), table shape deltas, and header/footer/note changes.
  • 3-Way Smart .docx Merge (rustpad merge Out.docx Base.docx Ours.docx Theirs.docx): Performs true conflict-aware 3-way .docx merging (automatically fast-forwarding non-overlapping edits from Ours and Theirs while isolating overlapping edits into explicit <<<<<<< OURS / ======= / >>>>>>> THEIRS conflict blocks with ECMA-376 revision metadata), alongside 2-file concatenation.

Pillar D — Permanent Redaction, Metadata Scrubbing & Atomic Privacy

  • Permanent .docx Content Redaction (rustpad redact): Physically scrubs custom terms and detected PII (emails, phones, SSNs, credit cards, IPv4 addresses) across body paragraphs, table cells, headers, footers, footnotes, endnotes, comments, and prior Track Changes history — replacing raw characters with █ blocks so sensitive text never survives in XML.
  • One-Click Privacy & Metadata Cleaner (CleanDocumentPrivacy / rustpad clean-meta): Strips author/company/revision metadata (docProps/core.xml, docProps/app.xml), customXml/*, comments, <w:vanish/> hidden spans, and tracked deletions in one atomic pass.
  • Forensic Secure Atomic Saves (0600): Writes via permission-locked (0600 on Unix) temporary sibling files with sync_all() disk flush before atomic rename so half-written or world-readable temp files never leak sensitive content.

Pillar E — Productivity, WAL Autosave & Quality Audits

  • ** Crash-Safe Periodic WAL Autosave**: Automatically snapshots dirty documents every 45 seconds into SHA-256-verified Write-Ahead Log frames alongside multi-step Undo/Redo and local Version Snapshots (Ctrl+Shift+S).
  • Multi-Surface Search, Duplicate Paragraph & Broken Link Detection: Searches across body, tables, headers/footers, footnotes, endnotes, and comments, and flags duplicate boilerplate clauses and broken internal #anchor / empty external hyperlinks inside the Document Inspector (Ctrl+Shift+J).

Pillar F — HTML5 Export, Pure-Rust Offline OCR, Batch Engine & 19-Command CLI

  • Semantic HTML5 Export (ExportWordToHtml / rustpad convert doc.docx doc.html): Exports clean semantic HTML5 with CSS @media (prefers-color-scheme: dark) support, footnotes/endnotes navigation, tables, redlines (<ins>/<del>), and inline base64 PNG figures.
  • 100% Pure-Rust Offline Bitmap OCR: Built-in zero-dependency connected-component + 8×12 topological feature-grid glyph recognizer (pure_rust_bitmap_ocr_bytes) extracts ASCII text from uncompressed BMP/PNG/PGM scans completely offline, falling back cleanly to local tesseract only when installed for complex camera scans.
  • Crash-Proof 100+ MB .docx Streaming Foundation: Retains LazyZipArchive Central Directory indexing, sub-sliceable SharedBytes, streaming <w:body> pull-parsing, 32 MiB worker threads, and viewport block virtualization so massive .docx archives open smoothly without blocking the UI thread.

18-Command Headless Enterprise & Intelligence CLI

Run rustpad --help on Windows, Linux, or macOS for headless CI/CD, legal ops, and CISO automation:

# 1. Validate OOXML Structure, Audit Security Layers & Salvage Corrupt .docx Archives
rustpad validate Contract.docx
rustpad inspect --security --quality Contract.docx
rustpad repair Truncated_Upload.docx -o Recovered.docx

# 2. Character-Level Legal Redlining, Structural Diff & 3-Way Smart .docx Merge
rustpad compare Base_v1.docx Counterparty_v2.docx
rustpad redline Base_v1.docx Counterparty_v2.docx -o Redline.docx --char-level --author "Legal Ops"
rustpad merge Merged.docx Base_v1.docx Counsel_A.docx Counsel_B.docx

# 3. Permanent .docx Redaction & Strict Metadata / Hidden-Text Privacy Cleaning
rustpad redact Deal.docx -o Deal_Redacted.docx --pii --term "Project Falcon"
rustpad clean-meta Deal_Redacted.docx -o Deal_Clean.docx

# 4. Modeled PDF text redaction, PDF/A-2b metadata & unkeyed SHA-256 integrity digest
rustpad sanitize Exhibit_A.pdf -o Exhibit_Clean.pdf
rustpad sign Exhibit_Clean.pdf -o Exhibit_Sealed.pdf --pdfa  # Adds unkeyed content digest, not a digital signature
rustpad verify Exhibit_Sealed.pdf                    # Checks modeled-content digest only

# 5. Bidirectional Format Conversion (.docx / .pdf / .html / .md / .txt) & Batch Processing
rustpad convert Handbook.docx Handbook.html
rustpad convert Handbook.docx Handbook.pdf
rustpad batch pdf ./contracts_dir -o ./pdf_exports

# 6. Supply-Chain SBOM & MDM Air-Gapped Offline Policy
rustpad sbom -o rustpad-v3.0.13.cdx.json
rustpad policy --init-airgapped .rustpad-policy.json

Nine-Crate Zero-Dependency Workspace

Crate Responsibility External Deps
crates/rustpad_zip LazyZipArchive (Zip64), corrupt ZIP header salvage, CRC32 verifier, bounded DEFLATE/Zlib, RFC 6234 SHA-256 0
crates/doc_model OpenXML AST (DocNote, SectionBreak, DocMetadata), char/paragraph compare & 3-way smart_merge_documents 0
crates/docx_io Streaming <w:body> reader, lossless SharedBytes writer, footnotes/endnotes/hyperlinks, OOXML intelligence & repair 0
crates/pdf_create ISO 32000 PDF 1.7 & PDF/A-2b vector generator, section breaks, footnotes/endnotes, hidden-span suppression, XMP 0
crates/pdf_engine Limited PDF object/text parser, modeled text/annotation redaction, unkeyed SHA-256 /RustPadSeal integrity digest 0
crates/power_tools .docx redactor & metadata cleaner, multi-surface search, batch ops, HTML5 converter, pure-Rust OCR, MDM DLP & SBOM 0
crates/rustpad_render ThemeMode (Daylight/Midnight/HybridDarkDesk), StudioTheme, TrueType 4×4 rasterizer, SDF painter, PNG/JPEG/BMP 0
crates/rustpad_window Native Win32 GDI + DWM Dark Titlebar & Linux X11 _GTK_THEME_VARIANT, HiDPI, clipboard, file dialogs & print spooler 0
app (rustpad) Unified 60–120Hz native desktop studio (98 studio commands) + 18-command headless CLI 0

Engineering Assumptions & Transparent Boundaries

See the Security Review for priority-by-priority status and remaining validation work.

  • Passive Macro & OLE Safety by Design: Embedded vbaProject.bin macros and OLE packages are preserved losslessly on save (or stripped on demand via CleanDocumentPrivacy / clean-meta) and never executed, eliminating macro malware execution vectors.
  • Offline OCR Scope: The built-in pure-Rust bitmap OCR engine recognizes clean high-contrast Latin/ASCII printed bitmaps (BMP/PNG/PGM) with zero external dependencies; skewed multi-language camera scans automatically delegate to a local offline tesseract binary when installed.
  • PDF digest is not a digital signature: /RustPadSeal stores an unkeyed SHA-256 digest of the parser's modeled page geometry, text, and vector rectangles. It can detect changes against a trusted copy, but it does not authenticate the named signer, and an attacker who can rewrite the file can recompute the digest. Use a standards-based certificate-backed PDF digital signature when identity, non-repudiation, or legal signature validation is required.
  • PDF redaction boundary: sanitize_redactions removes intersecting modeled text runs and overlapping modeled annotations. This parser does not model arbitrary image content, form XObjects, or every PDF layer/filter. Do not rely on this feature alone to sanitize arbitrary third-party PDFs for sensitive disclosure; independently inspect/validate the output with a full-featured forensic PDF tool.
  • RTL / Arabic boundary: RTL detection and right alignment exist, but full Unicode Bidirectional Algorithm handling, Arabic contextual shaping, and complete Arabic glyph coverage are not guaranteed by the bundled renderer. Review Arabic output in the target application before publication.

Build & Test From Source

Requires only the standard Rust toolchain (rustc / cargo, zero external system libraries on Windows; libX11 on Linux desktop):

cargo test --workspace
cargo build --release -p rustpad

Windows Code Signing & Privacy Policy

Windows Authenticode code signing for rustpad-studio / rustpad is managed via SignPath.io (certificate by SignPath Foundation).

  • Committers, Reviewers & Approvers: Nour Yahyaoui (@Nour-yahyaoui)
  • Reproducible CI Pipeline: Release artifacts are built exclusively from public source commits via GitHub Actions (.github/workflows/release.yml) with 0 third-party crates.io runtime dependencies. Local/HSM Authenticode signing is also supported via scripts/sign-windows.ps1.
  • Privacy Policy: The v3.0.13 application source removes the bundled AI agent and its HTTP/WinHTTP bridges. Core document editing is local; this statement does not imply that operating-system services such as printing are network-free.

Author & Maintainer

Built and architected from scratch in pure Rust by Nour Yahyaoui (Tunis, Tunisia):

Licensed under the MIT License.

About

RustPad is a fast, standalone, offline-first native desktop document studio built 100% in Pure Rust — zero web server, zero HTML/CSS/JavaScript, zero WebView, and zero external runtime bloat.

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages