@cj-tech-master/excelts 9.4.1 → 9.4.2

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.
Files changed (66) hide show
  1. package/dist/browser/modules/pdf/builder/document-builder.js +4 -23
  2. package/dist/browser/modules/pdf/core/pdf-stream.d.ts +15 -0
  3. package/dist/browser/modules/pdf/core/pdf-stream.js +47 -3
  4. package/dist/browser/modules/pdf/font/font-manager.d.ts +37 -6
  5. package/dist/browser/modules/pdf/font/font-manager.js +129 -17
  6. package/dist/browser/modules/pdf/font/system-fonts.d.ts +41 -0
  7. package/dist/browser/modules/pdf/font/system-fonts.js +188 -0
  8. package/dist/browser/modules/pdf/font/ttf-parser.js +29 -1
  9. package/dist/browser/modules/pdf/font/type3-font.d.ts +35 -0
  10. package/dist/browser/modules/pdf/font/type3-font.js +228 -0
  11. package/dist/browser/modules/pdf/font/type3-glyphs-extended.d.ts +33 -0
  12. package/dist/browser/modules/pdf/font/type3-glyphs-extended.js +4164 -0
  13. package/dist/browser/modules/pdf/font/type3-glyphs-extended2.d.ts +16 -0
  14. package/dist/browser/modules/pdf/font/type3-glyphs-extended2.js +9649 -0
  15. package/dist/browser/modules/pdf/font/type3-glyphs-fill.d.ts +17 -0
  16. package/dist/browser/modules/pdf/font/type3-glyphs-fill.js +5438 -0
  17. package/dist/browser/modules/pdf/font/type3-glyphs-quality.d.ts +28 -0
  18. package/dist/browser/modules/pdf/font/type3-glyphs-quality.js +5345 -0
  19. package/dist/browser/modules/pdf/font/type3-glyphs.d.ts +79 -0
  20. package/dist/browser/modules/pdf/font/type3-glyphs.js +2567 -0
  21. package/dist/browser/modules/pdf/render/layout-engine.js +36 -23
  22. package/dist/browser/modules/pdf/render/page-renderer.d.ts +9 -0
  23. package/dist/browser/modules/pdf/render/page-renderer.js +110 -78
  24. package/dist/browser/modules/pdf/render/pdf-exporter.js +73 -5
  25. package/dist/cjs/modules/pdf/builder/document-builder.js +3 -22
  26. package/dist/cjs/modules/pdf/core/pdf-stream.js +49 -3
  27. package/dist/cjs/modules/pdf/font/font-manager.js +129 -17
  28. package/dist/cjs/modules/pdf/font/system-fonts.js +194 -0
  29. package/dist/cjs/modules/pdf/font/ttf-parser.js +29 -1
  30. package/dist/cjs/modules/pdf/font/type3-font.js +231 -0
  31. package/dist/cjs/modules/pdf/font/type3-glyphs-extended.js +4167 -0
  32. package/dist/cjs/modules/pdf/font/type3-glyphs-extended2.js +9652 -0
  33. package/dist/cjs/modules/pdf/font/type3-glyphs-fill.js +5441 -0
  34. package/dist/cjs/modules/pdf/font/type3-glyphs-quality.js +5348 -0
  35. package/dist/cjs/modules/pdf/font/type3-glyphs.js +2573 -0
  36. package/dist/cjs/modules/pdf/render/layout-engine.js +36 -23
  37. package/dist/cjs/modules/pdf/render/page-renderer.js +111 -78
  38. package/dist/cjs/modules/pdf/render/pdf-exporter.js +71 -3
  39. package/dist/esm/modules/pdf/builder/document-builder.js +4 -23
  40. package/dist/esm/modules/pdf/core/pdf-stream.js +47 -3
  41. package/dist/esm/modules/pdf/font/font-manager.js +129 -17
  42. package/dist/esm/modules/pdf/font/system-fonts.js +188 -0
  43. package/dist/esm/modules/pdf/font/ttf-parser.js +29 -1
  44. package/dist/esm/modules/pdf/font/type3-font.js +228 -0
  45. package/dist/esm/modules/pdf/font/type3-glyphs-extended.js +4164 -0
  46. package/dist/esm/modules/pdf/font/type3-glyphs-extended2.js +9649 -0
  47. package/dist/esm/modules/pdf/font/type3-glyphs-fill.js +5438 -0
  48. package/dist/esm/modules/pdf/font/type3-glyphs-quality.js +5345 -0
  49. package/dist/esm/modules/pdf/font/type3-glyphs.js +2567 -0
  50. package/dist/esm/modules/pdf/render/layout-engine.js +36 -23
  51. package/dist/esm/modules/pdf/render/page-renderer.js +110 -78
  52. package/dist/esm/modules/pdf/render/pdf-exporter.js +73 -5
  53. package/dist/iife/excelts.iife.js +25445 -344
  54. package/dist/iife/excelts.iife.js.map +1 -1
  55. package/dist/iife/excelts.iife.min.js +48 -46
  56. package/dist/types/modules/pdf/core/pdf-stream.d.ts +15 -0
  57. package/dist/types/modules/pdf/font/font-manager.d.ts +37 -6
  58. package/dist/types/modules/pdf/font/system-fonts.d.ts +41 -0
  59. package/dist/types/modules/pdf/font/type3-font.d.ts +35 -0
  60. package/dist/types/modules/pdf/font/type3-glyphs-extended.d.ts +33 -0
  61. package/dist/types/modules/pdf/font/type3-glyphs-extended2.d.ts +16 -0
  62. package/dist/types/modules/pdf/font/type3-glyphs-fill.d.ts +17 -0
  63. package/dist/types/modules/pdf/font/type3-glyphs-quality.d.ts +28 -0
  64. package/dist/types/modules/pdf/font/type3-glyphs.d.ts +79 -0
  65. package/dist/types/modules/pdf/render/page-renderer.d.ts +9 -0
  66. package/package.json +1 -1
@@ -20,6 +20,11 @@ import type { PdfColor } from "../types.js";
20
20
  */
21
21
  export declare class PdfContentStream {
22
22
  private parts;
23
+ /**
24
+ * Append a raw PDF operator string to the content stream.
25
+ * Use this for operators not covered by the typed API (e.g. `d1` for Type3 glyphs).
26
+ */
27
+ raw(operator: string): this;
23
28
  /**
24
29
  * Save the current graphics state (push onto state stack).
25
30
  * Must be balanced with a corresponding restore().
@@ -225,3 +230,13 @@ export declare class PdfContentStream {
225
230
  */
226
231
  toUint8Array(): Uint8Array;
227
232
  }
233
+ /**
234
+ * Check whether a single code point is representable in WinAnsi encoding.
235
+ */
236
+ export declare function isWinAnsiCodePoint(cp: number): boolean;
237
+ /**
238
+ * Check whether a string contains characters outside the WinAnsi repertoire.
239
+ * When true, standard Type1 fonts cannot render those characters and an
240
+ * embedded TrueType font is required for correct output.
241
+ */
242
+ export declare function hasNonWinAnsiChars(text: string): boolean;
@@ -1,18 +1,20 @@
1
1
  /**
2
2
  * Font manager for PDF generation.
3
3
  *
4
- * Manages two kinds of fonts:
4
+ * Manages three kinds of fonts:
5
5
  * 1. **Standard Type1 fonts** (Helvetica, Times, Courier) — always available,
6
- * used as fallback for Latin text when no embedded font is provided.
6
+ * used for Latin text (WinAnsi repertoire) when no embedded font is provided.
7
7
  * 2. **Embedded TrueType fonts** — user-provided .ttf files for full
8
8
  * Unicode support (CJK, Arabic, Hindi, etc.)
9
+ * 3. **Type3 fallback fonts** — auto-generated vector-drawn glyphs for
10
+ * Unicode characters outside WinAnsi when no embedded font is provided.
9
11
  *
10
12
  * When an embedded font is registered, ALL text uses the embedded font.
11
- * When no embedded font is provided, the system falls back to standard fonts
12
- * exactly as before (mapping Calibri→Helvetica, etc.)
13
+ * When no embedded font is provided, the system uses Type1 for WinAnsi
14
+ * characters and Type3 for everything else.
13
15
  *
14
16
  * The manager tracks which Unicode code points are used so the font embedder
15
- * can create a minimal subset when writing the PDF.
17
+ * and Type3 builder can create minimal subsets when writing the PDF.
16
18
  */
17
19
  import type { PdfWriter } from "../core/pdf-writer.js";
18
20
  import { type EmbeddedFont } from "./font-embedder.js";
@@ -23,7 +25,8 @@ import type { TtfFont } from "./ttf-parser.js";
23
25
  export declare function resolvePdfFontName(fontFamily: string, bold: boolean, italic: boolean): string;
24
26
  /**
25
27
  * Manages PDF font resources for a document.
26
- * Supports both standard Type1 fonts and embedded TrueType fonts.
28
+ * Supports standard Type1 fonts, embedded TrueType fonts, and auto-generated
29
+ * Type3 fallback fonts for non-WinAnsi Unicode characters.
27
30
  */
28
31
  export declare class FontManager {
29
32
  private type1Map;
@@ -33,6 +36,8 @@ export declare class FontManager {
33
36
  private embeddedResourceName;
34
37
  private usedCodePoints;
35
38
  private nextEmbeddedId;
39
+ private type3CodePoints;
40
+ private _type3Result;
36
41
  /**
37
42
  * Register an embedded TrueType font for use.
38
43
  * When set, all text rendering uses this font instead of standard fonts.
@@ -65,8 +70,25 @@ export declare class FontManager {
65
70
  * Get the PDF font name for a given resource name.
66
71
  */
67
72
  getPdfFontName(resourceName: string): string;
73
+ /**
74
+ * Check if Type3 fallback fonts are available (after writeFontResources).
75
+ */
76
+ hasType3Fonts(): boolean;
77
+ /**
78
+ * Resolve the Type3 font resource name and char code for a code point.
79
+ * Returns null if the code point is not in the Type3 encoding.
80
+ */
81
+ resolveType3(codePoint: number): {
82
+ resourceName: string;
83
+ charCode: number;
84
+ } | null;
85
+ /**
86
+ * Check if a code point needs Type3 rendering (non-WinAnsi, no embedded font).
87
+ */
88
+ needsType3(codePoint: number): boolean;
68
89
  /**
69
90
  * Measure text width using the correct font metrics.
91
+ * For mixed Type1/Type3 text, measures each character with the right font.
70
92
  */
71
93
  measureText(text: string, resourceName: string, fontSize: number): number;
72
94
  /**
@@ -85,6 +107,10 @@ export declare class FontManager {
85
107
  * Check if a resource name refers to an embedded font.
86
108
  */
87
109
  isEmbeddedFont(resourceName: string): boolean;
110
+ /**
111
+ * Check if a resource name refers to a Type3 fallback font.
112
+ */
113
+ isType3Resource(resourceName: string): boolean;
88
114
  /**
89
115
  * Encode text for the given font resource.
90
116
  * For embedded fonts, returns a hex string `<0012003A...>`.
@@ -94,6 +120,11 @@ export declare class FontManager {
94
120
  * subset and produces the unicodeToCid mapping.
95
121
  */
96
122
  encodeText(text: string, resourceName: string): string | null;
123
+ /**
124
+ * Encode a single character for a Type3 font.
125
+ * Returns a hex string `<XX>` suitable for the Tj operator.
126
+ */
127
+ encodeType3Char(codePoint: number): string | null;
97
128
  /**
98
129
  * Write all font resource objects to the PDF.
99
130
  * Returns a map from resource name → object number.
@@ -0,0 +1,41 @@
1
+ /**
2
+ * System font discovery for PDF generation.
3
+ *
4
+ * When no embedded font is provided and the document contains non-WinAnsi
5
+ * characters, this module searches standard system font directories for a
6
+ * TrueType font (.ttf or .ttc) with broad Unicode coverage.
7
+ *
8
+ * This is a Node.js-only feature — browser environments do not have
9
+ * file system access and must always provide fonts explicitly.
10
+ *
11
+ * .ttc (TrueType Collection) files are supported — parseTtf() extracts
12
+ * the first font from the collection automatically.
13
+ *
14
+ * Results are cached: the filesystem search runs only once per process.
15
+ */
16
+ /**
17
+ * Return all discoverable system font candidates, ordered by preference.
18
+ *
19
+ * Each entry is the raw font file bytes of a `.ttf` or `.ttc` file.
20
+ * The caller decides which candidate to use (e.g. by checking cmap coverage).
21
+ *
22
+ * Results are cached — the filesystem scan runs only once per process.
23
+ */
24
+ export declare function discoverSystemFontCandidates(): Uint8Array[];
25
+ /**
26
+ * Search for a system font suitable for Unicode rendering.
27
+ *
28
+ * Returns the raw font file bytes of the highest-priority candidate,
29
+ * or `null` if no font was found. This is a convenience wrapper around
30
+ * {@link discoverSystemFontCandidates}.
31
+ */
32
+ export declare function discoverSystemFont(): Uint8Array | null;
33
+ /**
34
+ * Reset the cached font discovery result (for testing).
35
+ */
36
+ export declare function resetFontDiscoveryCache(): void;
37
+ /**
38
+ * Override the cached candidates with a custom list (for testing).
39
+ * Call {@link resetFontDiscoveryCache} to clear the override.
40
+ */
41
+ export declare function _setCandidatesForTest(candidates: Uint8Array[]): void;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Type3 fallback font builder.
3
+ *
4
+ * Produces a PDF Type3 font object that contains vector-drawn glyphs for
5
+ * Unicode characters that cannot be represented by standard Type1 fonts
6
+ * (WinAnsi encoding).
7
+ *
8
+ * A single Type3 font supports up to 256 glyphs (single-byte encoding).
9
+ * When more than 256 distinct non-WinAnsi characters appear in a document,
10
+ * multiple Type3 fonts are created automatically.
11
+ *
12
+ * @see PDF Reference 1.7, §5.5.4 — Type 3 Fonts
13
+ */
14
+ import type { PdfWriter } from "../core/pdf-writer.js";
15
+ /** Result of writing Type3 font(s) to the PDF. */
16
+ export interface Type3FontResult {
17
+ /** Map from Type3 resource name → PDF object number. */
18
+ fontObjects: Map<string, number>;
19
+ /** Map from Unicode code point → { resourceName, charCode }. */
20
+ encoding: Map<number, {
21
+ resourceName: string;
22
+ charCode: number;
23
+ }>;
24
+ /** Advance widths: resourceName → Map<charCode, width in 1/1000 em>. */
25
+ widths: Map<string, Map<number, number>>;
26
+ }
27
+ /**
28
+ * Build and write Type3 fallback fonts to the PDF for the given code points.
29
+ *
30
+ * @param writer - The PdfWriter to add objects to.
31
+ * @param codePoints - Set of Unicode code points that need Type3 rendering.
32
+ * @param resourcePrefix - Prefix for resource names (e.g. "T3F").
33
+ * @returns Encoding and object info for use by FontManager.
34
+ */
35
+ export declare function writeType3Fonts(writer: PdfWriter, codePoints: Set<number>, resourcePrefix?: string): Type3FontResult;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Extended Type3 glyph definitions — programmatically generated blocks
3
+ * and additional hand-crafted symbols.
4
+ *
5
+ * This file supplements type3-glyphs.ts with:
6
+ * - Box Drawing (U+2500–U+257F) 128 chars — algorithmic
7
+ * - Block Elements (U+2580–U+259F) 32 chars — algorithmic
8
+ * - Braille Patterns (U+2800–U+28FF) 256 chars — algorithmic
9
+ * - Letterlike Symbols (U+2100–U+214F) hand-crafted
10
+ * - Number Forms (U+2150–U+218F) hand-crafted
11
+ * - Enclosed Alphanumerics (U+2460–U+24FF) programmatic
12
+ * - General Punctuation extras (U+2000–U+206F)
13
+ * - Additional Arrows, Math, Dingbats, Misc Symbols, Currency, Technical
14
+ */
15
+ import type { GlyphDef } from "./type3-glyphs.js";
16
+ export declare const BOX_FULL: Record<number, GlyphDef>;
17
+ export declare const BLOCK_FULL: Record<number, GlyphDef>;
18
+ export declare const BRAILLE: Record<number, GlyphDef>;
19
+ export declare const LETTERLIKE: Record<number, GlyphDef>;
20
+ export declare const NUMBER_FORMS: Record<number, GlyphDef>;
21
+ export declare const ENCLOSED: Record<number, GlyphDef>;
22
+ export declare const PUNCT_EXT: Record<number, GlyphDef>;
23
+ export declare const ARROWS_EXT: Record<number, GlyphDef>;
24
+ export declare const MATH_EXT: Record<number, GlyphDef>;
25
+ export declare const MISC_EXT: Record<number, GlyphDef>;
26
+ export declare const DING_EXT: Record<number, GlyphDef>;
27
+ export declare const TECH_EXT: Record<number, GlyphDef>;
28
+ export declare const CURRENCY_EXT: Record<number, GlyphDef>;
29
+ export declare const MATH_SYM_A: Record<number, GlyphDef>;
30
+ export declare const SUP_ARROWS_A: Record<number, GlyphDef>;
31
+ export declare const GEOMETRIC_EXT: Record<number, GlyphDef>;
32
+ export declare const ROMAN_NUMERALS: Record<number, GlyphDef>;
33
+ export declare const ENCLOSED_EXT: Record<number, GlyphDef>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Extended Type3 glyph definitions — Part 2
3
+ *
4
+ * Additional hand-crafted glyph blocks:
5
+ * - Arrows Extended: Harpoons & Paired Arrows (U+21BC–U+21FF)
6
+ * - Dingbats Full (U+2700–U+27BF)
7
+ * - Misc Symbols Full (U+2600–U+26FF)
8
+ */
9
+ import type { GlyphDef } from "./type3-glyphs.js";
10
+ export declare const ARROWS_HARPOONS: Record<number, GlyphDef>;
11
+ export declare const DINGBATS_FULL: Record<number, GlyphDef>;
12
+ export declare const MISC_SYMBOLS_FULL: Record<number, GlyphDef>;
13
+ export declare const MISC_TECHNICAL_EXT: Record<number, GlyphDef>;
14
+ export declare const SUP_ARROWS_B: Record<number, GlyphDef>;
15
+ export declare const MISC_MATH_A_EXT: Record<number, GlyphDef>;
16
+ export declare const MISC_SYM_ARROWS_EXT: Record<number, GlyphDef>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Gap-filling glyph definitions — programmatic batch generation.
3
+ *
4
+ * Fills all remaining gaps across Dingbats, Misc Symbols, Misc Symbols & Arrows,
5
+ * Supplemental Arrows A/B, General Punctuation, and Number Forms.
6
+ *
7
+ * Strategy: use helper functions and loops to generate approximations for
8
+ * characters that share structural patterns (stars, arrows, chess pieces, etc).
9
+ */
10
+ import type { GlyphDef } from "./type3-glyphs.js";
11
+ export declare const FINAL_FILL: Record<number, GlyphDef>;
12
+ export declare const DINGBATS_FILL: Record<number, GlyphDef>;
13
+ export declare const MISC_SYM_FILL: Record<number, GlyphDef>;
14
+ export declare const MISC_SYM_ARR_FILL: Record<number, GlyphDef>;
15
+ export declare const SUP_ARROWS_FILL: Record<number, GlyphDef>;
16
+ export declare const GEN_PUNCT_FILL: Record<number, GlyphDef>;
17
+ export declare const NUM_FORMS_FILL: Record<number, GlyphDef>;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * High-quality glyph replacements and additions.
3
+ *
4
+ * This file:
5
+ * 1. Defines space characters (U+2000–U+200F) with correct advance widths
6
+ * and empty draw callbacks.
7
+ * 2. Replaces enclosed numbers ①–⑳, Ⓐ–Ⓩ, ❶–❿ with recognisable
8
+ * circle + digit/letter shapes drawn purely from paths.
9
+ * 3. Refines common symbols (✓✗★♥→← etc.) for better visual fidelity.
10
+ * 4. Adds Supplemental Math Operators (U+2A00–U+2AFF) and
11
+ * Misc Math Symbols-B (U+2980–U+29FF).
12
+ *
13
+ * Entries here are appended LAST to ALL_TABLES so they override any
14
+ * earlier, lower-quality definitions for the same code point.
15
+ */
16
+ import type { GlyphDef } from "./type3-glyphs.js";
17
+ export declare const SPACES: Record<number, GlyphDef>;
18
+ export declare const CIRCLED_DIGITS: Record<number, GlyphDef>;
19
+ export declare const CIRCLED_LETTERS: Record<number, GlyphDef>;
20
+ export declare const CIRCLED_SMALL_LETTERS: Record<number, GlyphDef>;
21
+ export declare const NEG_CIRCLED_DIGITS: Record<number, GlyphDef>;
22
+ export declare const REFINED_SYMBOLS: Record<number, GlyphDef>;
23
+ export declare const SUPP_MATH_OP: Record<number, GlyphDef>;
24
+ export declare const MISC_MATH_B: Record<number, GlyphDef>;
25
+ export declare const MATH_OP_FULL: Record<number, GlyphDef>;
26
+ export declare const LETTERLIKE_FULL: Record<number, GlyphDef>;
27
+ export declare const CURRENCY_REMAINING: Record<number, GlyphDef>;
28
+ export declare const ARROWS_REMAINING: Record<number, GlyphDef>;
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Type3 fallback glyph definitions.
3
+ *
4
+ * Each glyph is a function that writes PDF content-stream operators into
5
+ * a 1000×1000 unit glyph coordinate system (matching a FontMatrix of
6
+ * [0.001 0 0 0.001 0 0]).
7
+ *
8
+ * The drawing callbacks receive a simple `GlyphPen` API so they don't
9
+ * depend on `PdfContentStream` directly — this keeps the module
10
+ * self-contained and easy to test.
11
+ *
12
+ * Coverage strategy:
13
+ * 1. Geometric Shapes (U+25A0–U+25FF)
14
+ * 2. Miscellaneous Symbols (U+2600–U+26FF)
15
+ * 3. Dingbats / checkmarks (U+2700–U+27BF)
16
+ * 4. Arrows (U+2190–U+21FF)
17
+ * 5. Mathematical Operators (U+2200–U+22FF)
18
+ * 6. Box Drawing (U+2500–U+257F)
19
+ * 7. Block Elements (U+2580–U+259F)
20
+ * 8. Misc Technical (U+2300–U+23FF)
21
+ * 9. Enclosed Alphanumerics (U+2460–U+24FF)
22
+ * 10. Misc Symbols & Arrows (U+2B00–U+2BFF)
23
+ * 11. Ballot / checkbox symbols (U+2610–U+2612)
24
+ * 12. Supplemental Arrows (U+27F0–U+27FF)
25
+ * 13. Braille Patterns (U+2800–U+28FF)
26
+ * 14. Squared symbols etc. (U+29C0–U+29FF)
27
+ *
28
+ * Characters not in this table get a generic .notdef glyph (open rectangle).
29
+ */
30
+ /**
31
+ * Minimal drawing API used by glyph definitions.
32
+ * Lines are emitted as raw PDF content-stream operators.
33
+ */
34
+ export interface GlyphPen {
35
+ /** Move to (x, y). */
36
+ M(x: number, y: number): void;
37
+ /** Line to (x, y). */
38
+ L(x: number, y: number): void;
39
+ /** Cubic Bezier curve. */
40
+ C(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): void;
41
+ /** Close path. */
42
+ Z(): void;
43
+ /** Rectangle (x, y, w, h). */
44
+ rect(x: number, y: number, w: number, h: number): void;
45
+ /** Circle at (cx, cy) with radius r using 4 Bezier arcs. */
46
+ circle(cx: number, cy: number, r: number): void;
47
+ /** Ellipse at (cx, cy) with radii (rx, ry). */
48
+ ellipse(cx: number, cy: number, rx: number, ry: number): void;
49
+ /** Stroke current path. */
50
+ stroke(): void;
51
+ /** Fill current path (non-zero winding). */
52
+ fill(): void;
53
+ /** Fill then stroke. */
54
+ fillStroke(): void;
55
+ /** Set line width. */
56
+ lineWidth(w: number): void;
57
+ }
58
+ /** A glyph definition: advance width + drawing callback. */
59
+ export interface GlyphDef {
60
+ /** Advance width in glyph units (0–1000). */
61
+ width: number;
62
+ /** Draw the glyph outline using the pen. */
63
+ draw: (p: GlyphPen) => void;
64
+ }
65
+ /** .notdef: open rectangle — drawn for any character we don't have. */
66
+ export declare const NOTDEF_GLYPH: GlyphDef;
67
+ /**
68
+ * Look up a glyph definition for a Unicode code point.
69
+ * Returns the glyph def, or `undefined` if no specific drawing is available.
70
+ */
71
+ export declare function lookupGlyph(codePoint: number): GlyphDef | undefined;
72
+ /**
73
+ * Check whether a specific code point has a dedicated vector glyph.
74
+ */
75
+ export declare function hasGlyph(codePoint: number): boolean;
76
+ /**
77
+ * Return the total number of defined glyphs (for diagnostics / testing).
78
+ */
79
+ export declare function glyphCount(): number;
@@ -24,6 +24,15 @@ export interface PageRenderResult {
24
24
  * Render a single page to a PDF content stream.
25
25
  */
26
26
  export declare function renderPage(page: LayoutPage, options: ResolvedPdfOptions, fontManager: FontManager, totalPages: number): PageRenderResult;
27
+ /**
28
+ * Render a text string with a custom text matrix, using Type3-aware splitting
29
+ * when needed. For each sub-run the matrix origin is advanced along the
30
+ * text direction (cos, sin) by the rendered width.
31
+ *
32
+ * When `useType3` is false this collapses to a single BT/ET pair — identical
33
+ * to the old `emitText()` path but wrapped in begin/end for convenience.
34
+ */
35
+ export declare function emitTextWithMatrix(stream: PdfContentStream, text: string, a: number, b: number, c: number, d: number, tx: number, ty: number, type1ResourceName: string, fontSize: number, fontManager: FontManager, useType3: boolean): void;
27
36
  /**
28
37
  * Generate a deterministic ExtGState resource name for a given alpha value.
29
38
  * Uses 4 decimal digits to avoid collisions between close alpha values.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cj-tech-master/excelts",
3
- "version": "9.4.1",
3
+ "version": "9.4.2",
4
4
  "description": "Zero-dependency TypeScript toolkit — Excel (XLSX), PDF, CSV, Markdown, XML, ZIP/TAR, and streaming.",
5
5
  "keywords": [
6
6
  "archive",