@qrcommunication/gigapdf-lib 0.110.3 → 0.111.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.111.0] - 2026-07-01
10
+
11
+ ### Added — per-run text `segments` for pixel-faithful editable overlays (`TextElementInfo.segments`)
12
+
13
+ `page_text_elements` / `textElements(page)` now return, for each **justified or
14
+ per-glyph-positioned run** (a legal footer, a spread-out table cell), its
15
+ visually contiguous **`segments`** — each with its own text and page-space box.
16
+ A run drawn as ONE `Tj`/`TJ` but with large internal `TJ` position jumps used to
17
+ collapse those jumps to literal spaces, so a host that painted one editable box
18
+ per run tiled it wrong (fragments overlapped / drifted). Each segment is now
19
+ positioned from the **same pen walk the rasterizer uses** — real glyph widths
20
+ (`/Widths`·`/W`) plus `Tc` (char spacing), `Tw` (word spacing), `Tz` (horizontal
21
+ scale) and `TJ` kerns — so a host paints one box per fragment, 1:1 with the
22
+ render, while still editing the whole run via its `index`. `segments` is **empty**
23
+ for a plain run (its own `x`/`y`/`width` already position it), so the common case
24
+ is unchanged.
25
+
26
+ Internally the content-stream extractor now tracks `Tc`/`Tw`/`Tz` and derives
27
+ each horizontal LTR run's advance from that exact pen walk (a single source of
28
+ truth shared by the run's own box, the next run's start position, and the
29
+ segments), fixing sub-point inter-run drift on spaced/scaled text. Byte-identical
30
+ for content without spacing operators or internal jumps.
31
+
32
+ ## [0.110.4] - 2026-06-30
33
+
34
+ ### Fixed — repacked CIDFont subset web-font cmap (`extractWebFont` no longer garbles labels)
35
+
36
+ - `extract_font_for_web` now **rebuilds** the served `cmap` for a Type0/CIDFontType2
37
+ subset (e.g. `ECYBWA+TimesNewRoman`) from the **authoritative** `code → CID → gid`
38
+ mapping (the same one the rasterizer uses) + the font's `/ToUnicode` (ASCII gaps
39
+ affine-filled via `infer_ascii_gaps`) + the embedded program's `gid → Unicode` —
40
+ instead of trusting the subset's **stale** embedded `(3,1)` cmap, which maps each
41
+ Unicode to the original, now-blanked glyph id (the real outlines sit at the gids
42
+ reached only by `code → CID → gid`). A repacked subset previously rendered its
43
+ text as garbage in a host browser (e.g. "Nom et adresse de l'organisme" →
44
+ "Nç ê Dçê D ê"); the cmap is now rebuilt **even when** the subset already has a
45
+ Unicode cmap, and only the embedded cmap is kept when the rebuild is empty. PDF
46
+ rasterisation (`code → CID → gid`) was always correct. Non-repacked subsets keep
47
+ their correct cmap — no regression.
48
+ - New `TrueTypeFont::post_name_to_gid()` / `glyph_is_empty()` and
49
+ `encoding::standard_mac_glyph_name()` back an authoritative TrueType `post`
50
+ name→gid resolver for simple-font subsets. Test:
51
+ `repacked_cid_subset_serves_real_glyphs` (skips unless `GIGAPDF_REPACKED_CID_FIXTURE`
52
+ points at a repacked-CID PDF — the reproducing CERFA carries PII and is not committed).
53
+ - Known limitation: a few non-ASCII Latin accents (`è`/`à`/`ç`) absent from a
54
+ subset's `/ToUnicode` and off the affine ASCII layout may stay unmapped; `é` and
55
+ all ASCII render correctly.
56
+
9
57
  ## [0.110.3] - 2026-06-30
10
58
 
11
59
  ### Fixed — CFF advance widths (`extractWebFont` no longer jams text in the browser)