@qrcommunication/gigapdf-lib 0.110.2 → 0.110.4

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,50 @@ project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.110.4] - 2026-06-30
10
+
11
+ ### Fixed — repacked CIDFont subset web-font cmap (`extractWebFont` no longer garbles labels)
12
+
13
+ - `extract_font_for_web` now **rebuilds** the served `cmap` for a Type0/CIDFontType2
14
+ subset (e.g. `ECYBWA+TimesNewRoman`) from the **authoritative** `code → CID → gid`
15
+ mapping (the same one the rasterizer uses) + the font's `/ToUnicode` (ASCII gaps
16
+ affine-filled via `infer_ascii_gaps`) + the embedded program's `gid → Unicode` —
17
+ instead of trusting the subset's **stale** embedded `(3,1)` cmap, which maps each
18
+ Unicode to the original, now-blanked glyph id (the real outlines sit at the gids
19
+ reached only by `code → CID → gid`). A repacked subset previously rendered its
20
+ text as garbage in a host browser (e.g. "Nom et adresse de l'organisme" →
21
+ "Nç ê Dçê D ê"); the cmap is now rebuilt **even when** the subset already has a
22
+ Unicode cmap, and only the embedded cmap is kept when the rebuild is empty. PDF
23
+ rasterisation (`code → CID → gid`) was always correct. Non-repacked subsets keep
24
+ their correct cmap — no regression.
25
+ - New `TrueTypeFont::post_name_to_gid()` / `glyph_is_empty()` and
26
+ `encoding::standard_mac_glyph_name()` back an authoritative TrueType `post`
27
+ name→gid resolver for simple-font subsets. Test:
28
+ `repacked_cid_subset_serves_real_glyphs` (skips unless `GIGAPDF_REPACKED_CID_FIXTURE`
29
+ points at a repacked-CID PDF — the reproducing CERFA carries PII and is not committed).
30
+ - Known limitation: a few non-ASCII Latin accents (`è`/`à`/`ç`) absent from a
31
+ subset's `/ToUnicode` and off the affine ASCII layout may stay unmapped; `é` and
32
+ all ASCII render correctly.
33
+
34
+ ## [0.110.3] - 2026-06-30
35
+
36
+ ### Fixed — CFF advance widths (`extractWebFont` no longer jams text in the browser)
37
+
38
+ - `CffFont::advance_width` — and therefore the OpenType `hmtx` that `cff_to_otf`
39
+ builds for `extractWebFont` — now reads the CFF Private DICT **`nominalWidthX`**
40
+ (op 21) and **`defaultWidthX`** (op 20) instead of using `units_per_em * 0.5`
41
+ as a one-size base for every glyph. A CFF/Type1 subset of a standard base font
42
+ (e.g. **`Times-Bold`**) previously got a near-zero space advance
43
+ (`500 + (250 − 718) = 32`) and wrong letter advances, so a host rendering the
44
+ extracted web font in a browser **jammed every word together** (the CERFA
45
+ "DEMANDEDERATTACHEMENT…" garbling). PDF rasterisation (which uses the PDF
46
+ `/Widths` array) was unaffected — only the browser-loadable web font's metrics
47
+ were wrong; `extractWebFont` (0.110.0) was the first consumer of `advance_width`
48
+ for actual rendering, which is why the latent bug only surfaced then.
49
+ - `advance = nominalWidthX + operand` when a charstring carries a width operand,
50
+ `defaultWidthX` otherwise; per-FD for CID-keyed / CFF2 fonts (keyed by FDSelect).
51
+ Regression test: `cff_width_distinguishes_nominal_from_default_width_x`.
52
+
9
53
  ## [0.110.2] - 2026-06-30
10
54
 
11
55
  ### Added — `ocr_serve`: persistent host-side OCR microservice
package/gigapdf.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrcommunication/gigapdf-lib",
3
- "version": "0.110.2",
3
+ "version": "0.110.4",
4
4
  "description": "TypeScript SDK for gigapdf-lib — a Rust→WASM document engine with no third-party PDF/Office/image library: read/edit/render, OCR, full-text search, AcroForm fields (read · fill · create), annotations, signing, encryption, PDF↔Office/HTML/RTF conversions, and a native HTML+CSS→PDF renderer with inline JavaScript (no headless browser). Cryptography uses audited RustCrypto; JavaScript uses the Boa engine; everything else is pure Rust. Single wasm-bindgen-free .wasm with one host import (entropy).",
5
5
  "license": "PolyForm-Noncommercial-1.0.0",
6
6
  "author": "Rony Licha / QR Communication",