You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`@denkiyagi/pdf-lib` extends the upstream `pdf-lib` to power PDF generation for `yagisan-reports`, a PDF report generation engine.
5
+
- Current focus areas: richer custom font handling via `@denkiyagi/fontkit`, groundwork for improved error handling, adding PDF encryption support, and fixing upstream bugs.
6
+
- Keep the fork aligned with upstream quality while preserving `yagisan-reports`-specific behaviors; prefer additive changes and call out intentional divergences in `MODIFICATIONS.md` or `MODIFICATION-DEVELOPMENT.md`.
7
+
8
+
## Project Orientation
9
+
-`src/` – Primary TypeScript source for the library; exports must remain framework-agnostic and compatible with browsers and Node.
10
+
-`tests/` – Jest-powered regression coverage.
11
+
-`apps/` – Example and manual-test harnesses used to validate real-world document flows.
12
+
-`assets/` – Sample PDFs, fonts, and images consumed by docs and tests; treat as fixtures when updating expectations.
13
+
-`build/`, `rollup.config.mjs`, `tsconfig.json`, `jest.json` – Tooling scaffolding for bundling, type emission, and tests.
14
+
-`docs/` – Markdown/docs site material mirrored from upstream; update only when behavior changes.
15
+
-`scratchpad/` – Throwaway experiments; do not rely on contents for production logic.
16
+
17
+
## Tech Stack
18
+
- Node.js 20+ runtime, Yarn package manager.
19
+
- TypeScript 4.x across source and typings.
20
+
- Critical dependency: `@denkiyagi/fontkit` (our fork) powers font parsing, embedding, and subsetting.
21
+
22
+
## Common Commands
23
+
-`yarn typecheck` – Checks TypeScript types across the codebase.
24
+
-`yarn lint` – Runs the lint rules expected by CI; fix warnings locally to avoid pipeline noise.
25
+
26
+
## Helpful References
27
+
- Change log: `MODIFICATIONS.md` (what differs from upstream).
28
+
- Dev workflow, release, and scripting notes: `MODIFICATION-DEVELOPMENT.md`.
29
+
- Upstream behavior context: `README.md` plus linked docs/examples.
Copy file name to clipboardExpand all lines: MODIFICATIONS.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,10 @@
1
1
# Modifications
2
2
3
+
## [1.17.1-mod.2025.7]
4
+
5
+
- Add `PDFDocument#embedTTFFont` (subset-only) and `CustomFontSubsetEmbedder.forTTFFont` so pre-created fontkit `TTFFont` instances can be embedded.
6
+
- Refactor the internal custom font embedders into separate subset and non-subset implementations by adding the abstract base class `AbstractCustomFontEmbedder`.
7
+
3
8
## [1.17.1-mod.2025.6]
4
9
5
10
- Update `@denkiyagi/fontkit` to `2.0.4-mod.2025.2`, which enhances runtime performance for Unicode Variation Sequences (UVS) support.
@@ -12,7 +17,7 @@
12
17
13
18
- Changed npm dependency `fontkit` to `@denkiyagi/fontkit`
14
19
- Improved `options` parameter of `PDFDocument#embedFont`
15
-
- Fix `CustomFontEmbedder#embedCIDFontDict` so that it respects glyph metrics when embedding vertical fonts
20
+
- Fix `AbstractCustomFontEmbedder#embedCIDFontDict` so that it respects glyph metrics when embedding vertical fonts
16
21
- Add methods `PDFFont#getRawStandardFont` and `PDFFont#getRawCustomFont`
17
22
- Improve parameters of `PDFPage#drawText`:
18
23
- Expand the data type of the `text` parameter so that it also accepts Glyph IDs instead of string
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1209,7 +1209,7 @@ Check out [MAINTAINERSHIP.md](docs/MAINTAINERSHIP.md) for details on how this re
1209
1209
1210
1210
## Prior Art
1211
1211
1212
-
-[`pdfkit`](https://github.com/devongovett/pdfkit) is a PDF generation library for Node and the Browser. This library was immensely helpful as a reference and existence proof when creating `pdf-lib`. `pdfkit`'s code for [font embedding](src/core/embedders/CustomFontEmbedder.ts#L17-L21), [PNG embedding](src/core/embedders/PngEmbedder.ts#L7-L11), and [JPG embedding](src/core/embedders/JpegEmbedder.ts#L25-L29) was especially useful.
1212
+
-[`pdfkit`](https://github.com/devongovett/pdfkit) is a PDF generation library for Node and the Browser. This library was immensely helpful as a reference and existence proof when creating `pdf-lib`. `pdfkit`'s code for [font embedding](src/core/embedders/AbstractCustomFontEmbedder.ts), [PNG embedding](src/core/embedders/PngEmbedder.ts#L7-L11), and [JPG embedding](src/core/embedders/JpegEmbedder.ts#L25-L29) was especially useful.
1213
1213
-[`pdf.js`](https://github.com/mozilla/pdf.js) is a PDF rendering library for the Browser. This library was helpful as a reference when writing `pdf-lib`'s parser. Some of the code for stream decoding was [ported directly to TypeScript](src/core/streams) for use in `pdf-lib`.
1214
1214
-[`pdfbox`](https://pdfbox.apache.org/) is a PDF generation and modification library written in Java. This library was an invaluable reference when implementing form creation and filling APIs for `pdf-lib`.
1215
1215
-[`jspdf`](https://github.com/MrRio/jsPDF) is a PDF generation library for the browser.
0 commit comments