Download Latest Version openpublisher5g_amd64-windows.exe (81.1 MB)
Home / 5.9.3
Name Modified Size InfoDownloads / Week
Parent folder
5.9.3_ Printed Text Background Sub-Pixel Stride _ Visual Parity source code.tar.gz 2026-10-17 23.3 MB
5.9.3_ Printed Text Background Sub-Pixel Stride _ Visual Parity source code.zip 2026-10-17 23.6 MB
README.md 2026-10-17 7.1 kB
OpenPublisher5-i386-windowsXP.exe 2026-10-17 56.5 MB
openpublisher5_amd64-windows-portable.exe 2026-10-17 183.2 MB
openpublisher5_amd64-windows.exe 2026-10-17 165.2 MB
openpublisher5_amd64-macos.dmg 2026-10-17 233.1 MB
openpublisher5_amd64-linux.run 2026-10-17 193.4 MB
openpublisher5_amd64-linux.rpm 2026-10-17 215.4 MB
openpublisher5_amd64-linux.flatpak 2026-10-17 153.6 MB
openpublisher5_amd64-linux.deb 2026-10-17 156.2 MB
openpublisher5_amd64-linux.AppImage 2026-10-17 166.4 MB
openpublisher5_amd64-freebsd.pkg 2026-10-17 185.5 MB
Totals: 13 Items   1.8 GB 0

πŸš€ Summary

Version 5.9.3 establishes exact sub-pixel visual and geometric parity between the Open Publisher editor and the print/PDF rendering engine for multi-line text with inline CSS background styling (such as Discord address blocks and highlighted text).

Specifically, v5.9.3 resolves three discrepancies between the editor and print output:

  1. Exact 1-2px Inter-Line Gap: Measures the live inline glyph box height ($C$) and line-to-line vertical stride ($L$) from getClientRects() prior to segmentation, producing the exact 1-2px inter-line separation ($G = L - C$) shown in the editor rather than an oversized 3-4px gap.
  2. Zero Cumulative Vertical Offset: Enforces the strict mathematical invariant stripHeight + lineGap === lineStride ($C + G \equiv L$) across all segmented rows. Because the sum of each block strip's height and its bottom margin equals the original line stride down to sub-pixel precision, multi-line text blocks maintain zero cumulative vertical drift even when hundreds of lines are pasted.
  3. Sharp Corners & Exact Width Parity: Eliminates artificial default border-radius (2px) and artificial default horizontal/vertical padding (1px 3px). Segmented strips now default strictly to border-radius: 0px and padding: 0px (only preserving radius or padding if explicitly present on the source element in the editor).

πŸ” Root Cause Analysis & Architecture Solution

1. Why Previous Attempts Drifted Vertically or Had Oversized Gaps

  • In the live browser editor, multi-line inline elements (<span> with background color) are laid out by Chromium's inline formatting context. The background color is painted behind the inline content box of height $C = \text{ascent} + \text{descent}$ (e.g. ~17px), while lines advance vertically by line-height $L$ (e.g. ~18.5px). This creates a natural 1-2px transparent gap ($G = L - C \approx 1.5\text{px}$) between lines while maintaining a top-to-top line stride of $L$.
  • When converting each line into a display: block element for html2canvas, a standard block's height expands from the inline content height $C$ to the full line-height $L$.
  • In v5.9.2, leaving each block at height $L$ with 0px margin gave the right vertical stride ($L$), but caused all background strips to touch (0px gap).
  • Adding margin and vertical padding on top of a block whose height was already $L$ increased the per-line stride to $L + \text{padding} + \text{margin}$, creating both an oversized 3-4px visual gap and a cumulative downward offset of ~5px per line.

2. Pre-Split Inline Metric Measurement (measureInlineBgMetrics)

  • Before modifying the DOM of a candidate inline background element (bgEl), measureInlineBgMetrics(bgEl) inspects bgEl.getClientRects() while it is still rendered as a native inline element in the staging DOM (accounting for any container scale factor scaleX / scaleY):
  • Groups client rects by visual line (top within 2.5px).
  • Computes inlineHeight ($C$) as the mean height of the inline line rects.
  • Computes lineStride ($L$) as the mean top-to-top step between consecutive single-spaced lines.
  • Computes the natural inline gap rawGap = lineStride - inlineHeight, clamped to the editor's [1.25px, 2.0px] range (1-2px).

3. Zero-Drift Sub-Pixel Block Formatting (splitInlineBackgroundAtBr)

  • For each segmented line $k$:
  • stripHeight = targetStride - lineGap
  • line.style.height = stripHeight.toFixed(2) + 'px'
  • line.style.lineHeight = stripHeight.toFixed(2) + 'px'
  • line.style.marginTop = '0px'
  • line.style.marginBottom = lineGap.toFixed(2) + 'px'
  • line.style.paddingTop = '0px' and line.style.paddingBottom = '0px'
  • line.style.paddingLeft = padLeft + 'px' and line.style.paddingRight = padRight + 'px' (defaulting to 0px)
  • line.style.borderRadius = origRadius (defaulting to '0px')
  • Because stripHeight + lineGap is identically equal to targetStride ($L$), line $k$ always begins at $k \times L$, matching the editor with 0.00px cumulative offset across any number of lines.

πŸ“ Files Modified in 5.9.3

File Changes
extensions/print-engine.js Added measureInlineBgMetrics and updated splitInlineBackgroundAtBr and splitSoftWrappedInlineBackground to enforce stripHeight + lineGap === lineStride, 1-2px inter-line gap, 0px default corner radius, 0px default padding, and sub-pixel width locking. Bumped header to (v5.9.3).
index.html Updated all script, stylesheet, and asset cachebuster queries in <head> and <body> from ?v=5.9.2 to ?v=5.9.3.
sw.js Updated Service Worker cache namespace to open-publisher-v5-9-3 and header to (v5.9.3).
elements/text/text.js Bumped header comment to (v5.9.3).
core/core.js Bumped header comment to (v5.9.3).
core/boot.js Bumped header comment to (v5.9.3).
extensions/legacy-fixes.js Bumped header comment to (v5.9.3).
extensions/ui-interactions.js Bumped header comment and initialization log to (v5.9.3).
ui/menus.js Bumped header comment to (v5.9.3).
ui/sidebar-context.js Bumped header comment to (v5.9.3).
ui/modals/card-sheet-modal.js Bumped header comment to (v5.9.3).
ui/modals/options-modal.js Bumped header comment to (v5.9.3).
tools/proofing/spellcheck-engine.js Bumped header comment to (v5.9.3).

wrapper.html was not modified.


βœ… v5.9.3 Verification Checklist

  • [x] Exact 1-2px Inter-Line Gap: Verified that printed text background strips exhibit the exact 1-2px inter-line separation (lineStride - inlineHeight) shown in the live editor.
  • [x] Zero Cumulative Vertical Offset: Confirmed that stripHeight + lineGap === lineStride holds for every segmented line, preventing vertical drift across long multi-line text blocks.
  • [x] No Artificial Rounded Corners: Confirmed origRadius defaults to '0px', preserving crisp 90-degree corners matching the editor.
  • [x] No Artificial Horizontal or Vertical Padding: Confirmed padLeft, padRight, paddingTop, and paddingBottom default to 0px.
  • [x] Sub-Pixel Line Width Preservation: Verified each line retains its exact shrink-wrapped sub-pixel width (finalW.toFixed(2) + 'px') scaled to local coordinates.
  • [x] Text Box Fills & Gradients Intact: Confirmed actual text box backgrounds, fills, and gradients on .element-content remain completely unaffected.
  • [x] Shapes & Theme Elements Untouched: Verified vector shapes, border art, and theme elements remain strictly excluded from segmentation.
  • [x] Service Worker & Cachebuster Sync: Verified sw.js cache name is open-publisher-v5-9-3 and asset queries across index.html reference ?v=5.9.3.
  • [x] Subsystem Version Consistency: Confirmed all modified subsystems and modules reflect version 5.9.3.

πŸŽ‰ Version 5.9.3: Open Publisher

Source: README.md, updated 2026-10-17