| Name | Modified | Size | Downloads / 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:
- 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. - 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. - Sharp Corners & Exact Width Parity: Eliminates artificial default
border-radius(2px) and artificial default horizontal/vertical padding (1px 3px). Segmented strips now default strictly toborder-radius: 0pxandpadding: 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 byline-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: blockelement forhtml2canvas, a standard block's height expands from the inline content height $C$ to the fullline-height$L$. - In v5.9.2, leaving each block at height $L$ with
0pxmargin gave the right vertical stride ($L$), but caused all background strips to touch (0pxgap). - 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)inspectsbgEl.getClientRects()while it is still rendered as a native inline element in the staging DOM (accounting for any container scale factorscaleX/scaleY): - Groups client rects by visual line (
topwithin2.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 - lineGapline.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'andline.style.paddingBottom = '0px'line.style.paddingLeft = padLeft + 'px'andline.style.paddingRight = padRight + 'px'(defaulting to0px)line.style.borderRadius = origRadius(defaulting to'0px')- Because
stripHeight + lineGapis identically equal totargetStride($L$), line $k$ always begins at $k \times L$, matching the editor with0.00pxcumulative 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 === lineStrideholds for every segmented line, preventing vertical drift across long multi-line text blocks. - [x] No Artificial Rounded Corners: Confirmed
origRadiusdefaults to'0px', preserving crisp 90-degree corners matching the editor. - [x] No Artificial Horizontal or Vertical Padding: Confirmed
padLeft,padRight,paddingTop, andpaddingBottomdefault to0px. - [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-contentremain 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.jscache name isopen-publisher-v5-9-3and asset queries acrossindex.htmlreference?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