@qrcommunication/gigapdf-lib 0.110.1 → 0.110.3

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,46 @@ project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.110.3] - 2026-06-30
10
+
11
+ ### Fixed — CFF advance widths (`extractWebFont` no longer jams text in the browser)
12
+
13
+ - `CffFont::advance_width` — and therefore the OpenType `hmtx` that `cff_to_otf`
14
+ builds for `extractWebFont` — now reads the CFF Private DICT **`nominalWidthX`**
15
+ (op 21) and **`defaultWidthX`** (op 20) instead of using `units_per_em * 0.5`
16
+ as a one-size base for every glyph. A CFF/Type1 subset of a standard base font
17
+ (e.g. **`Times-Bold`**) previously got a near-zero space advance
18
+ (`500 + (250 − 718) = 32`) and wrong letter advances, so a host rendering the
19
+ extracted web font in a browser **jammed every word together** (the CERFA
20
+ "DEMANDEDERATTACHEMENT…" garbling). PDF rasterisation (which uses the PDF
21
+ `/Widths` array) was unaffected — only the browser-loadable web font's metrics
22
+ were wrong; `extractWebFont` (0.110.0) was the first consumer of `advance_width`
23
+ for actual rendering, which is why the latent bug only surfaced then.
24
+ - `advance = nominalWidthX + operand` when a charstring carries a width operand,
25
+ `defaultWidthX` otherwise; per-FD for CID-keyed / CFF2 fonts (keyed by FDSelect).
26
+ Regression test: `cff_width_distinguishes_nominal_from_default_width_x`.
27
+
28
+ ## [0.110.2] - 2026-06-30
29
+
30
+ ### Added — `ocr_serve`: persistent host-side OCR microservice
31
+
32
+ - New `gigapdf-ocr-rten` binary **`ocr_serve`** + `OcrEngine::rec_names()`. It loads the
33
+ PaddleOCR-on-RTen models **once** at boot and serves recognition over a minimal local
34
+ HTTP/1.1 endpoint (zero web-framework dependency — `std::net` only): `GET /health`
35
+ (`{ok,recCount,languages}`) and `POST /ocr` (PNG body, optional `X-Ocr-Model` header for a
36
+ forced recognizer; auto per-line script selection otherwise) → NDJSON words in image pixel
37
+ space (`{text,x,y,w,h,confidence,model}`). This is the "host-side endpoint" the lean wasm
38
+ client calls — amortizing the multi-hundred-MB model load across requests instead of per call.
39
+ The `ocr_serve` binary and the assembled `.rten` model set are distributed as GitHub
40
+ **release assets** for host deployment (not part of the npm package).
41
+
42
+ ### Fixed — npm package no longer bundles the legacy `.gpocr` models
43
+
44
+ - `0.110.1` accidentally bundled the 22 legacy `.gpocr` OCR weights into the npm tarball. Those
45
+ belong to the **removed** client-side recognizer (≤0.63.x); `0.110.x` does OCR **host-side**
46
+ via `gigapdf-ocr-rten` (RTen `.rten` models), so the `.gpocr` files are dead weight in the
47
+ package. The release pipeline no longer fetches/bundles them — the npm package is lean again.
48
+
9
49
  ## [0.110.1] - 2026-06-30
10
50
 
11
51
  ### Fixed — releases now ship the OCR `.gpocr` models again
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.1",
3
+ "version": "0.110.3",
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",
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file