@qrcommunication/gigapdf-lib 0.52.2 → 0.52.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
@@ -4,6 +4,20 @@ All notable changes to `@qrcommunication/gigapdf-lib` are documented here.
4
4
  The format follows [Keep a Changelog](https://keepachangelog.com/) and the
5
5
  project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [0.52.3] - 2026-06-19
8
+
9
+ ### Added
10
+
11
+ - **Bake underline & strikethrough into drawn text.** `addText` /
12
+ `addStandardText` now accept a trailing `opts: { underline?, strikethrough? }`
13
+ (backed by new `add_text_styled` / `gp_add_text_styled`); the rule is painted
14
+ as a filled rectangle that follows the text rotation, its length taken from the
15
+ run's real glyph advances. Existing calls stay byte-identical (flags off).
16
+ - **AVIF (AV1 intra) decode — loop restoration (§7.17 Wiener + SGR) and
17
+ directional intra-edge filtering/upsampling.** Higher-fidelity AVIF decoding;
18
+ the post-deblock / pre-CDEF stripe halo is used for restoration so stripe and
19
+ frame edges are reconstructed correctly.
20
+
7
21
  ## [0.52.2] - 2026-06-19
8
22
 
9
23
  ### Added
package/dist/index.cjs CHANGED
@@ -1226,11 +1226,18 @@ var GigaPdfDoc = class {
1226
1226
  * font's char→glyph map (Identity-H, 2-byte glyph ids). `rgb` is packed
1227
1227
  * `0xRRGGBB`; `rotationDeg` rotates CCW about `(x, y)`. For a built-in base-14
1228
1228
  * family with no embedding, use {@link addStandardText}.
1229
+ *
1230
+ * Pass `opts` to bake **text decorations** into the run: `{ underline: true }`
1231
+ * draws a rule just below the baseline, `{ strikethrough: true }` a rule near
1232
+ * the x-height — both span the run's advance and are filled in the text colour.
1233
+ * Omitting `opts` is fully backward-compatible (no decoration).
1229
1234
  */
1230
- addText(page, x, y, size, text, fontObj, rgb = 0, opacity = 1, rotationDeg = 0) {
1235
+ addText(page, x, y, size, text, fontObj, rgb = 0, opacity = 1, rotationDeg = 0, opts) {
1236
+ const underline = opts?.underline ? 1 : 0;
1237
+ const strikethrough = opts?.strikethrough ? 1 : 0;
1231
1238
  return this.g._withStr(
1232
1239
  text,
1233
- (p, l) => this.ex().gp_add_text(
1240
+ (p, l) => this.ex().gp_add_text_styled(
1234
1241
  this.h,
1235
1242
  page,
1236
1243
  x,
@@ -1241,7 +1248,9 @@ var GigaPdfDoc = class {
1241
1248
  fontObj,
1242
1249
  RGB(rgb),
1243
1250
  opacity,
1244
- rotationDeg
1251
+ rotationDeg,
1252
+ underline,
1253
+ strikethrough
1245
1254
  )
1246
1255
  ) === 0;
1247
1256
  }
@@ -1252,13 +1261,19 @@ var GigaPdfDoc = class {
1252
1261
  * {@link embedFont} (a Google Font fetched by the host, or one pulled out of
1253
1262
  * the document with {@link extractFont}) and use {@link addText}. Returns
1254
1263
  * `false` on an unknown font name or bad page.
1264
+ *
1265
+ * Pass `opts` to bake **text decorations** into the run: `{ underline: true }`
1266
+ * and/or `{ strikethrough: true }` draw filled rules in the text colour.
1267
+ * Omitting `opts` is fully backward-compatible (no decoration).
1255
1268
  */
1256
- addStandardText(page, x, y, size, text, fontName, rgb = 0, opacity = 1, rotationDeg = 0) {
1269
+ addStandardText(page, x, y, size, text, fontName, rgb = 0, opacity = 1, rotationDeg = 0, opts) {
1270
+ const underline = opts?.underline ? 1 : 0;
1271
+ const strikethrough = opts?.strikethrough ? 1 : 0;
1257
1272
  return this.g._withStr(
1258
1273
  text,
1259
1274
  (tp, tl) => this.g._withStr(
1260
1275
  fontName,
1261
- (fp, fl) => this.ex().gp_add_text_standard(
1276
+ (fp, fl) => this.ex().gp_add_text_standard_styled(
1262
1277
  this.h,
1263
1278
  page,
1264
1279
  x,
@@ -1270,7 +1285,9 @@ var GigaPdfDoc = class {
1270
1285
  fl,
1271
1286
  RGB(rgb),
1272
1287
  opacity,
1273
- rotationDeg
1288
+ rotationDeg,
1289
+ underline,
1290
+ strikethrough
1274
1291
  )
1275
1292
  )
1276
1293
  ) === 0;