@qrcommunication/gigapdf-lib 0.110.4 → 0.112.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,54 @@ project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.112.0] - 2026-07-01
10
+
11
+ ### Fixed — per-word tiling for space-justified & `Td`-positioned runs (footers now overlay-faithful)
12
+
13
+ `run_layout` previously split a run into positioned `segments` only at large `TJ`
14
+ kern jumps. A run justified by **word spacing** (`Tw`) or **wide space glyphs** —
15
+ or one whose words are placed by separate `Td` moves with wide leading gaps (a
16
+ CERFA-style legal footer) — stayed a single long box, so a host painting one
17
+ editable box per run rendered its glyphs at the browser's natural (non-justified)
18
+ advance: the text drifted and collided with the neighbouring runs.
19
+
20
+ Now **any positioned run** — one carrying a real `TJ` jump **or** a space wider
21
+ than half an em — is split at **word boundaries**, each word tiling at its exact
22
+ rasterizer pen `x`. Every space (a normal one or a wide justification gap) tiles
23
+ as an inter-segment **gap**, never inside a word box, and a **leading** gap is
24
+ folded so a lone word after it (e.g. a footer's `" financière"`) lands at its true
25
+ pen `x` instead of drifting left. Single-word positioned runs now emit their one
26
+ fragment too (the run box alone would sit at the pre-gap pen). Whitespace is
27
+ detected by the decoded glyph, so a font whose space isn't byte `0x20` still tiles
28
+ per word. Plain natural-flow runs (no jump, only normal spaces) stay a single
29
+ inline-editable box — byte-identical.
30
+
31
+ Result: a justified small-print legal footer reproduces the rasterizer
32
+ word-for-word in an editable overlay.
33
+
34
+ ## [0.111.0] - 2026-07-01
35
+
36
+ ### Added — per-run text `segments` for pixel-faithful editable overlays (`TextElementInfo.segments`)
37
+
38
+ `page_text_elements` / `textElements(page)` now return, for each **justified or
39
+ per-glyph-positioned run** (a legal footer, a spread-out table cell), its
40
+ visually contiguous **`segments`** — each with its own text and page-space box.
41
+ A run drawn as ONE `Tj`/`TJ` but with large internal `TJ` position jumps used to
42
+ collapse those jumps to literal spaces, so a host that painted one editable box
43
+ per run tiled it wrong (fragments overlapped / drifted). Each segment is now
44
+ positioned from the **same pen walk the rasterizer uses** — real glyph widths
45
+ (`/Widths`·`/W`) plus `Tc` (char spacing), `Tw` (word spacing), `Tz` (horizontal
46
+ scale) and `TJ` kerns — so a host paints one box per fragment, 1:1 with the
47
+ render, while still editing the whole run via its `index`. `segments` is **empty**
48
+ for a plain run (its own `x`/`y`/`width` already position it), so the common case
49
+ is unchanged.
50
+
51
+ Internally the content-stream extractor now tracks `Tc`/`Tw`/`Tz` and derives
52
+ each horizontal LTR run's advance from that exact pen walk (a single source of
53
+ truth shared by the run's own box, the next run's start position, and the
54
+ segments), fixing sub-point inter-run drift on spaced/scaled text. Byte-identical
55
+ for content without spacing operators or internal jumps.
56
+
9
57
  ## [0.110.4] - 2026-06-30
10
58
 
11
59
  ### Fixed — repacked CIDFont subset web-font cmap (`extractWebFont` no longer garbles labels)