pdf-codec 5.7.4 โ 5.8.1
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/README.md +2 -0
- package/dist/font-read.cjs +5 -2
- package/dist/font-read.js +5 -2
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/symbol-font-private-use.cjs +86 -0
- package/dist/symbol-font-private-use.d.cts +18 -0
- package/dist/symbol-font-private-use.d.ts +18 -0
- package/dist/symbol-font-private-use.js +84 -0
- package/dist/text-group.cjs +19 -2
- package/dist/text-group.d.cts +13 -1
- package/dist/text-group.d.ts +13 -1
- package/dist/text-group.js +18 -3
- package/dist/wingdings-characters.cjs +262 -0
- package/dist/wingdings-characters.d.cts +4 -0
- package/dist/wingdings-characters.d.ts +4 -0
- package/dist/wingdings-characters.js +261 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -332,6 +332,8 @@ Reading a program's built-in encoding is what stops a symbol-encoded subset โ
|
|
|
332
332
|
|
|
333
333
|
A TrueType subset can lose its glyph names and its `cmap` both and keep nothing but outlines, metrics and its `name` table, while still numbering its glyphs as the full face does. Producers write exactly that for the core faces they embed most (the Arial, Times New Roman and Courier New families) as composite subsets with no `/ToUnicode`, and then the face's published glyph order is the only statement of what each glyph draws. `core-font-glyph-orders.ts` carries that order for those faces, with each glyph's advance width, and a program that names itself as one of them (its own `name` table's PostScript name, or `/BaseFont` when the table states none) is read through it glyph by glyph only where the program's own advance width for the glyph equals the face's on the same design grid. A renumbered subset, another face under the same name or a glyph a later release redrew to a new width therefore stays unmapped instead of being read as the wrong character. The data is generated by `scripts/generate-core-font-glyph-orders.mjs` from installed copies of the faces (the newest release found of each): a glyph's text comes from the face's Unicode `cmap`, or for a ligature glyph no code point reaches, from the components its `GSUB` ligature substitution joins.
|
|
334
334
|
|
|
335
|
+
A `/ToUnicode` CMap that a producer writes for the Symbol or Wingdings font (Word does, for a bullet, a tick or an arrow it draws in them) gives each glyph the private-use code point its 8-bit code makes in the 0xF000 range, which identifies the glyph in that one font and nothing else: 0xFC is a check mark in Wingdings and a piece of a right brace in Symbol. `symbol-font-private-use.ts` reads such a code point as the character the named font draws at that code, applied to the text a `/ToUnicode` CMap gave for a Symbol, SymbolMT or Wingdings font, by name, and to no other font: Symbol through its published encoding (the assembly pieces of a tall bracket and the integral extension as their Unicode characters), Wingdings through `wingdings-characters.ts`, the table of Unicode's own Wingdings document. A code the font has no character at, and Wingdings 2 and 3, Webdings and ZapfDingbats, stay as the producer wrote them.
|
|
336
|
+
|
|
335
337
|
**Where nothing states an answer, the answer is the replacement character plus a `text/unmapped-encoding` diagnostic, never a guess.** Cases that reach it in practice: a symbolic font with no embedded program and no `/ToUnicode`; a subsetted font that both strips its glyph names and maps its glyphs only from private-use code points; a nameless, `cmap`-less subset of a face whose glyph order this package does not carry, or of a carried face at a glyph its recorded releases do not number; and a composite font whose `/Encoding` is a CMap other than Identity-H or Identity-V, whose codes reach CIDs this reader does not map. A private-use code point identifies a glyph inside one font and says nothing about the character it draws, so it is treated as no answer rather than a wrong one.
|
|
336
338
|
|
|
337
339
|
## Grouping text runs into lines and words
|
package/dist/font-read.cjs
CHANGED
|
@@ -9,6 +9,7 @@ const require_builtin_encoding = require("./builtin-encoding.cjs");
|
|
|
9
9
|
const require_cmap = require("./cmap.cjs");
|
|
10
10
|
const require_encoding_symbol_tables = require("./encoding-symbol-tables.cjs");
|
|
11
11
|
const require_fonts = require("./fonts.cjs");
|
|
12
|
+
const require_symbol_font_private_use = require("./symbol-font-private-use.cjs");
|
|
12
13
|
//#region src/font-read.ts
|
|
13
14
|
const BITS_PER_BYTE = 8;
|
|
14
15
|
const SYMBOLIC_FLAG_BIT = 4;
|
|
@@ -84,6 +85,7 @@ function buildSimpleFont(fontDict, context) {
|
|
|
84
85
|
const { baseFamily, bold, italic } = require_font_style.styleFromBaseFontName(baseFont, styleFlags);
|
|
85
86
|
const symbolic = styleFlags.symbolic ?? false;
|
|
86
87
|
const builtinGlyphName = builtinSymbolGlyphNameLookup(baseFamily);
|
|
88
|
+
const symbolFont = require_symbol_font_private_use.symbolFontOf(baseFamily);
|
|
87
89
|
const widthsArr = resolvedArray(require_objects.dictGet(fontDict, "Widths"), context);
|
|
88
90
|
const firstChar = require_objects.asNumber(require_objects.dictGet(fontDict, "FirstChar")) ?? 0;
|
|
89
91
|
const missingWidth = (descriptor !== void 0 ? require_objects.asNumber(require_objects.dictGet(descriptor, "MissingWidth")) : void 0) ?? 0;
|
|
@@ -160,7 +162,7 @@ function buildSimpleFont(fontDict, context) {
|
|
|
160
162
|
for (const code of codes) {
|
|
161
163
|
const viaToUnicode = toUnicode?.lookup(code);
|
|
162
164
|
if (viaToUnicode !== void 0) {
|
|
163
|
-
out += viaToUnicode;
|
|
165
|
+
out += require_symbol_font_private_use.withSymbolFontCharacters(symbolFont, viaToUnicode);
|
|
164
166
|
continue;
|
|
165
167
|
}
|
|
166
168
|
const unicode = unicodeForCode(code);
|
|
@@ -321,6 +323,7 @@ function buildCompositeFont(fontDict, context) {
|
|
|
321
323
|
};
|
|
322
324
|
};
|
|
323
325
|
const toUnicode = readToUnicodeCMap(fontDict, context);
|
|
326
|
+
const symbolFont = require_symbol_font_private_use.symbolFontOf(baseFamily);
|
|
324
327
|
const glyphIdOf = cidToGlyphId(fontDict, descendantDict, context);
|
|
325
328
|
const programEncoding = glyphIdOf !== void 0 ? lazyFontProgram(descriptor, baseFont, context) : void 0;
|
|
326
329
|
const decodeToUnicode = (codes) => {
|
|
@@ -332,7 +335,7 @@ function buildCompositeFont(fontDict, context) {
|
|
|
332
335
|
const cid = (codes[i] ?? 0) << BITS_PER_BYTE | (codes[i + 1] ?? 0);
|
|
333
336
|
const mapped = toUnicode?.lookup(cid);
|
|
334
337
|
if (mapped !== void 0) {
|
|
335
|
-
out += mapped;
|
|
338
|
+
out += require_symbol_font_private_use.withSymbolFontCharacters(symbolFont, mapped);
|
|
336
339
|
continue;
|
|
337
340
|
}
|
|
338
341
|
const glyphId = glyphIdOf?.(cid);
|
package/dist/font-read.js
CHANGED
|
@@ -8,6 +8,7 @@ import { readFontProgramEncoding } from "./builtin-encoding.js";
|
|
|
8
8
|
import { parseToUnicodeCMap } from "./cmap.js";
|
|
9
9
|
import { symbolGlyphName, zapfDingbatsGlyphName } from "./encoding-symbol-tables.js";
|
|
10
10
|
import { resolveStandardFont } from "./fonts.js";
|
|
11
|
+
import { symbolFontOf, withSymbolFontCharacters } from "./symbol-font-private-use.js";
|
|
11
12
|
//#region src/font-read.ts
|
|
12
13
|
const BITS_PER_BYTE = 8;
|
|
13
14
|
const SYMBOLIC_FLAG_BIT = 4;
|
|
@@ -83,6 +84,7 @@ function buildSimpleFont(fontDict, context) {
|
|
|
83
84
|
const { baseFamily, bold, italic } = styleFromBaseFontName(baseFont, styleFlags);
|
|
84
85
|
const symbolic = styleFlags.symbolic ?? false;
|
|
85
86
|
const builtinGlyphName = builtinSymbolGlyphNameLookup(baseFamily);
|
|
87
|
+
const symbolFont = symbolFontOf(baseFamily);
|
|
86
88
|
const widthsArr = resolvedArray(dictGet(fontDict, "Widths"), context);
|
|
87
89
|
const firstChar = asNumber(dictGet(fontDict, "FirstChar")) ?? 0;
|
|
88
90
|
const missingWidth = (descriptor !== void 0 ? asNumber(dictGet(descriptor, "MissingWidth")) : void 0) ?? 0;
|
|
@@ -159,7 +161,7 @@ function buildSimpleFont(fontDict, context) {
|
|
|
159
161
|
for (const code of codes) {
|
|
160
162
|
const viaToUnicode = toUnicode?.lookup(code);
|
|
161
163
|
if (viaToUnicode !== void 0) {
|
|
162
|
-
out += viaToUnicode;
|
|
164
|
+
out += withSymbolFontCharacters(symbolFont, viaToUnicode);
|
|
163
165
|
continue;
|
|
164
166
|
}
|
|
165
167
|
const unicode = unicodeForCode(code);
|
|
@@ -320,6 +322,7 @@ function buildCompositeFont(fontDict, context) {
|
|
|
320
322
|
};
|
|
321
323
|
};
|
|
322
324
|
const toUnicode = readToUnicodeCMap(fontDict, context);
|
|
325
|
+
const symbolFont = symbolFontOf(baseFamily);
|
|
323
326
|
const glyphIdOf = cidToGlyphId(fontDict, descendantDict, context);
|
|
324
327
|
const programEncoding = glyphIdOf !== void 0 ? lazyFontProgram(descriptor, baseFont, context) : void 0;
|
|
325
328
|
const decodeToUnicode = (codes) => {
|
|
@@ -331,7 +334,7 @@ function buildCompositeFont(fontDict, context) {
|
|
|
331
334
|
const cid = (codes[i] ?? 0) << BITS_PER_BYTE | (codes[i + 1] ?? 0);
|
|
332
335
|
const mapped = toUnicode?.lookup(cid);
|
|
333
336
|
if (mapped !== void 0) {
|
|
334
|
-
out += mapped;
|
|
337
|
+
out += withSymbolFontCharacters(symbolFont, mapped);
|
|
335
338
|
continue;
|
|
336
339
|
}
|
|
337
340
|
const glyphId = glyphIdOf?.(cid);
|
package/dist/index.cjs
CHANGED
|
@@ -79,6 +79,7 @@ exports.filterScanlines = require_image_png_filter.filterScanlines;
|
|
|
79
79
|
exports.groupPdfTextRuns = require_text_group.groupPdfTextRuns;
|
|
80
80
|
exports.loadMathFont = require_math_font.loadMathFont;
|
|
81
81
|
exports.looksLikeBareCodestream = require_image_jp2_boxes.looksLikeBareCodestream;
|
|
82
|
+
exports.normalisedRotationDeg = require_text_group.normalisedRotationDeg;
|
|
82
83
|
exports.parseJp2Container = require_image_jp2_boxes.parseJp2Container;
|
|
83
84
|
exports.pdfCodec = require_codec.pdfCodec;
|
|
84
85
|
exports.readFontFace = require_font_face.readFontFace;
|
|
@@ -87,6 +88,7 @@ exports.readPdf = require_read.readPdf;
|
|
|
87
88
|
exports.renderPdfPage = require_raster.renderPdfPage;
|
|
88
89
|
exports.resolveFaceWithRegistry = require_font_registry.resolveFaceWithRegistry;
|
|
89
90
|
exports.resolveStandardFont = require_fonts.resolveStandardFont;
|
|
91
|
+
exports.runAlongBaselinePt = require_text_group.runAlongBaselinePt;
|
|
90
92
|
exports.runGapPt = require_text_group.runGapPt;
|
|
91
93
|
exports.runsShareBaseline = require_text_group.runsShareBaseline;
|
|
92
94
|
exports.scaleMathStretchConstruction = require_math_stretch.scaleMathStretchConstruction;
|
package/dist/index.d.cts
CHANGED
|
@@ -24,8 +24,8 @@ import { a as MathGlyphPart, c as MathVariants, n as MathGlyphAssembly, o as Mat
|
|
|
24
24
|
import { a as scaleMathStretchConstruction, i as assembleStretchyGlyph, n as MathStretchOptions, r as MathStretchPlacement, t as MathStretchConstruction } from "./math-stretch-C2JanDAz.cjs";
|
|
25
25
|
import { LoadedMathFont, MathFont, MathFontDescriptorMetrics, loadMathFont } from "./math-font.cjs";
|
|
26
26
|
import { DEFAULT_VERTICAL_METRIC_POLICY, FontMeasurerOptions, StandardFontMeasurerOptions, VerticalMetricPolicy, createFontMeasurer, createStandardFontMeasurer } from "./measure.cjs";
|
|
27
|
-
import { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_WORD_GAP_EM, PdfLineWithScripts, PdfScriptPosition, PdfTextBox, PdfTextGroupingOptions, PdfTextLine, PdfTextRunGeometry, PdfTextWord, PdfWordSeparator, attachScriptRuns, groupPdfTextRuns, runGapPt, runsShareBaseline, scriptPositionOf } from "./text-group.cjs";
|
|
27
|
+
import { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_WORD_GAP_EM, PdfLineWithScripts, PdfScriptPosition, PdfTextBox, PdfTextGroupingOptions, PdfTextLine, PdfTextRunGeometry, PdfTextWord, PdfWordSeparator, attachScriptRuns, groupPdfTextRuns, normalisedRotationDeg, runAlongBaselinePt, runGapPt, runsShareBaseline, scriptPositionOf } from "./text-group.cjs";
|
|
28
28
|
import { PageRasteriser, RasterDrawOp, RasterFillRectOp, RasterFillSpec, RasterImageOp, RasterMatrix, RasterPageGeometry, RasterPathOp, RasterPathSegment, RasterRegionPt, RasterStrokeSpec, RasterSubpath, RenderPdfPageOptions, renderPdfPage } from "./raster.cjs";
|
|
29
29
|
import { FontRegistryOptions, FontSubstitution, MathAssembledGlyphs, MathBox, MathColor, MathFontMetrics, MathGlyphMetrics, MathGlyphPlacement, MathGlyphRun, MathLayoutItem, MathRule, MathStretchAxis, MathStretchGlyph, MathStretchResult, MathStroke, Point, PositionedFormula, ProvidedFont, StyledFragment, StyledRun, TextMeasurer, UnderlineMetrics, WrapOptions, WrappedLine } from "document-schema.js";
|
|
30
30
|
export * from "byte-codec";
|
|
31
|
-
export { type CcittFaxImage, type CcittFaxOptions, DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_VERTICAL_METRIC_POLICY, DEFAULT_WORD_GAP_EM, type EmbeddedFace, type EmbeddedFaceMetrics, type EmbeddedFaceSubstitution, type FontFace, FontFaceParseError, type FontMeasurerOptions, type FontMetrics, type FontRegistry, type FontRegistryOptions, type FontSubstitution, type GlyphInkBounds, type Jbig2DecodeOptions, type Jbig2Image, Jbig2ParseError, Jbig2UnsupportedError, type Jp2ChannelDefinition, type Jp2ColourSpace, type Jp2Container, type Jp2ImageHeader, type Jpeg2000ComponentMetadata, type Jpeg2000DecodeOptions, type Jpeg2000Image, type Jpeg2000Metadata, Jpeg2000ParseError, type Jpeg2000ProgressionOrder, type Jpeg2000QuantizationStyle, type Jpeg2000Transform, Jpeg2000UnsupportedError, LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutDocumentSurface, LayoutDocumentSurfaceSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema, type LoadedMathFont, type MathAssembledGlyphs, type MathBox, type MathColor, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphAssembly, type MathGlyphConstruction, type MathGlyphMetrics, type MathGlyphPart, type MathGlyphPlacement, type MathGlyphRun, type MathGlyphVariant, type MathLayoutItem, type MathRule, type MathStretchAxis, type MathStretchConstruction, type MathStretchGlyph, type MathStretchOptions, type MathStretchPlacement, type MathStretchResult, type MathStroke, type MathVariants, NOOP_DIAGNOSTIC_SINK, type PageRasteriser, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfEncryptionError, type PdfEncryptionOptions, type PdfEncryptionPermissions, type PdfEncryptionScheme, type PdfLineWithScripts, PdfPageSelectionError, PdfParseError, PdfPartialDocumentError, PdfPasswordRequiredError, type PdfScriptPosition, PdfSkippedSurfacesError, type PdfTextBox, type PdfTextGroupingOptions, type PdfTextLine, type PdfTextRunGeometry, type PdfTextWord, type PdfWordSeparator, type Point, type PositionedFormula, type ProvidedFont, type RasterDrawOp, type RasterFillRectOp, type RasterFillSpec, type RasterImageOp, type RasterMatrix, type RasterPageGeometry, type RasterPathOp, type RasterPathSegment, type RasterRegionPt, type RasterStrokeSpec, type RasterSubpath, type ReadPdfOptions, type ReadPdfSurfaces, type RenderPdfPageOptions, type ResolvedFace, type ResolvedFont, STANDARD_METRICS, type StandardFontMeasurerOptions, type StandardFontName, type StyledFragment, type StyledRun, type TextMeasurer, type UnderlineMetrics, type VerticalMetricPolicy, type WinAnsiSubstitution, type WrapOptions, type WrappedLine, type WritePdfOptions, assembleStretchyGlyph, attachScriptRuns, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, decodeCcittFax, decodeJbig2Embedded, decodeJpeg2000, filterScanlines, groupPdfTextRuns, loadMathFont, looksLikeBareCodestream, parseJp2Container, pdfCodec, readFontFace, readJpeg2000Metadata, readPdf, renderPdfPage, resolveFaceWithRegistry, resolveStandardFont, runGapPt, runsShareBaseline, scaleMathStretchConstruction, scriptPositionOf, sourcePageIndex, unfilterScanlines, writePdf };
|
|
31
|
+
export { type CcittFaxImage, type CcittFaxOptions, DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_VERTICAL_METRIC_POLICY, DEFAULT_WORD_GAP_EM, type EmbeddedFace, type EmbeddedFaceMetrics, type EmbeddedFaceSubstitution, type FontFace, FontFaceParseError, type FontMeasurerOptions, type FontMetrics, type FontRegistry, type FontRegistryOptions, type FontSubstitution, type GlyphInkBounds, type Jbig2DecodeOptions, type Jbig2Image, Jbig2ParseError, Jbig2UnsupportedError, type Jp2ChannelDefinition, type Jp2ColourSpace, type Jp2Container, type Jp2ImageHeader, type Jpeg2000ComponentMetadata, type Jpeg2000DecodeOptions, type Jpeg2000Image, type Jpeg2000Metadata, Jpeg2000ParseError, type Jpeg2000ProgressionOrder, type Jpeg2000QuantizationStyle, type Jpeg2000Transform, Jpeg2000UnsupportedError, LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutDocumentSurface, LayoutDocumentSurfaceSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema, type LoadedMathFont, type MathAssembledGlyphs, type MathBox, type MathColor, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphAssembly, type MathGlyphConstruction, type MathGlyphMetrics, type MathGlyphPart, type MathGlyphPlacement, type MathGlyphRun, type MathGlyphVariant, type MathLayoutItem, type MathRule, type MathStretchAxis, type MathStretchConstruction, type MathStretchGlyph, type MathStretchOptions, type MathStretchPlacement, type MathStretchResult, type MathStroke, type MathVariants, NOOP_DIAGNOSTIC_SINK, type PageRasteriser, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfEncryptionError, type PdfEncryptionOptions, type PdfEncryptionPermissions, type PdfEncryptionScheme, type PdfLineWithScripts, PdfPageSelectionError, PdfParseError, PdfPartialDocumentError, PdfPasswordRequiredError, type PdfScriptPosition, PdfSkippedSurfacesError, type PdfTextBox, type PdfTextGroupingOptions, type PdfTextLine, type PdfTextRunGeometry, type PdfTextWord, type PdfWordSeparator, type Point, type PositionedFormula, type ProvidedFont, type RasterDrawOp, type RasterFillRectOp, type RasterFillSpec, type RasterImageOp, type RasterMatrix, type RasterPageGeometry, type RasterPathOp, type RasterPathSegment, type RasterRegionPt, type RasterStrokeSpec, type RasterSubpath, type ReadPdfOptions, type ReadPdfSurfaces, type RenderPdfPageOptions, type ResolvedFace, type ResolvedFont, STANDARD_METRICS, type StandardFontMeasurerOptions, type StandardFontName, type StyledFragment, type StyledRun, type TextMeasurer, type UnderlineMetrics, type VerticalMetricPolicy, type WinAnsiSubstitution, type WrapOptions, type WrappedLine, type WritePdfOptions, assembleStretchyGlyph, attachScriptRuns, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, decodeCcittFax, decodeJbig2Embedded, decodeJpeg2000, filterScanlines, groupPdfTextRuns, loadMathFont, looksLikeBareCodestream, normalisedRotationDeg, parseJp2Container, pdfCodec, readFontFace, readJpeg2000Metadata, readPdf, renderPdfPage, resolveFaceWithRegistry, resolveStandardFont, runAlongBaselinePt, runGapPt, runsShareBaseline, scaleMathStretchConstruction, scriptPositionOf, sourcePageIndex, unfilterScanlines, writePdf };
|
package/dist/index.d.ts
CHANGED
|
@@ -24,8 +24,8 @@ import { a as MathGlyphPart, c as MathVariants, n as MathGlyphAssembly, o as Mat
|
|
|
24
24
|
import { a as scaleMathStretchConstruction, i as assembleStretchyGlyph, n as MathStretchOptions, r as MathStretchPlacement, t as MathStretchConstruction } from "./math-stretch-BbC2o4Br.js";
|
|
25
25
|
import { LoadedMathFont, MathFont, MathFontDescriptorMetrics, loadMathFont } from "./math-font.js";
|
|
26
26
|
import { DEFAULT_VERTICAL_METRIC_POLICY, FontMeasurerOptions, StandardFontMeasurerOptions, VerticalMetricPolicy, createFontMeasurer, createStandardFontMeasurer } from "./measure.js";
|
|
27
|
-
import { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_WORD_GAP_EM, PdfLineWithScripts, PdfScriptPosition, PdfTextBox, PdfTextGroupingOptions, PdfTextLine, PdfTextRunGeometry, PdfTextWord, PdfWordSeparator, attachScriptRuns, groupPdfTextRuns, runGapPt, runsShareBaseline, scriptPositionOf } from "./text-group.js";
|
|
27
|
+
import { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_WORD_GAP_EM, PdfLineWithScripts, PdfScriptPosition, PdfTextBox, PdfTextGroupingOptions, PdfTextLine, PdfTextRunGeometry, PdfTextWord, PdfWordSeparator, attachScriptRuns, groupPdfTextRuns, normalisedRotationDeg, runAlongBaselinePt, runGapPt, runsShareBaseline, scriptPositionOf } from "./text-group.js";
|
|
28
28
|
import { PageRasteriser, RasterDrawOp, RasterFillRectOp, RasterFillSpec, RasterImageOp, RasterMatrix, RasterPageGeometry, RasterPathOp, RasterPathSegment, RasterRegionPt, RasterStrokeSpec, RasterSubpath, RenderPdfPageOptions, renderPdfPage } from "./raster.js";
|
|
29
29
|
import { FontRegistryOptions, FontSubstitution, MathAssembledGlyphs, MathBox, MathColor, MathFontMetrics, MathGlyphMetrics, MathGlyphPlacement, MathGlyphRun, MathLayoutItem, MathRule, MathStretchAxis, MathStretchGlyph, MathStretchResult, MathStroke, Point, PositionedFormula, ProvidedFont, StyledFragment, StyledRun, TextMeasurer, UnderlineMetrics, WrapOptions, WrappedLine } from "document-schema.js";
|
|
30
30
|
export * from "byte-codec";
|
|
31
|
-
export { type CcittFaxImage, type CcittFaxOptions, DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_VERTICAL_METRIC_POLICY, DEFAULT_WORD_GAP_EM, type EmbeddedFace, type EmbeddedFaceMetrics, type EmbeddedFaceSubstitution, type FontFace, FontFaceParseError, type FontMeasurerOptions, type FontMetrics, type FontRegistry, type FontRegistryOptions, type FontSubstitution, type GlyphInkBounds, type Jbig2DecodeOptions, type Jbig2Image, Jbig2ParseError, Jbig2UnsupportedError, type Jp2ChannelDefinition, type Jp2ColourSpace, type Jp2Container, type Jp2ImageHeader, type Jpeg2000ComponentMetadata, type Jpeg2000DecodeOptions, type Jpeg2000Image, type Jpeg2000Metadata, Jpeg2000ParseError, type Jpeg2000ProgressionOrder, type Jpeg2000QuantizationStyle, type Jpeg2000Transform, Jpeg2000UnsupportedError, LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutDocumentSurface, LayoutDocumentSurfaceSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema, type LoadedMathFont, type MathAssembledGlyphs, type MathBox, type MathColor, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphAssembly, type MathGlyphConstruction, type MathGlyphMetrics, type MathGlyphPart, type MathGlyphPlacement, type MathGlyphRun, type MathGlyphVariant, type MathLayoutItem, type MathRule, type MathStretchAxis, type MathStretchConstruction, type MathStretchGlyph, type MathStretchOptions, type MathStretchPlacement, type MathStretchResult, type MathStroke, type MathVariants, NOOP_DIAGNOSTIC_SINK, type PageRasteriser, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfEncryptionError, type PdfEncryptionOptions, type PdfEncryptionPermissions, type PdfEncryptionScheme, type PdfLineWithScripts, PdfPageSelectionError, PdfParseError, PdfPartialDocumentError, PdfPasswordRequiredError, type PdfScriptPosition, PdfSkippedSurfacesError, type PdfTextBox, type PdfTextGroupingOptions, type PdfTextLine, type PdfTextRunGeometry, type PdfTextWord, type PdfWordSeparator, type Point, type PositionedFormula, type ProvidedFont, type RasterDrawOp, type RasterFillRectOp, type RasterFillSpec, type RasterImageOp, type RasterMatrix, type RasterPageGeometry, type RasterPathOp, type RasterPathSegment, type RasterRegionPt, type RasterStrokeSpec, type RasterSubpath, type ReadPdfOptions, type ReadPdfSurfaces, type RenderPdfPageOptions, type ResolvedFace, type ResolvedFont, STANDARD_METRICS, type StandardFontMeasurerOptions, type StandardFontName, type StyledFragment, type StyledRun, type TextMeasurer, type UnderlineMetrics, type VerticalMetricPolicy, type WinAnsiSubstitution, type WrapOptions, type WrappedLine, type WritePdfOptions, assembleStretchyGlyph, attachScriptRuns, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, decodeCcittFax, decodeJbig2Embedded, decodeJpeg2000, filterScanlines, groupPdfTextRuns, loadMathFont, looksLikeBareCodestream, parseJp2Container, pdfCodec, readFontFace, readJpeg2000Metadata, readPdf, renderPdfPage, resolveFaceWithRegistry, resolveStandardFont, runGapPt, runsShareBaseline, scaleMathStretchConstruction, scriptPositionOf, sourcePageIndex, unfilterScanlines, writePdf };
|
|
31
|
+
export { type CcittFaxImage, type CcittFaxOptions, DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_VERTICAL_METRIC_POLICY, DEFAULT_WORD_GAP_EM, type EmbeddedFace, type EmbeddedFaceMetrics, type EmbeddedFaceSubstitution, type FontFace, FontFaceParseError, type FontMeasurerOptions, type FontMetrics, type FontRegistry, type FontRegistryOptions, type FontSubstitution, type GlyphInkBounds, type Jbig2DecodeOptions, type Jbig2Image, Jbig2ParseError, Jbig2UnsupportedError, type Jp2ChannelDefinition, type Jp2ColourSpace, type Jp2Container, type Jp2ImageHeader, type Jpeg2000ComponentMetadata, type Jpeg2000DecodeOptions, type Jpeg2000Image, type Jpeg2000Metadata, Jpeg2000ParseError, type Jpeg2000ProgressionOrder, type Jpeg2000QuantizationStyle, type Jpeg2000Transform, Jpeg2000UnsupportedError, LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutDocumentSurface, LayoutDocumentSurfaceSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema, type LoadedMathFont, type MathAssembledGlyphs, type MathBox, type MathColor, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphAssembly, type MathGlyphConstruction, type MathGlyphMetrics, type MathGlyphPart, type MathGlyphPlacement, type MathGlyphRun, type MathGlyphVariant, type MathLayoutItem, type MathRule, type MathStretchAxis, type MathStretchConstruction, type MathStretchGlyph, type MathStretchOptions, type MathStretchPlacement, type MathStretchResult, type MathStroke, type MathVariants, NOOP_DIAGNOSTIC_SINK, type PageRasteriser, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfEncryptionError, type PdfEncryptionOptions, type PdfEncryptionPermissions, type PdfEncryptionScheme, type PdfLineWithScripts, PdfPageSelectionError, PdfParseError, PdfPartialDocumentError, PdfPasswordRequiredError, type PdfScriptPosition, PdfSkippedSurfacesError, type PdfTextBox, type PdfTextGroupingOptions, type PdfTextLine, type PdfTextRunGeometry, type PdfTextWord, type PdfWordSeparator, type Point, type PositionedFormula, type ProvidedFont, type RasterDrawOp, type RasterFillRectOp, type RasterFillSpec, type RasterImageOp, type RasterMatrix, type RasterPageGeometry, type RasterPathOp, type RasterPathSegment, type RasterRegionPt, type RasterStrokeSpec, type RasterSubpath, type ReadPdfOptions, type ReadPdfSurfaces, type RenderPdfPageOptions, type ResolvedFace, type ResolvedFont, STANDARD_METRICS, type StandardFontMeasurerOptions, type StandardFontName, type StyledFragment, type StyledRun, type TextMeasurer, type UnderlineMetrics, type VerticalMetricPolicy, type WinAnsiSubstitution, type WrapOptions, type WrappedLine, type WritePdfOptions, assembleStretchyGlyph, attachScriptRuns, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, decodeCcittFax, decodeJbig2Embedded, decodeJpeg2000, filterScanlines, groupPdfTextRuns, loadMathFont, looksLikeBareCodestream, normalisedRotationDeg, parseJp2Container, pdfCodec, readFontFace, readJpeg2000Metadata, readPdf, renderPdfPage, resolveFaceWithRegistry, resolveStandardFont, runAlongBaselinePt, runGapPt, runsShareBaseline, scaleMathStretchConstruction, scriptPositionOf, sourcePageIndex, unfilterScanlines, writePdf };
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { decodeJpeg2000, readJpeg2000Metadata } from "./image/jpeg2000.js";
|
|
|
9
9
|
import { LAYOUT_FORMAT_VERSION, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachmentSchema, LayoutDestinationSchema, LayoutDestinationTargetSchema, LayoutDocumentSchema, LayoutDocumentSurfaceSchema, LayoutEllipseSchema, LayoutFormFieldSchema, LayoutFormWidgetSchema, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLinkSchema, LayoutItemSchema, LayoutLayerSchema, LayoutLineSchema, LayoutLinkSchema, LayoutOutlineItemSchema, LayoutPageSchema, LayoutPathSchema, LayoutPathSegmentSchema, LayoutRectSchema, LayoutStructureElementSchema, LayoutSubpathSchema, LayoutTextSchema, sourcePageIndex } from "./layout.js";
|
|
10
10
|
import { NOOP_DIAGNOSTIC_SINK, PdfEncryptedError, PdfPageSelectionError, PdfParseError, PdfPasswordRequiredError } from "./diagnostics.js";
|
|
11
11
|
import { resolveStandardFont } from "./fonts.js";
|
|
12
|
-
import { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_WORD_GAP_EM, attachScriptRuns, groupPdfTextRuns, runGapPt, runsShareBaseline, scriptPositionOf } from "./text-group.js";
|
|
12
|
+
import { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_WORD_GAP_EM, attachScriptRuns, groupPdfTextRuns, normalisedRotationDeg, runAlongBaselinePt, runGapPt, runsShareBaseline, scriptPositionOf } from "./text-group.js";
|
|
13
13
|
import { readPdf } from "./read.js";
|
|
14
14
|
import { PdfEncryptionError } from "./encrypt-write.js";
|
|
15
15
|
import { assembleStretchyGlyph, scaleMathStretchConstruction } from "./math-stretch.js";
|
|
@@ -22,4 +22,4 @@ import { PdfBytesSchema, pdfCodec } from "./codec.js";
|
|
|
22
22
|
import { FontFaceParseError, readFontFace } from "./font-face.js";
|
|
23
23
|
import { r as renderPdfPage } from "./raster-dqtea8ku.js";
|
|
24
24
|
export * from "byte-codec";
|
|
25
|
-
export { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_VERTICAL_METRIC_POLICY, DEFAULT_WORD_GAP_EM, FontFaceParseError, Jbig2ParseError, Jbig2UnsupportedError, Jpeg2000ParseError, Jpeg2000UnsupportedError, LAYOUT_FORMAT_VERSION, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachmentSchema, LayoutDestinationSchema, LayoutDestinationTargetSchema, LayoutDocumentSchema, LayoutDocumentSurfaceSchema, LayoutEllipseSchema, LayoutFormFieldSchema, LayoutFormWidgetSchema, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLinkSchema, LayoutItemSchema, LayoutLayerSchema, LayoutLineSchema, LayoutLinkSchema, LayoutOutlineItemSchema, LayoutPageSchema, LayoutPathSchema, LayoutPathSegmentSchema, LayoutRectSchema, LayoutStructureElementSchema, LayoutSubpathSchema, LayoutTextSchema, NOOP_DIAGNOSTIC_SINK, PdfBytesSchema, PdfEncryptedError, PdfEncryptionError, PdfPageSelectionError, PdfParseError, PdfPartialDocumentError, PdfPasswordRequiredError, PdfSkippedSurfacesError, STANDARD_METRICS, assembleStretchyGlyph, attachScriptRuns, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, decodeCcittFax, decodeJbig2Embedded, decodeJpeg2000, filterScanlines, groupPdfTextRuns, loadMathFont, looksLikeBareCodestream, parseJp2Container, pdfCodec, readFontFace, readJpeg2000Metadata, readPdf, renderPdfPage, resolveFaceWithRegistry, resolveStandardFont, runGapPt, runsShareBaseline, scaleMathStretchConstruction, scriptPositionOf, sourcePageIndex, unfilterScanlines, writePdf };
|
|
25
|
+
export { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_VERTICAL_METRIC_POLICY, DEFAULT_WORD_GAP_EM, FontFaceParseError, Jbig2ParseError, Jbig2UnsupportedError, Jpeg2000ParseError, Jpeg2000UnsupportedError, LAYOUT_FORMAT_VERSION, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachmentSchema, LayoutDestinationSchema, LayoutDestinationTargetSchema, LayoutDocumentSchema, LayoutDocumentSurfaceSchema, LayoutEllipseSchema, LayoutFormFieldSchema, LayoutFormWidgetSchema, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLinkSchema, LayoutItemSchema, LayoutLayerSchema, LayoutLineSchema, LayoutLinkSchema, LayoutOutlineItemSchema, LayoutPageSchema, LayoutPathSchema, LayoutPathSegmentSchema, LayoutRectSchema, LayoutStructureElementSchema, LayoutSubpathSchema, LayoutTextSchema, NOOP_DIAGNOSTIC_SINK, PdfBytesSchema, PdfEncryptedError, PdfEncryptionError, PdfPageSelectionError, PdfParseError, PdfPartialDocumentError, PdfPasswordRequiredError, PdfSkippedSurfacesError, STANDARD_METRICS, assembleStretchyGlyph, attachScriptRuns, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, decodeCcittFax, decodeJbig2Embedded, decodeJpeg2000, filterScanlines, groupPdfTextRuns, loadMathFont, looksLikeBareCodestream, normalisedRotationDeg, parseJp2Container, pdfCodec, readFontFace, readJpeg2000Metadata, readPdf, renderPdfPage, resolveFaceWithRegistry, resolveStandardFont, runAlongBaselinePt, runGapPt, runsShareBaseline, scaleMathStretchConstruction, scriptPositionOf, sourcePageIndex, unfilterScanlines, writePdf };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_glyph_names = require("./glyph-names.cjs");
|
|
3
|
+
const require_encoding_symbol_tables = require("./encoding-symbol-tables.cjs");
|
|
4
|
+
const require_wingdings_characters = require("./wingdings-characters.cjs");
|
|
5
|
+
//#region src/symbol-font-private-use.ts
|
|
6
|
+
const SYMBOL_FONT_PRIVATE_USE_BASE = 61440;
|
|
7
|
+
/**
|
|
8
|
+
* The symbol font a font family name stands for, whichever way the producer spells it ("Symbol", "SymbolMT", "Wingdings"), or `undefined` for any other font.
|
|
9
|
+
* @param family - The font's family as `styleFromBaseFontName` reads it from `/BaseFont`: the subset tag and style suffix already removed.
|
|
10
|
+
* @returns The symbol font the family names, or `undefined`.
|
|
11
|
+
*/
|
|
12
|
+
function symbolFontOf(family) {
|
|
13
|
+
const name = family.replace(/[\s_-]/gu, "").toLowerCase();
|
|
14
|
+
if (name === "symbol" || name === "symbolmt") return "symbol";
|
|
15
|
+
return name === "wingdings" ? "wingdings" : void 0;
|
|
16
|
+
}
|
|
17
|
+
function isSymbolFontCode(codePoint) {
|
|
18
|
+
return codePoint >= 61472 && codePoint <= 61695;
|
|
19
|
+
}
|
|
20
|
+
function isPrivateUse(text) {
|
|
21
|
+
return /^\p{Co}/u.test(text);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The Symbol glyphs that the Adobe Glyph List gives code points of Adobe's own Private Use Area (U+F6xx and U+F8xx), which name no character, and the Unicode characters that are the same glyphs: the pieces a tall bracket, parenthesis or brace is assembled from, the extensions of the integral, vertical-arrow and horizontal-arrow signs, and the serif and sans-serif registered, copyright and trade mark signs. Keyed by the glyph's PostScript name in the Symbol font's built-in encoding (Adobe's `symbol.txt`, https://www.unicode.org/Public/MAPPINGS/VENDORS/ADOBE/symbol.txt, archived at https://web.archive.org/web/20261011050748/http://www.unicode.org/Public/MAPPINGS/VENDORS/ADOBE/symbol.txt), valued by the character of the Unicode Miscellaneous Technical block (https://www.unicode.org/charts/PDF/U2300.pdf, archived at https://web.archive.org/web/2026/https://www.unicode.org/charts/PDF/U2300.pdf) or Latin-1 and Letterlike Symbols block the glyph is. `radicalex`, the extension of the radical sign, is the one such glyph with no Unicode character, and stays as it was written.
|
|
25
|
+
*/
|
|
26
|
+
const SYMBOL_ASSEMBLY_PIECES = /* @__PURE__ */ new Map([
|
|
27
|
+
["parenlefttp", "โ"],
|
|
28
|
+
["parenleftex", "โ"],
|
|
29
|
+
["parenleftbt", "โ"],
|
|
30
|
+
["parenrighttp", "โ"],
|
|
31
|
+
["parenrightex", "โ"],
|
|
32
|
+
["parenrightbt", "โ "],
|
|
33
|
+
["bracketlefttp", "โก"],
|
|
34
|
+
["bracketleftex", "โข"],
|
|
35
|
+
["bracketleftbt", "โฃ"],
|
|
36
|
+
["bracketrighttp", "โค"],
|
|
37
|
+
["bracketrightex", "โฅ"],
|
|
38
|
+
["bracketrightbt", "โฆ"],
|
|
39
|
+
["bracelefttp", "โง"],
|
|
40
|
+
["braceleftmid", "โจ"],
|
|
41
|
+
["braceleftbt", "โฉ"],
|
|
42
|
+
["braceex", "โช"],
|
|
43
|
+
["bracerighttp", "โซ"],
|
|
44
|
+
["bracerightmid", "โฌ"],
|
|
45
|
+
["bracerightbt", "โญ"],
|
|
46
|
+
["integralex", "โฎ"],
|
|
47
|
+
["arrowhorizex", "โฏ"],
|
|
48
|
+
["arrowvertex", "โ"],
|
|
49
|
+
["registerserif", "ยฎ"],
|
|
50
|
+
["registersans", "ยฎ"],
|
|
51
|
+
["copyrightserif", "ยฉ"],
|
|
52
|
+
["copyrightsans", "ยฉ"],
|
|
53
|
+
["trademarkserif", "โข"],
|
|
54
|
+
["trademarksans", "โข"]
|
|
55
|
+
]);
|
|
56
|
+
function symbolCharacter(code) {
|
|
57
|
+
const name = require_encoding_symbol_tables.symbolGlyphName(code);
|
|
58
|
+
if (name === void 0) return;
|
|
59
|
+
const piece = SYMBOL_ASSEMBLY_PIECES.get(name);
|
|
60
|
+
if (piece !== void 0) return piece;
|
|
61
|
+
const text = require_glyph_names.glyphNameToUnicode(name);
|
|
62
|
+
return text !== void 0 && text !== "" && !isPrivateUse(text) ? text : void 0;
|
|
63
|
+
}
|
|
64
|
+
function wingdingsCharacter(code) {
|
|
65
|
+
const character = require_wingdings_characters.WINGDINGS_CHARACTERS[code];
|
|
66
|
+
return character === void 0 || character === "" ? void 0 : character;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* `text`, the Unicode a font's /ToUnicode CMap gave for a run of its codes, with each Private Use Area code point that is one of the font's own 8-bit codes (0xF020 to 0xF0FF) replaced by the character the font's glyph at that code is. Nothing else changes: a code point outside that range, one the font has no character at, and every character of a font that is not a symbol font stay as they were.
|
|
70
|
+
* @param font - The symbol font the text was read through, `undefined` for any other font, whose text is returned as it is.
|
|
71
|
+
* @param text - The text a CMap gave for one or more codes.
|
|
72
|
+
* @returns The text with the font's own characters in place of its private-use code points.
|
|
73
|
+
*/
|
|
74
|
+
function withSymbolFontCharacters(font, text) {
|
|
75
|
+
if (font === void 0) return text;
|
|
76
|
+
const character = font === "symbol" ? symbolCharacter : wingdingsCharacter;
|
|
77
|
+
let out = "";
|
|
78
|
+
for (const char of text) {
|
|
79
|
+
const codePoint = char.codePointAt(0);
|
|
80
|
+
out += codePoint !== void 0 && isSymbolFontCode(codePoint) ? character(codePoint - SYMBOL_FONT_PRIVATE_USE_BASE) ?? char : char;
|
|
81
|
+
}
|
|
82
|
+
return out;
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
exports.symbolFontOf = symbolFontOf;
|
|
86
|
+
exports.withSymbolFontCharacters = withSymbolFontCharacters;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/symbol-font-private-use.d.ts
|
|
2
|
+
/** The symbol fonts whose 8-bit codes are mapped: the two a Word document uses for bullets, ticks, arrows and mathematical signs. Wingdings 2 and 3, Webdings and ZapfDingbats are different fonts with their own tables and are left as the producer wrote them. */
|
|
3
|
+
type SymbolFont = "symbol" | "wingdings";
|
|
4
|
+
/**
|
|
5
|
+
* The symbol font a font family name stands for, whichever way the producer spells it ("Symbol", "SymbolMT", "Wingdings"), or `undefined` for any other font.
|
|
6
|
+
* @param family - The font's family as `styleFromBaseFontName` reads it from `/BaseFont`: the subset tag and style suffix already removed.
|
|
7
|
+
* @returns The symbol font the family names, or `undefined`.
|
|
8
|
+
*/
|
|
9
|
+
declare function symbolFontOf(family: string): SymbolFont | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* `text`, the Unicode a font's /ToUnicode CMap gave for a run of its codes, with each Private Use Area code point that is one of the font's own 8-bit codes (0xF020 to 0xF0FF) replaced by the character the font's glyph at that code is. Nothing else changes: a code point outside that range, one the font has no character at, and every character of a font that is not a symbol font stay as they were.
|
|
12
|
+
* @param font - The symbol font the text was read through, `undefined` for any other font, whose text is returned as it is.
|
|
13
|
+
* @param text - The text a CMap gave for one or more codes.
|
|
14
|
+
* @returns The text with the font's own characters in place of its private-use code points.
|
|
15
|
+
*/
|
|
16
|
+
declare function withSymbolFontCharacters(font: SymbolFont | undefined, text: string): string;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { SymbolFont, symbolFontOf, withSymbolFontCharacters };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/symbol-font-private-use.d.ts
|
|
2
|
+
/** The symbol fonts whose 8-bit codes are mapped: the two a Word document uses for bullets, ticks, arrows and mathematical signs. Wingdings 2 and 3, Webdings and ZapfDingbats are different fonts with their own tables and are left as the producer wrote them. */
|
|
3
|
+
type SymbolFont = "symbol" | "wingdings";
|
|
4
|
+
/**
|
|
5
|
+
* The symbol font a font family name stands for, whichever way the producer spells it ("Symbol", "SymbolMT", "Wingdings"), or `undefined` for any other font.
|
|
6
|
+
* @param family - The font's family as `styleFromBaseFontName` reads it from `/BaseFont`: the subset tag and style suffix already removed.
|
|
7
|
+
* @returns The symbol font the family names, or `undefined`.
|
|
8
|
+
*/
|
|
9
|
+
declare function symbolFontOf(family: string): SymbolFont | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* `text`, the Unicode a font's /ToUnicode CMap gave for a run of its codes, with each Private Use Area code point that is one of the font's own 8-bit codes (0xF020 to 0xF0FF) replaced by the character the font's glyph at that code is. Nothing else changes: a code point outside that range, one the font has no character at, and every character of a font that is not a symbol font stay as they were.
|
|
12
|
+
* @param font - The symbol font the text was read through, `undefined` for any other font, whose text is returned as it is.
|
|
13
|
+
* @param text - The text a CMap gave for one or more codes.
|
|
14
|
+
* @returns The text with the font's own characters in place of its private-use code points.
|
|
15
|
+
*/
|
|
16
|
+
declare function withSymbolFontCharacters(font: SymbolFont | undefined, text: string): string;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { SymbolFont, symbolFontOf, withSymbolFontCharacters };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { glyphNameToUnicode } from "./glyph-names.js";
|
|
2
|
+
import { symbolGlyphName } from "./encoding-symbol-tables.js";
|
|
3
|
+
import { WINGDINGS_CHARACTERS } from "./wingdings-characters.js";
|
|
4
|
+
//#region src/symbol-font-private-use.ts
|
|
5
|
+
const SYMBOL_FONT_PRIVATE_USE_BASE = 61440;
|
|
6
|
+
/**
|
|
7
|
+
* The symbol font a font family name stands for, whichever way the producer spells it ("Symbol", "SymbolMT", "Wingdings"), or `undefined` for any other font.
|
|
8
|
+
* @param family - The font's family as `styleFromBaseFontName` reads it from `/BaseFont`: the subset tag and style suffix already removed.
|
|
9
|
+
* @returns The symbol font the family names, or `undefined`.
|
|
10
|
+
*/
|
|
11
|
+
function symbolFontOf(family) {
|
|
12
|
+
const name = family.replace(/[\s_-]/gu, "").toLowerCase();
|
|
13
|
+
if (name === "symbol" || name === "symbolmt") return "symbol";
|
|
14
|
+
return name === "wingdings" ? "wingdings" : void 0;
|
|
15
|
+
}
|
|
16
|
+
function isSymbolFontCode(codePoint) {
|
|
17
|
+
return codePoint >= 61472 && codePoint <= 61695;
|
|
18
|
+
}
|
|
19
|
+
function isPrivateUse(text) {
|
|
20
|
+
return /^\p{Co}/u.test(text);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The Symbol glyphs that the Adobe Glyph List gives code points of Adobe's own Private Use Area (U+F6xx and U+F8xx), which name no character, and the Unicode characters that are the same glyphs: the pieces a tall bracket, parenthesis or brace is assembled from, the extensions of the integral, vertical-arrow and horizontal-arrow signs, and the serif and sans-serif registered, copyright and trade mark signs. Keyed by the glyph's PostScript name in the Symbol font's built-in encoding (Adobe's `symbol.txt`, https://www.unicode.org/Public/MAPPINGS/VENDORS/ADOBE/symbol.txt, archived at https://web.archive.org/web/20261011050748/http://www.unicode.org/Public/MAPPINGS/VENDORS/ADOBE/symbol.txt), valued by the character of the Unicode Miscellaneous Technical block (https://www.unicode.org/charts/PDF/U2300.pdf, archived at https://web.archive.org/web/2026/https://www.unicode.org/charts/PDF/U2300.pdf) or Latin-1 and Letterlike Symbols block the glyph is. `radicalex`, the extension of the radical sign, is the one such glyph with no Unicode character, and stays as it was written.
|
|
24
|
+
*/
|
|
25
|
+
const SYMBOL_ASSEMBLY_PIECES = /* @__PURE__ */ new Map([
|
|
26
|
+
["parenlefttp", "โ"],
|
|
27
|
+
["parenleftex", "โ"],
|
|
28
|
+
["parenleftbt", "โ"],
|
|
29
|
+
["parenrighttp", "โ"],
|
|
30
|
+
["parenrightex", "โ"],
|
|
31
|
+
["parenrightbt", "โ "],
|
|
32
|
+
["bracketlefttp", "โก"],
|
|
33
|
+
["bracketleftex", "โข"],
|
|
34
|
+
["bracketleftbt", "โฃ"],
|
|
35
|
+
["bracketrighttp", "โค"],
|
|
36
|
+
["bracketrightex", "โฅ"],
|
|
37
|
+
["bracketrightbt", "โฆ"],
|
|
38
|
+
["bracelefttp", "โง"],
|
|
39
|
+
["braceleftmid", "โจ"],
|
|
40
|
+
["braceleftbt", "โฉ"],
|
|
41
|
+
["braceex", "โช"],
|
|
42
|
+
["bracerighttp", "โซ"],
|
|
43
|
+
["bracerightmid", "โฌ"],
|
|
44
|
+
["bracerightbt", "โญ"],
|
|
45
|
+
["integralex", "โฎ"],
|
|
46
|
+
["arrowhorizex", "โฏ"],
|
|
47
|
+
["arrowvertex", "โ"],
|
|
48
|
+
["registerserif", "ยฎ"],
|
|
49
|
+
["registersans", "ยฎ"],
|
|
50
|
+
["copyrightserif", "ยฉ"],
|
|
51
|
+
["copyrightsans", "ยฉ"],
|
|
52
|
+
["trademarkserif", "โข"],
|
|
53
|
+
["trademarksans", "โข"]
|
|
54
|
+
]);
|
|
55
|
+
function symbolCharacter(code) {
|
|
56
|
+
const name = symbolGlyphName(code);
|
|
57
|
+
if (name === void 0) return;
|
|
58
|
+
const piece = SYMBOL_ASSEMBLY_PIECES.get(name);
|
|
59
|
+
if (piece !== void 0) return piece;
|
|
60
|
+
const text = glyphNameToUnicode(name);
|
|
61
|
+
return text !== void 0 && text !== "" && !isPrivateUse(text) ? text : void 0;
|
|
62
|
+
}
|
|
63
|
+
function wingdingsCharacter(code) {
|
|
64
|
+
const character = WINGDINGS_CHARACTERS[code];
|
|
65
|
+
return character === void 0 || character === "" ? void 0 : character;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* `text`, the Unicode a font's /ToUnicode CMap gave for a run of its codes, with each Private Use Area code point that is one of the font's own 8-bit codes (0xF020 to 0xF0FF) replaced by the character the font's glyph at that code is. Nothing else changes: a code point outside that range, one the font has no character at, and every character of a font that is not a symbol font stay as they were.
|
|
69
|
+
* @param font - The symbol font the text was read through, `undefined` for any other font, whose text is returned as it is.
|
|
70
|
+
* @param text - The text a CMap gave for one or more codes.
|
|
71
|
+
* @returns The text with the font's own characters in place of its private-use code points.
|
|
72
|
+
*/
|
|
73
|
+
function withSymbolFontCharacters(font, text) {
|
|
74
|
+
if (font === void 0) return text;
|
|
75
|
+
const character = font === "symbol" ? symbolCharacter : wingdingsCharacter;
|
|
76
|
+
let out = "";
|
|
77
|
+
for (const char of text) {
|
|
78
|
+
const codePoint = char.codePointAt(0);
|
|
79
|
+
out += codePoint !== void 0 && isSymbolFontCode(codePoint) ? character(codePoint - SYMBOL_FONT_PRIVATE_USE_BASE) ?? char : char;
|
|
80
|
+
}
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
export { symbolFontOf, withSymbolFontCharacters };
|
package/dist/text-group.cjs
CHANGED
|
@@ -5,9 +5,16 @@ const DEFAULT_COLUMN_GAP_EM = 1;
|
|
|
5
5
|
const ROTATION_NOISE_DEG = 1e-6;
|
|
6
6
|
const DEGREES_PER_TURN = 360;
|
|
7
7
|
const VERTICAL_ADVANCE_OFFSET_DEG = -90;
|
|
8
|
+
/**
|
|
9
|
+
* An anticlockwise rotation as one canonical number: normalised into [0, 360) and rounded to remove the last-bit noise atan2 leaves, so two runs set at one angle report the identical value and a comparison against a quarter turn is exact.
|
|
10
|
+
* @param rotationDeg - a rotation in degrees, anticlockwise from the page's x-axis; absent means zero
|
|
11
|
+
* @returns the same angle in [0, 360)
|
|
12
|
+
*/
|
|
13
|
+
function normalisedRotationDeg(rotationDeg) {
|
|
14
|
+
return (Math.round((rotationDeg ?? 0) / ROTATION_NOISE_DEG) * ROTATION_NOISE_DEG % DEGREES_PER_TURN + DEGREES_PER_TURN) % DEGREES_PER_TURN;
|
|
15
|
+
}
|
|
8
16
|
function advanceAngleDeg(run) {
|
|
9
|
-
|
|
10
|
-
return (Math.round(raw / ROTATION_NOISE_DEG) * ROTATION_NOISE_DEG % DEGREES_PER_TURN + DEGREES_PER_TURN) % DEGREES_PER_TURN;
|
|
17
|
+
return normalisedRotationDeg((run.rotationDeg ?? 0) + (run.writingMode === "vertical" ? VERTICAL_ADVANCE_OFFSET_DEG : 0));
|
|
11
18
|
}
|
|
12
19
|
const RADIANS_PER_TURN = 2 * Math.PI;
|
|
13
20
|
function baselineAxis(rotationDeg) {
|
|
@@ -49,6 +56,14 @@ function runsShareBaseline(a, b, options = {}) {
|
|
|
49
56
|
return Math.abs(project(a, rotationDeg).acrossPt - project(b, rotationDeg).acrossPt) <= toleranceEm * Math.min(a.sizePt, b.sizePt);
|
|
50
57
|
}
|
|
51
58
|
/**
|
|
59
|
+
* Where a run starts along the direction it advances in: the coordinate that puts the runs of one line in reading order, at whatever angle the line is set. For an upright run it is the run's `xPt`; for a run turned a quarter turn anticlockwise, read upward, it is its `yPt`.
|
|
60
|
+
* @param run - a positioned run
|
|
61
|
+
* @returns the run's origin projected onto its own baseline, in points
|
|
62
|
+
*/
|
|
63
|
+
function runAlongBaselinePt(run) {
|
|
64
|
+
return project(run, advanceAngleDeg(run)).alongPt;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
52
67
|
* The horizontal gap along the baseline between the end of `previous` and the start of `next`, or undefined when the geometry does not state one.
|
|
53
68
|
*
|
|
54
69
|
* Undefined has exactly two causes, and a caller must treat both as "no evidence of a space" rather than substituting zero: `previous` stated no advance width, so where it ends is unknown; or the two runs are set at different angles, so they share no axis to measure along. A negative result is real and means the two runs overlap.
|
|
@@ -298,6 +313,8 @@ exports.DEFAULT_COLUMN_GAP_EM = DEFAULT_COLUMN_GAP_EM;
|
|
|
298
313
|
exports.DEFAULT_WORD_GAP_EM = DEFAULT_WORD_GAP_EM;
|
|
299
314
|
exports.attachScriptRuns = attachScriptRuns;
|
|
300
315
|
exports.groupPdfTextRuns = groupPdfTextRuns;
|
|
316
|
+
exports.normalisedRotationDeg = normalisedRotationDeg;
|
|
317
|
+
exports.runAlongBaselinePt = runAlongBaselinePt;
|
|
301
318
|
exports.runGapPt = runGapPt;
|
|
302
319
|
exports.runsShareBaseline = runsShareBaseline;
|
|
303
320
|
exports.scriptPositionOf = scriptPositionOf;
|
package/dist/text-group.d.cts
CHANGED
|
@@ -37,6 +37,12 @@ interface PdfTextGroupingOptions {
|
|
|
37
37
|
declare const DEFAULT_BASELINE_TOLERANCE_EM: number;
|
|
38
38
|
declare const DEFAULT_WORD_GAP_EM: number;
|
|
39
39
|
declare const DEFAULT_COLUMN_GAP_EM = 1;
|
|
40
|
+
/**
|
|
41
|
+
* An anticlockwise rotation as one canonical number: normalised into [0, 360) and rounded to remove the last-bit noise atan2 leaves, so two runs set at one angle report the identical value and a comparison against a quarter turn is exact.
|
|
42
|
+
* @param rotationDeg - a rotation in degrees, anticlockwise from the page's x-axis; absent means zero
|
|
43
|
+
* @returns the same angle in [0, 360)
|
|
44
|
+
*/
|
|
45
|
+
declare function normalisedRotationDeg(rotationDeg: number | undefined): number;
|
|
40
46
|
/**
|
|
41
47
|
* Whether two positioned runs sit on one visual line.
|
|
42
48
|
*
|
|
@@ -47,6 +53,12 @@ declare const DEFAULT_COLUMN_GAP_EM = 1;
|
|
|
47
53
|
* @returns true when the two baselines are within tolerance of each other
|
|
48
54
|
*/
|
|
49
55
|
declare function runsShareBaseline(a: PdfTextRunGeometry, b: PdfTextRunGeometry, options?: PdfTextGroupingOptions): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Where a run starts along the direction it advances in: the coordinate that puts the runs of one line in reading order, at whatever angle the line is set. For an upright run it is the run's `xPt`; for a run turned a quarter turn anticlockwise, read upward, it is its `yPt`.
|
|
58
|
+
* @param run - a positioned run
|
|
59
|
+
* @returns the run's origin projected onto its own baseline, in points
|
|
60
|
+
*/
|
|
61
|
+
declare function runAlongBaselinePt(run: PdfTextRunGeometry): number;
|
|
50
62
|
/**
|
|
51
63
|
* The horizontal gap along the baseline between the end of `previous` and the start of `next`, or undefined when the geometry does not state one.
|
|
52
64
|
*
|
|
@@ -95,4 +107,4 @@ declare function attachScriptRuns<TLine, TRun extends PdfTextRunGeometry>(lines:
|
|
|
95
107
|
*/
|
|
96
108
|
declare function groupPdfTextRuns<TRun extends PdfTextRunGeometry>(runs: readonly TRun[], options?: PdfTextGroupingOptions): PdfTextLine<TRun>[];
|
|
97
109
|
//#endregion
|
|
98
|
-
export { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_WORD_GAP_EM, PdfLineWithScripts, PdfScriptPosition, PdfTextBox, PdfTextGroupingOptions, PdfTextLine, PdfTextRunGeometry, PdfTextWord, PdfWordSeparator, attachScriptRuns, groupPdfTextRuns, runGapPt, runsShareBaseline, scriptPositionOf };
|
|
110
|
+
export { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_WORD_GAP_EM, PdfLineWithScripts, PdfScriptPosition, PdfTextBox, PdfTextGroupingOptions, PdfTextLine, PdfTextRunGeometry, PdfTextWord, PdfWordSeparator, attachScriptRuns, groupPdfTextRuns, normalisedRotationDeg, runAlongBaselinePt, runGapPt, runsShareBaseline, scriptPositionOf };
|
package/dist/text-group.d.ts
CHANGED
|
@@ -37,6 +37,12 @@ interface PdfTextGroupingOptions {
|
|
|
37
37
|
declare const DEFAULT_BASELINE_TOLERANCE_EM: number;
|
|
38
38
|
declare const DEFAULT_WORD_GAP_EM: number;
|
|
39
39
|
declare const DEFAULT_COLUMN_GAP_EM = 1;
|
|
40
|
+
/**
|
|
41
|
+
* An anticlockwise rotation as one canonical number: normalised into [0, 360) and rounded to remove the last-bit noise atan2 leaves, so two runs set at one angle report the identical value and a comparison against a quarter turn is exact.
|
|
42
|
+
* @param rotationDeg - a rotation in degrees, anticlockwise from the page's x-axis; absent means zero
|
|
43
|
+
* @returns the same angle in [0, 360)
|
|
44
|
+
*/
|
|
45
|
+
declare function normalisedRotationDeg(rotationDeg: number | undefined): number;
|
|
40
46
|
/**
|
|
41
47
|
* Whether two positioned runs sit on one visual line.
|
|
42
48
|
*
|
|
@@ -47,6 +53,12 @@ declare const DEFAULT_COLUMN_GAP_EM = 1;
|
|
|
47
53
|
* @returns true when the two baselines are within tolerance of each other
|
|
48
54
|
*/
|
|
49
55
|
declare function runsShareBaseline(a: PdfTextRunGeometry, b: PdfTextRunGeometry, options?: PdfTextGroupingOptions): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Where a run starts along the direction it advances in: the coordinate that puts the runs of one line in reading order, at whatever angle the line is set. For an upright run it is the run's `xPt`; for a run turned a quarter turn anticlockwise, read upward, it is its `yPt`.
|
|
58
|
+
* @param run - a positioned run
|
|
59
|
+
* @returns the run's origin projected onto its own baseline, in points
|
|
60
|
+
*/
|
|
61
|
+
declare function runAlongBaselinePt(run: PdfTextRunGeometry): number;
|
|
50
62
|
/**
|
|
51
63
|
* The horizontal gap along the baseline between the end of `previous` and the start of `next`, or undefined when the geometry does not state one.
|
|
52
64
|
*
|
|
@@ -95,4 +107,4 @@ declare function attachScriptRuns<TLine, TRun extends PdfTextRunGeometry>(lines:
|
|
|
95
107
|
*/
|
|
96
108
|
declare function groupPdfTextRuns<TRun extends PdfTextRunGeometry>(runs: readonly TRun[], options?: PdfTextGroupingOptions): PdfTextLine<TRun>[];
|
|
97
109
|
//#endregion
|
|
98
|
-
export { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_WORD_GAP_EM, PdfLineWithScripts, PdfScriptPosition, PdfTextBox, PdfTextGroupingOptions, PdfTextLine, PdfTextRunGeometry, PdfTextWord, PdfWordSeparator, attachScriptRuns, groupPdfTextRuns, runGapPt, runsShareBaseline, scriptPositionOf };
|
|
110
|
+
export { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_WORD_GAP_EM, PdfLineWithScripts, PdfScriptPosition, PdfTextBox, PdfTextGroupingOptions, PdfTextLine, PdfTextRunGeometry, PdfTextWord, PdfWordSeparator, attachScriptRuns, groupPdfTextRuns, normalisedRotationDeg, runAlongBaselinePt, runGapPt, runsShareBaseline, scriptPositionOf };
|
package/dist/text-group.js
CHANGED
|
@@ -4,9 +4,16 @@ const DEFAULT_COLUMN_GAP_EM = 1;
|
|
|
4
4
|
const ROTATION_NOISE_DEG = 1e-6;
|
|
5
5
|
const DEGREES_PER_TURN = 360;
|
|
6
6
|
const VERTICAL_ADVANCE_OFFSET_DEG = -90;
|
|
7
|
+
/**
|
|
8
|
+
* An anticlockwise rotation as one canonical number: normalised into [0, 360) and rounded to remove the last-bit noise atan2 leaves, so two runs set at one angle report the identical value and a comparison against a quarter turn is exact.
|
|
9
|
+
* @param rotationDeg - a rotation in degrees, anticlockwise from the page's x-axis; absent means zero
|
|
10
|
+
* @returns the same angle in [0, 360)
|
|
11
|
+
*/
|
|
12
|
+
function normalisedRotationDeg(rotationDeg) {
|
|
13
|
+
return (Math.round((rotationDeg ?? 0) / ROTATION_NOISE_DEG) * ROTATION_NOISE_DEG % DEGREES_PER_TURN + DEGREES_PER_TURN) % DEGREES_PER_TURN;
|
|
14
|
+
}
|
|
7
15
|
function advanceAngleDeg(run) {
|
|
8
|
-
|
|
9
|
-
return (Math.round(raw / ROTATION_NOISE_DEG) * ROTATION_NOISE_DEG % DEGREES_PER_TURN + DEGREES_PER_TURN) % DEGREES_PER_TURN;
|
|
16
|
+
return normalisedRotationDeg((run.rotationDeg ?? 0) + (run.writingMode === "vertical" ? VERTICAL_ADVANCE_OFFSET_DEG : 0));
|
|
10
17
|
}
|
|
11
18
|
const RADIANS_PER_TURN = 2 * Math.PI;
|
|
12
19
|
function baselineAxis(rotationDeg) {
|
|
@@ -48,6 +55,14 @@ function runsShareBaseline(a, b, options = {}) {
|
|
|
48
55
|
return Math.abs(project(a, rotationDeg).acrossPt - project(b, rotationDeg).acrossPt) <= toleranceEm * Math.min(a.sizePt, b.sizePt);
|
|
49
56
|
}
|
|
50
57
|
/**
|
|
58
|
+
* Where a run starts along the direction it advances in: the coordinate that puts the runs of one line in reading order, at whatever angle the line is set. For an upright run it is the run's `xPt`; for a run turned a quarter turn anticlockwise, read upward, it is its `yPt`.
|
|
59
|
+
* @param run - a positioned run
|
|
60
|
+
* @returns the run's origin projected onto its own baseline, in points
|
|
61
|
+
*/
|
|
62
|
+
function runAlongBaselinePt(run) {
|
|
63
|
+
return project(run, advanceAngleDeg(run)).alongPt;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
51
66
|
* The horizontal gap along the baseline between the end of `previous` and the start of `next`, or undefined when the geometry does not state one.
|
|
52
67
|
*
|
|
53
68
|
* Undefined has exactly two causes, and a caller must treat both as "no evidence of a space" rather than substituting zero: `previous` stated no advance width, so where it ends is unknown; or the two runs are set at different angles, so they share no axis to measure along. A negative result is real and means the two runs overlap.
|
|
@@ -292,4 +307,4 @@ function groupPdfTextRuns(runs, options = {}) {
|
|
|
292
307
|
return result;
|
|
293
308
|
}
|
|
294
309
|
//#endregion
|
|
295
|
-
export { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_WORD_GAP_EM, attachScriptRuns, groupPdfTextRuns, runGapPt, runsShareBaseline, scriptPositionOf };
|
|
310
|
+
export { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_WORD_GAP_EM, attachScriptRuns, groupPdfTextRuns, normalisedRotationDeg, runAlongBaselinePt, runGapPt, runsShareBaseline, scriptPositionOf };
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/wingdings-characters.ts
|
|
3
|
+
const WINGDINGS_CHARACTERS = [
|
|
4
|
+
"",
|
|
5
|
+
"",
|
|
6
|
+
"",
|
|
7
|
+
"",
|
|
8
|
+
"",
|
|
9
|
+
"",
|
|
10
|
+
"",
|
|
11
|
+
"",
|
|
12
|
+
"",
|
|
13
|
+
"",
|
|
14
|
+
"",
|
|
15
|
+
"",
|
|
16
|
+
"",
|
|
17
|
+
"",
|
|
18
|
+
"",
|
|
19
|
+
"",
|
|
20
|
+
"",
|
|
21
|
+
"",
|
|
22
|
+
"",
|
|
23
|
+
"",
|
|
24
|
+
"",
|
|
25
|
+
"",
|
|
26
|
+
"",
|
|
27
|
+
"",
|
|
28
|
+
"",
|
|
29
|
+
"",
|
|
30
|
+
"",
|
|
31
|
+
"",
|
|
32
|
+
"",
|
|
33
|
+
"",
|
|
34
|
+
"",
|
|
35
|
+
"",
|
|
36
|
+
" ",
|
|
37
|
+
"๐",
|
|
38
|
+
"โ",
|
|
39
|
+
"โ",
|
|
40
|
+
"๐",
|
|
41
|
+
"๐ญ",
|
|
42
|
+
"๐ฎ",
|
|
43
|
+
"๐ฏ",
|
|
44
|
+
"๐ฟ",
|
|
45
|
+
"โ",
|
|
46
|
+
"๐",
|
|
47
|
+
"๐",
|
|
48
|
+
"๐ช",
|
|
49
|
+
"๐ซ",
|
|
50
|
+
"๐ฌ",
|
|
51
|
+
"๐ญ",
|
|
52
|
+
"๐",
|
|
53
|
+
"๐",
|
|
54
|
+
"๐",
|
|
55
|
+
"๐",
|
|
56
|
+
"๐",
|
|
57
|
+
"๐",
|
|
58
|
+
"โณ",
|
|
59
|
+
"๐ฎ",
|
|
60
|
+
"๐ฐ",
|
|
61
|
+
"๐ฒ",
|
|
62
|
+
"๐ณ",
|
|
63
|
+
"๐ด",
|
|
64
|
+
"๐ซ",
|
|
65
|
+
"๐ฌ",
|
|
66
|
+
"โ",
|
|
67
|
+
"โ",
|
|
68
|
+
"๐",
|
|
69
|
+
"โ",
|
|
70
|
+
"๐",
|
|
71
|
+
"๐",
|
|
72
|
+
"๐",
|
|
73
|
+
"โ",
|
|
74
|
+
"โ",
|
|
75
|
+
"โ",
|
|
76
|
+
"๐",
|
|
77
|
+
"๐",
|
|
78
|
+
"โบ",
|
|
79
|
+
"๐",
|
|
80
|
+
"โน",
|
|
81
|
+
"๐ฃ",
|
|
82
|
+
"๐ฑ",
|
|
83
|
+
"๐ณ",
|
|
84
|
+
"๐ฑ",
|
|
85
|
+
"โ",
|
|
86
|
+
"โผ",
|
|
87
|
+
"๐ข",
|
|
88
|
+
"โ",
|
|
89
|
+
"๐",
|
|
90
|
+
"โ",
|
|
91
|
+
"๐",
|
|
92
|
+
"โ ",
|
|
93
|
+
"โก",
|
|
94
|
+
"โช",
|
|
95
|
+
"โฏ",
|
|
96
|
+
"๐",
|
|
97
|
+
"โธ",
|
|
98
|
+
"โ",
|
|
99
|
+
"โ",
|
|
100
|
+
"โ",
|
|
101
|
+
"โ",
|
|
102
|
+
"โ",
|
|
103
|
+
"โ",
|
|
104
|
+
"โ",
|
|
105
|
+
"โ",
|
|
106
|
+
"โ",
|
|
107
|
+
"โ",
|
|
108
|
+
"โ",
|
|
109
|
+
"โ",
|
|
110
|
+
"๐ฐ",
|
|
111
|
+
"๐ต",
|
|
112
|
+
"โซ",
|
|
113
|
+
"๐พ",
|
|
114
|
+
"โผ",
|
|
115
|
+
"๐",
|
|
116
|
+
"๐",
|
|
117
|
+
"โ",
|
|
118
|
+
"โ",
|
|
119
|
+
"๐",
|
|
120
|
+
"โงซ",
|
|
121
|
+
"โ",
|
|
122
|
+
"โ",
|
|
123
|
+
"๐",
|
|
124
|
+
"โง",
|
|
125
|
+
"โฎน",
|
|
126
|
+
"โ",
|
|
127
|
+
"๐ต",
|
|
128
|
+
"๐ถ",
|
|
129
|
+
"๐ถ",
|
|
130
|
+
"๐ท",
|
|
131
|
+
"",
|
|
132
|
+
"๐",
|
|
133
|
+
"โ",
|
|
134
|
+
"โ",
|
|
135
|
+
"โ",
|
|
136
|
+
"โ",
|
|
137
|
+
"โ",
|
|
138
|
+
"โ
",
|
|
139
|
+
"โ",
|
|
140
|
+
"โ",
|
|
141
|
+
"โ",
|
|
142
|
+
"โ",
|
|
143
|
+
"๐",
|
|
144
|
+
"โ",
|
|
145
|
+
"โ",
|
|
146
|
+
"โ",
|
|
147
|
+
"โ",
|
|
148
|
+
"โ",
|
|
149
|
+
"โ",
|
|
150
|
+
"โ",
|
|
151
|
+
"โ",
|
|
152
|
+
"โ",
|
|
153
|
+
"โ",
|
|
154
|
+
"๐ข",
|
|
155
|
+
"๐ ",
|
|
156
|
+
"๐ก",
|
|
157
|
+
"๐ฃ",
|
|
158
|
+
"๐",
|
|
159
|
+
"๐",
|
|
160
|
+
"๐",
|
|
161
|
+
"๐",
|
|
162
|
+
"โ",
|
|
163
|
+
"โข",
|
|
164
|
+
"โฌ",
|
|
165
|
+
"โญ",
|
|
166
|
+
"๐",
|
|
167
|
+
"๐",
|
|
168
|
+
"๐",
|
|
169
|
+
"๐",
|
|
170
|
+
"๐ฟ",
|
|
171
|
+
"โช",
|
|
172
|
+
"๐",
|
|
173
|
+
"๐",
|
|
174
|
+
"๐
",
|
|
175
|
+
"โ
",
|
|
176
|
+
"๐",
|
|
177
|
+
"๐",
|
|
178
|
+
"๐",
|
|
179
|
+
"๐",
|
|
180
|
+
"โฏ",
|
|
181
|
+
"โ",
|
|
182
|
+
"โฏ",
|
|
183
|
+
"โฏ",
|
|
184
|
+
"โฏ",
|
|
185
|
+
"โช",
|
|
186
|
+
"โฐ",
|
|
187
|
+
"๐",
|
|
188
|
+
"๐",
|
|
189
|
+
"๐",
|
|
190
|
+
"๐",
|
|
191
|
+
"๐",
|
|
192
|
+
"๐",
|
|
193
|
+
"๐",
|
|
194
|
+
"๐",
|
|
195
|
+
"๐",
|
|
196
|
+
"๐",
|
|
197
|
+
"๐",
|
|
198
|
+
"๐",
|
|
199
|
+
"โฎฐ",
|
|
200
|
+
"โฎฑ",
|
|
201
|
+
"โฎฒ",
|
|
202
|
+
"โฎณ",
|
|
203
|
+
"โฎด",
|
|
204
|
+
"โฎต",
|
|
205
|
+
"โฎถ",
|
|
206
|
+
"โฎท",
|
|
207
|
+
"๐ช",
|
|
208
|
+
"๐ซ",
|
|
209
|
+
"๐",
|
|
210
|
+
"๐",
|
|
211
|
+
"๐",
|
|
212
|
+
"๐",
|
|
213
|
+
"๐",
|
|
214
|
+
"๐",
|
|
215
|
+
"๐",
|
|
216
|
+
"๐",
|
|
217
|
+
"โซ",
|
|
218
|
+
"โฆ",
|
|
219
|
+
"โฎ",
|
|
220
|
+
"โฎ",
|
|
221
|
+
"โฎ",
|
|
222
|
+
"โฎ",
|
|
223
|
+
"โฎ",
|
|
224
|
+
"โฎ",
|
|
225
|
+
"โฎ",
|
|
226
|
+
"โฎ",
|
|
227
|
+
"๐กจ",
|
|
228
|
+
"๐กช",
|
|
229
|
+
"๐กฉ",
|
|
230
|
+
"๐กซ",
|
|
231
|
+
"๐กฌ",
|
|
232
|
+
"๐กญ",
|
|
233
|
+
"๐กฏ",
|
|
234
|
+
"๐กฎ",
|
|
235
|
+
"๐กธ",
|
|
236
|
+
"๐กบ",
|
|
237
|
+
"๐กน",
|
|
238
|
+
"๐กป",
|
|
239
|
+
"๐กผ",
|
|
240
|
+
"๐กฝ",
|
|
241
|
+
"๐กฟ",
|
|
242
|
+
"๐กพ",
|
|
243
|
+
"โฆ",
|
|
244
|
+
"โจ",
|
|
245
|
+
"โง",
|
|
246
|
+
"โฉ",
|
|
247
|
+
"โฌ",
|
|
248
|
+
"โณ",
|
|
249
|
+
"โฌ",
|
|
250
|
+
"โฌ",
|
|
251
|
+
"โฌ",
|
|
252
|
+
"โฌ",
|
|
253
|
+
"๐ขฌ",
|
|
254
|
+
"๐ขญ",
|
|
255
|
+
"๐ถ",
|
|
256
|
+
"โ",
|
|
257
|
+
"๐ท",
|
|
258
|
+
"๐น",
|
|
259
|
+
""
|
|
260
|
+
];
|
|
261
|
+
//#endregion
|
|
262
|
+
exports.WINGDINGS_CHARACTERS = WINGDINGS_CHARACTERS;
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
//#region src/wingdings-characters.ts
|
|
2
|
+
const WINGDINGS_CHARACTERS = [
|
|
3
|
+
"",
|
|
4
|
+
"",
|
|
5
|
+
"",
|
|
6
|
+
"",
|
|
7
|
+
"",
|
|
8
|
+
"",
|
|
9
|
+
"",
|
|
10
|
+
"",
|
|
11
|
+
"",
|
|
12
|
+
"",
|
|
13
|
+
"",
|
|
14
|
+
"",
|
|
15
|
+
"",
|
|
16
|
+
"",
|
|
17
|
+
"",
|
|
18
|
+
"",
|
|
19
|
+
"",
|
|
20
|
+
"",
|
|
21
|
+
"",
|
|
22
|
+
"",
|
|
23
|
+
"",
|
|
24
|
+
"",
|
|
25
|
+
"",
|
|
26
|
+
"",
|
|
27
|
+
"",
|
|
28
|
+
"",
|
|
29
|
+
"",
|
|
30
|
+
"",
|
|
31
|
+
"",
|
|
32
|
+
"",
|
|
33
|
+
"",
|
|
34
|
+
"",
|
|
35
|
+
" ",
|
|
36
|
+
"๐",
|
|
37
|
+
"โ",
|
|
38
|
+
"โ",
|
|
39
|
+
"๐",
|
|
40
|
+
"๐ญ",
|
|
41
|
+
"๐ฎ",
|
|
42
|
+
"๐ฏ",
|
|
43
|
+
"๐ฟ",
|
|
44
|
+
"โ",
|
|
45
|
+
"๐",
|
|
46
|
+
"๐",
|
|
47
|
+
"๐ช",
|
|
48
|
+
"๐ซ",
|
|
49
|
+
"๐ฌ",
|
|
50
|
+
"๐ญ",
|
|
51
|
+
"๐",
|
|
52
|
+
"๐",
|
|
53
|
+
"๐",
|
|
54
|
+
"๐",
|
|
55
|
+
"๐",
|
|
56
|
+
"๐",
|
|
57
|
+
"โณ",
|
|
58
|
+
"๐ฎ",
|
|
59
|
+
"๐ฐ",
|
|
60
|
+
"๐ฒ",
|
|
61
|
+
"๐ณ",
|
|
62
|
+
"๐ด",
|
|
63
|
+
"๐ซ",
|
|
64
|
+
"๐ฌ",
|
|
65
|
+
"โ",
|
|
66
|
+
"โ",
|
|
67
|
+
"๐",
|
|
68
|
+
"โ",
|
|
69
|
+
"๐",
|
|
70
|
+
"๐",
|
|
71
|
+
"๐",
|
|
72
|
+
"โ",
|
|
73
|
+
"โ",
|
|
74
|
+
"โ",
|
|
75
|
+
"๐",
|
|
76
|
+
"๐",
|
|
77
|
+
"โบ",
|
|
78
|
+
"๐",
|
|
79
|
+
"โน",
|
|
80
|
+
"๐ฃ",
|
|
81
|
+
"๐ฑ",
|
|
82
|
+
"๐ณ",
|
|
83
|
+
"๐ฑ",
|
|
84
|
+
"โ",
|
|
85
|
+
"โผ",
|
|
86
|
+
"๐ข",
|
|
87
|
+
"โ",
|
|
88
|
+
"๐",
|
|
89
|
+
"โ",
|
|
90
|
+
"๐",
|
|
91
|
+
"โ ",
|
|
92
|
+
"โก",
|
|
93
|
+
"โช",
|
|
94
|
+
"โฏ",
|
|
95
|
+
"๐",
|
|
96
|
+
"โธ",
|
|
97
|
+
"โ",
|
|
98
|
+
"โ",
|
|
99
|
+
"โ",
|
|
100
|
+
"โ",
|
|
101
|
+
"โ",
|
|
102
|
+
"โ",
|
|
103
|
+
"โ",
|
|
104
|
+
"โ",
|
|
105
|
+
"โ",
|
|
106
|
+
"โ",
|
|
107
|
+
"โ",
|
|
108
|
+
"โ",
|
|
109
|
+
"๐ฐ",
|
|
110
|
+
"๐ต",
|
|
111
|
+
"โซ",
|
|
112
|
+
"๐พ",
|
|
113
|
+
"โผ",
|
|
114
|
+
"๐",
|
|
115
|
+
"๐",
|
|
116
|
+
"โ",
|
|
117
|
+
"โ",
|
|
118
|
+
"๐",
|
|
119
|
+
"โงซ",
|
|
120
|
+
"โ",
|
|
121
|
+
"โ",
|
|
122
|
+
"๐",
|
|
123
|
+
"โง",
|
|
124
|
+
"โฎน",
|
|
125
|
+
"โ",
|
|
126
|
+
"๐ต",
|
|
127
|
+
"๐ถ",
|
|
128
|
+
"๐ถ",
|
|
129
|
+
"๐ท",
|
|
130
|
+
"",
|
|
131
|
+
"๐",
|
|
132
|
+
"โ",
|
|
133
|
+
"โ",
|
|
134
|
+
"โ",
|
|
135
|
+
"โ",
|
|
136
|
+
"โ",
|
|
137
|
+
"โ
",
|
|
138
|
+
"โ",
|
|
139
|
+
"โ",
|
|
140
|
+
"โ",
|
|
141
|
+
"โ",
|
|
142
|
+
"๐",
|
|
143
|
+
"โ",
|
|
144
|
+
"โ",
|
|
145
|
+
"โ",
|
|
146
|
+
"โ",
|
|
147
|
+
"โ",
|
|
148
|
+
"โ",
|
|
149
|
+
"โ",
|
|
150
|
+
"โ",
|
|
151
|
+
"โ",
|
|
152
|
+
"โ",
|
|
153
|
+
"๐ข",
|
|
154
|
+
"๐ ",
|
|
155
|
+
"๐ก",
|
|
156
|
+
"๐ฃ",
|
|
157
|
+
"๐",
|
|
158
|
+
"๐",
|
|
159
|
+
"๐",
|
|
160
|
+
"๐",
|
|
161
|
+
"โ",
|
|
162
|
+
"โข",
|
|
163
|
+
"โฌ",
|
|
164
|
+
"โญ",
|
|
165
|
+
"๐",
|
|
166
|
+
"๐",
|
|
167
|
+
"๐",
|
|
168
|
+
"๐",
|
|
169
|
+
"๐ฟ",
|
|
170
|
+
"โช",
|
|
171
|
+
"๐",
|
|
172
|
+
"๐",
|
|
173
|
+
"๐
",
|
|
174
|
+
"โ
",
|
|
175
|
+
"๐",
|
|
176
|
+
"๐",
|
|
177
|
+
"๐",
|
|
178
|
+
"๐",
|
|
179
|
+
"โฏ",
|
|
180
|
+
"โ",
|
|
181
|
+
"โฏ",
|
|
182
|
+
"โฏ",
|
|
183
|
+
"โฏ",
|
|
184
|
+
"โช",
|
|
185
|
+
"โฐ",
|
|
186
|
+
"๐",
|
|
187
|
+
"๐",
|
|
188
|
+
"๐",
|
|
189
|
+
"๐",
|
|
190
|
+
"๐",
|
|
191
|
+
"๐",
|
|
192
|
+
"๐",
|
|
193
|
+
"๐",
|
|
194
|
+
"๐",
|
|
195
|
+
"๐",
|
|
196
|
+
"๐",
|
|
197
|
+
"๐",
|
|
198
|
+
"โฎฐ",
|
|
199
|
+
"โฎฑ",
|
|
200
|
+
"โฎฒ",
|
|
201
|
+
"โฎณ",
|
|
202
|
+
"โฎด",
|
|
203
|
+
"โฎต",
|
|
204
|
+
"โฎถ",
|
|
205
|
+
"โฎท",
|
|
206
|
+
"๐ช",
|
|
207
|
+
"๐ซ",
|
|
208
|
+
"๐",
|
|
209
|
+
"๐",
|
|
210
|
+
"๐",
|
|
211
|
+
"๐",
|
|
212
|
+
"๐",
|
|
213
|
+
"๐",
|
|
214
|
+
"๐",
|
|
215
|
+
"๐",
|
|
216
|
+
"โซ",
|
|
217
|
+
"โฆ",
|
|
218
|
+
"โฎ",
|
|
219
|
+
"โฎ",
|
|
220
|
+
"โฎ",
|
|
221
|
+
"โฎ",
|
|
222
|
+
"โฎ",
|
|
223
|
+
"โฎ",
|
|
224
|
+
"โฎ",
|
|
225
|
+
"โฎ",
|
|
226
|
+
"๐กจ",
|
|
227
|
+
"๐กช",
|
|
228
|
+
"๐กฉ",
|
|
229
|
+
"๐กซ",
|
|
230
|
+
"๐กฌ",
|
|
231
|
+
"๐กญ",
|
|
232
|
+
"๐กฏ",
|
|
233
|
+
"๐กฎ",
|
|
234
|
+
"๐กธ",
|
|
235
|
+
"๐กบ",
|
|
236
|
+
"๐กน",
|
|
237
|
+
"๐กป",
|
|
238
|
+
"๐กผ",
|
|
239
|
+
"๐กฝ",
|
|
240
|
+
"๐กฟ",
|
|
241
|
+
"๐กพ",
|
|
242
|
+
"โฆ",
|
|
243
|
+
"โจ",
|
|
244
|
+
"โง",
|
|
245
|
+
"โฉ",
|
|
246
|
+
"โฌ",
|
|
247
|
+
"โณ",
|
|
248
|
+
"โฌ",
|
|
249
|
+
"โฌ",
|
|
250
|
+
"โฌ",
|
|
251
|
+
"โฌ",
|
|
252
|
+
"๐ขฌ",
|
|
253
|
+
"๐ขญ",
|
|
254
|
+
"๐ถ",
|
|
255
|
+
"โ",
|
|
256
|
+
"๐ท",
|
|
257
|
+
"๐น",
|
|
258
|
+
""
|
|
259
|
+
];
|
|
260
|
+
//#endregion
|
|
261
|
+
export { WINGDINGS_CHARACTERS };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pdf-codec",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.1",
|
|
4
4
|
"description": "Hand-written, dependency-minimal PDF codec: parses arbitrary real-world PDFs and generates new ones, built on its own codec-owned LayoutDocument item model and Zod 4 codecs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|