ooxml-core 1.33.0 → 1.35.0
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/dist/PptxHandler-5UDSMCBG.cjs +14 -0
- package/dist/PptxHandler-TTRTAQAR.mjs +5 -0
- package/dist/{PptxHandler-Q7CFNKOU.mjs → PptxHandler-XCYX5DVX.mjs} +2 -2
- package/dist/{PresentationBuilder-VP2637RH.cjs → PresentationBuilder-HA56ZY23.cjs} +6 -5
- package/dist/{PresentationBuilder-SADKXDWC.mjs → PresentationBuilder-IVLUEB4K.mjs} +2 -2
- package/dist/{PresentationBuilder-PJMQRZI6.mjs → PresentationBuilder-JBTNOIL7.mjs} +3 -2
- package/dist/automation/index.cjs +47556 -43468
- package/dist/automation/index.mjs +47556 -43468
- package/dist/{chunk-2LTIDUXH.cjs → chunk-A27O7M5X.cjs} +147 -133
- package/dist/{chunk-Y2RH4QWG.mjs → chunk-EGBNPVBA.mjs} +1542 -721
- package/dist/{chunk-QRXMYOVN.mjs → chunk-GNGL4BO7.mjs} +66 -44
- package/dist/chunk-LSO5SSFX.mjs +112 -0
- package/dist/chunk-MB3TYNMV.mjs +28 -0
- package/dist/{chunk-EBBWRRSB.mjs → chunk-MK2IBZU6.mjs} +1 -1
- package/dist/{chunk-BDZR4DZ6.cjs → chunk-PA5ADSTX.cjs} +1329 -1306
- package/dist/{chunk-BQGLWC6N.mjs → chunk-RI56PFGL.mjs} +67 -44
- package/dist/{chunk-3LMHYL4W.mjs → chunk-RPJHMPEL.mjs} +1 -1
- package/dist/{chunk-JQVOUS6B.mjs → chunk-TJXK4D4U.mjs} +4 -4
- package/dist/{chunk-6LJW76BZ.mjs → chunk-UQMAPY6D.mjs} +147 -128
- package/dist/chunk-XF6ZRA2D.cjs +120 -0
- package/dist/crypto/index.cjs +23 -15
- package/dist/crypto/index.mjs +23 -15
- package/dist/docx/block-parser.d.ts.map +1 -1
- package/dist/docx/embedded.cjs +519 -161
- package/dist/docx/embedded.mjs +519 -161
- package/dist/docx/find-pattern.d.ts +33 -0
- package/dist/docx/find-pattern.d.ts.map +1 -0
- package/dist/docx/find-replacement.d.ts +16 -0
- package/dist/docx/find-replacement.d.ts.map +1 -0
- package/dist/docx/find-syntax.d.ts +13 -0
- package/dist/docx/find-syntax.d.ts.map +1 -0
- package/dist/docx/find-wildcards.d.ts +8 -0
- package/dist/docx/find-wildcards.d.ts.map +1 -0
- package/dist/docx/form-field-model.d.ts +39 -0
- package/dist/docx/form-field-model.d.ts.map +1 -1
- package/dist/docx/index.cjs +3157 -994
- package/dist/docx/index.d.ts +3 -1
- package/dist/docx/index.d.ts.map +1 -1
- package/dist/docx/index.mjs +3153 -995
- package/dist/docx/layout/adapter.d.ts.map +1 -1
- package/dist/docx/layout/index.cjs +30 -8
- package/dist/docx/layout/index.mjs +30 -8
- package/dist/docx/layout/input.d.ts +2 -0
- package/dist/docx/layout/input.d.ts.map +1 -1
- package/dist/docx/load/index.cjs +6706 -1322
- package/dist/docx/load/index.mjs +6706 -1322
- package/dist/docx/load/legacy-doc/binary-save.d.ts +4 -0
- package/dist/docx/load/legacy-doc/binary-save.d.ts.map +1 -0
- package/dist/docx/load/legacy-doc/blocks.d.ts +19 -0
- package/dist/docx/load/legacy-doc/blocks.d.ts.map +1 -0
- package/dist/docx/load/legacy-doc/borders.d.ts +7 -0
- package/dist/docx/load/legacy-doc/borders.d.ts.map +1 -0
- package/dist/docx/load/legacy-doc/context.d.ts +65 -0
- package/dist/docx/load/legacy-doc/context.d.ts.map +1 -0
- package/dist/docx/load/legacy-doc/drawing.d.ts +15 -0
- package/dist/docx/load/legacy-doc/drawing.d.ts.map +1 -0
- package/dist/docx/load/legacy-doc/error.d.ts +5 -0
- package/dist/docx/load/legacy-doc/error.d.ts.map +1 -0
- package/dist/docx/load/legacy-doc/inline.d.ts +7 -0
- package/dist/docx/load/legacy-doc/inline.d.ts.map +1 -0
- package/dist/docx/load/legacy-doc/numbering-part.d.ts +3 -0
- package/dist/docx/load/legacy-doc/numbering-part.d.ts.map +1 -0
- package/dist/docx/load/legacy-doc/package.d.ts +8 -0
- package/dist/docx/load/legacy-doc/package.d.ts.map +1 -0
- package/dist/docx/load/legacy-doc/para-props.d.ts +6 -0
- package/dist/docx/load/legacy-doc/para-props.d.ts.map +1 -0
- package/dist/docx/load/legacy-doc/run-props.d.ts +8 -0
- package/dist/docx/load/legacy-doc/run-props.d.ts.map +1 -0
- package/dist/docx/load/legacy-doc/sections.d.ts +23 -0
- package/dist/docx/load/legacy-doc/sections.d.ts.map +1 -0
- package/dist/docx/load/legacy-doc/styles-part.d.ts +3 -0
- package/dist/docx/load/legacy-doc/styles-part.d.ts.map +1 -0
- package/dist/docx/load/legacy-doc/table.d.ts +6 -0
- package/dist/docx/load/legacy-doc/table.d.ts.map +1 -0
- package/dist/docx/load/legacy-doc/xml.d.ts +21 -0
- package/dist/docx/load/legacy-doc/xml.d.ts.map +1 -0
- package/dist/docx/load/legacy-doc.d.ts +5 -4
- package/dist/docx/load/legacy-doc.d.ts.map +1 -1
- package/dist/docx/model-paragraph.d.ts +5 -0
- package/dist/docx/model-paragraph.d.ts.map +1 -1
- package/dist/docx/model.d.ts +3 -0
- package/dist/docx/model.d.ts.map +1 -1
- package/dist/docx/numbering-editing.d.ts +11 -1
- package/dist/docx/numbering-editing.d.ts.map +1 -1
- package/dist/docx/numbering-format.d.ts.map +1 -1
- package/dist/docx/numbering-model.d.ts +17 -0
- package/dist/docx/numbering-model.d.ts.map +1 -1
- package/dist/docx/numbering-package.d.ts +2 -2
- package/dist/docx/numbering-package.d.ts.map +1 -1
- package/dist/docx/numbering-parse.d.ts +2 -1
- package/dist/docx/numbering-parse.d.ts.map +1 -1
- package/dist/docx/numbering-picture-save.d.ts +13 -0
- package/dist/docx/numbering-picture-save.d.ts.map +1 -0
- package/dist/docx/numbering-picture.d.ts +18 -0
- package/dist/docx/numbering-picture.d.ts.map +1 -0
- package/dist/docx/parse.d.ts.map +1 -1
- package/dist/docx/permission-markers.d.ts +19 -0
- package/dist/docx/permission-markers.d.ts.map +1 -0
- package/dist/docx/permissions.d.ts +11 -0
- package/dist/docx/permissions.d.ts.map +1 -0
- package/dist/docx/protection-legacy.d.ts +13 -0
- package/dist/docx/protection-legacy.d.ts.map +1 -0
- package/dist/docx/protection.d.ts +30 -0
- package/dist/docx/protection.d.ts.map +1 -0
- package/dist/docx/save.d.ts.map +1 -1
- package/dist/docx/settings.d.ts +6 -1
- package/dist/docx/settings.d.ts.map +1 -1
- package/dist/docx/ui/customization.d.ts.map +1 -1
- package/dist/docx/ui/edit-restriction.d.ts +53 -0
- package/dist/docx/ui/edit-restriction.d.ts.map +1 -0
- package/dist/docx/ui/index.cjs +548 -18
- package/dist/docx/ui/index.d.ts +4 -0
- package/dist/docx/ui/index.d.ts.map +1 -1
- package/dist/docx/ui/index.mjs +528 -19
- package/dist/docx/ui/paragraph-attributes.d.ts.map +1 -1
- package/dist/docx/ui/ribbon-action-ids.d.ts +1 -1
- package/dist/docx/ui/ribbon-action-ids.d.ts.map +1 -1
- package/dist/docx/write-paragraph.d.ts.map +1 -1
- package/dist/drawingml/index.cjs +1 -0
- package/dist/drawingml/index.mjs +1 -0
- package/dist/drawingml/write-theme.d.ts +2 -0
- package/dist/drawingml/write-theme.d.ts.map +1 -1
- package/dist/index.cjs +342 -96
- package/dist/index.mjs +343 -97
- package/dist/opc/index.cjs +5 -0
- package/dist/opc/index.d.ts +1 -0
- package/dist/opc/index.d.ts.map +1 -1
- package/dist/opc/index.mjs +5 -1
- package/dist/opc/zlib.d.ts +6 -0
- package/dist/opc/zlib.d.ts.map +1 -0
- package/dist/pptx/automation/index.cjs +1919 -758
- package/dist/pptx/automation/index.d.ts +37 -3
- package/dist/pptx/automation/index.d.ts.map +1 -1
- package/dist/pptx/automation/index.mjs +252 -10
- package/dist/pptx/automation/schemas/index.cjs +26 -0
- package/dist/pptx/automation/schemas/index.d.ts +26 -1
- package/dist/pptx/automation/schemas/index.d.ts.map +1 -0
- package/dist/pptx/automation/schemas/index.mjs +1 -1
- package/dist/pptx/chunks/index-Bp-1pGo1.d.ts.map +1 -1
- package/dist/pptx/chunks/{index-BuMPQDQb.d.ts → index-pLLN4OTz.d.ts} +37 -10
- package/dist/pptx/chunks/{index-BuMPQDQb.d.ts.map → index-pLLN4OTz.d.ts.map} +1 -1
- package/dist/pptx/cli/index.cjs +281 -116
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/custom-show-operations.cjs +133 -0
- package/dist/pptx/editor/render/custom-show-operations.d.ts +42 -0
- package/dist/pptx/editor/render/custom-show-operations.d.ts.map +1 -0
- package/dist/pptx/editor/render/custom-show-operations.mjs +119 -0
- package/dist/pptx/editor/render/find-replace.cjs +15 -14
- package/dist/pptx/editor/render/find-replace.d.ts +1 -1
- package/dist/pptx/editor/render/find-replace.mjs +2 -1
- package/dist/pptx/editor/render/slide-operations.cjs +9 -8
- package/dist/pptx/editor/render/slide-operations.mjs +3 -2
- package/dist/pptx/editor/render/table-data-grid-ops.cjs +1 -1
- package/dist/pptx/editor/render/table-data-grid-ops.mjs +1 -1
- package/dist/pptx/index.cjs +1656 -761
- package/dist/pptx/index.d.ts +2 -2
- package/dist/pptx/index.mjs +5 -5
- package/dist/teams/index.cjs +213 -26
- package/dist/teams/index.mjs +213 -26
- package/dist/text/index.cjs +241 -0
- package/dist/text/index.d.ts +2 -0
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.mjs +240 -1
- package/dist/text/truetype/parse.d.ts +36 -0
- package/dist/text/truetype/parse.d.ts.map +1 -0
- package/dist/text/truetype/subset.d.ts +16 -0
- package/dist/text/truetype/subset.d.ts.map +1 -0
- package/dist/visio/action-formula.d.ts +21 -0
- package/dist/visio/action-formula.d.ts.map +1 -0
- package/dist/visio/action-menu.d.ts +8 -0
- package/dist/visio/action-menu.d.ts.map +1 -0
- package/dist/visio/bevel-3d.d.ts +61 -0
- package/dist/visio/bevel-3d.d.ts.map +1 -0
- package/dist/visio/cell-formula.d.ts.map +1 -1
- package/dist/visio/cff-masters.d.ts +17 -0
- package/dist/visio/cff-masters.d.ts.map +1 -0
- package/dist/visio/cff-recalc.d.ts +17 -0
- package/dist/visio/cff-recalc.d.ts.map +1 -0
- package/dist/visio/container-relationships.d.ts +40 -6
- package/dist/visio/container-relationships.d.ts.map +1 -1
- package/dist/visio/control-formula.d.ts +13 -0
- package/dist/visio/control-formula.d.ts.map +1 -0
- package/dist/visio/data-connections.d.ts +32 -0
- package/dist/visio/data-connections.d.ts.map +1 -0
- package/dist/visio/data-recordsets.d.ts +7 -0
- package/dist/visio/data-recordsets.d.ts.map +1 -1
- package/dist/visio/data-refresh.d.ts +33 -0
- package/dist/visio/data-refresh.d.ts.map +1 -0
- package/dist/visio/edit-action.d.ts +22 -0
- package/dist/visio/edit-action.d.ts.map +1 -0
- package/dist/visio/edit-commands.d.ts +9 -1
- package/dist/visio/edit-commands.d.ts.map +1 -1
- package/dist/visio/edit-connector-glue.d.ts +24 -1
- package/dist/visio/edit-connector-glue.d.ts.map +1 -1
- package/dist/visio/edit-connector-layout.d.ts.map +1 -1
- package/dist/visio/edit-connector-org.d.ts +11 -0
- package/dist/visio/edit-connector-org.d.ts.map +1 -0
- package/dist/visio/edit-connector-reroute.d.ts.map +1 -1
- package/dist/visio/edit-connector-world.d.ts +25 -0
- package/dist/visio/edit-connector-world.d.ts.map +1 -0
- package/dist/visio/edit-connector.d.ts +5 -1
- package/dist/visio/edit-connector.d.ts.map +1 -1
- package/dist/visio/edit-container-fit.d.ts +15 -2
- package/dist/visio/edit-container-fit.d.ts.map +1 -1
- package/dist/visio/edit-container-members.d.ts +12 -0
- package/dist/visio/edit-container-members.d.ts.map +1 -1
- package/dist/visio/edit-container-options.d.ts +33 -0
- package/dist/visio/edit-container-options.d.ts.map +1 -0
- package/dist/visio/edit-control.d.ts +28 -0
- package/dist/visio/edit-control.d.ts.map +1 -0
- package/dist/visio/edit-data-commands.d.ts +5 -0
- package/dist/visio/edit-data-commands.d.ts.map +1 -1
- package/dist/visio/edit-data-parts.d.ts +2 -0
- package/dist/visio/edit-data-parts.d.ts.map +1 -1
- package/dist/visio/edit-data.d.ts.map +1 -1
- package/dist/visio/edit-diagram-parts-commands.d.ts +2 -1
- package/dist/visio/edit-diagram-parts-commands.d.ts.map +1 -1
- package/dist/visio/edit-diagram-parts.d.ts +8 -0
- package/dist/visio/edit-diagram-parts.d.ts.map +1 -1
- package/dist/visio/edit-formatting-commands.d.ts +4 -0
- package/dist/visio/edit-formatting-commands.d.ts.map +1 -1
- package/dist/visio/edit-formatting-paint.d.ts.map +1 -1
- package/dist/visio/edit-geometry.d.ts.map +1 -1
- package/dist/visio/edit-group-resize-instances.d.ts +43 -0
- package/dist/visio/edit-group-resize-instances.d.ts.map +1 -0
- package/dist/visio/edit-group-resize.d.ts +1 -0
- package/dist/visio/edit-group-resize.d.ts.map +1 -1
- package/dist/visio/edit-group-rotation.d.ts +8 -0
- package/dist/visio/edit-group-rotation.d.ts.map +1 -1
- package/dist/visio/edit-instance-checks.d.ts.map +1 -1
- package/dist/visio/edit-instance-geometry.d.ts +13 -0
- package/dist/visio/edit-instance-geometry.d.ts.map +1 -1
- package/dist/visio/edit-instance-sheet.d.ts.map +1 -1
- package/dist/visio/edit-master-add.d.ts +3 -0
- package/dist/visio/edit-master-add.d.ts.map +1 -1
- package/dist/visio/edit-master-drop.d.ts.map +1 -1
- package/dist/visio/edit-master-media.d.ts +22 -0
- package/dist/visio/edit-master-media.d.ts.map +1 -0
- package/dist/visio/edit-master-scope.d.ts.map +1 -1
- package/dist/visio/edit-package.d.ts.map +1 -1
- package/dist/visio/edit-page-theme-commands.d.ts +26 -0
- package/dist/visio/edit-page-theme-commands.d.ts.map +1 -1
- package/dist/visio/edit-page-theme-part.d.ts +6 -0
- package/dist/visio/edit-page-theme-part.d.ts.map +1 -0
- package/dist/visio/edit-page-theme.d.ts +9 -1
- package/dist/visio/edit-page-theme.d.ts.map +1 -1
- package/dist/visio/edit-picture-adjust.d.ts +32 -0
- package/dist/visio/edit-picture-adjust.d.ts.map +1 -0
- package/dist/visio/edit-resize-anchor.d.ts.map +1 -1
- package/dist/visio/edit-sheet-cells.d.ts +23 -0
- package/dist/visio/edit-sheet-cells.d.ts.map +1 -0
- package/dist/visio/edit-stencil-connector-write.d.ts.map +1 -1
- package/dist/visio/edit-stencil-connector.d.ts +7 -2
- package/dist/visio/edit-stencil-connector.d.ts.map +1 -1
- package/dist/visio/edit-stencil-import.d.ts +1 -1
- package/dist/visio/edit-stencil-import.d.ts.map +1 -1
- package/dist/visio/edit-style-admission.d.ts +6 -0
- package/dist/visio/edit-style-admission.d.ts.map +1 -1
- package/dist/visio/edit-swimlane-clone.d.ts +7 -0
- package/dist/visio/edit-swimlane-clone.d.ts.map +1 -0
- package/dist/visio/edit-swimlane-commands.d.ts +91 -0
- package/dist/visio/edit-swimlane-commands.d.ts.map +1 -0
- package/dist/visio/edit-swimlane-layout.d.ts +71 -0
- package/dist/visio/edit-swimlane-layout.d.ts.map +1 -0
- package/dist/visio/edit-swimlane-ops.d.ts +12 -0
- package/dist/visio/edit-swimlane-ops.d.ts.map +1 -0
- package/dist/visio/edit-swimlane-shapes.d.ts +42 -0
- package/dist/visio/edit-swimlane-shapes.d.ts.map +1 -0
- package/dist/visio/edit-swimlane-turn.d.ts +9 -0
- package/dist/visio/edit-swimlane-turn.d.ts.map +1 -0
- package/dist/visio/edit.d.ts.map +1 -1
- package/dist/visio/effects.d.ts +3 -2
- package/dist/visio/effects.d.ts.map +1 -1
- package/dist/visio/geometry.d.ts +2 -1
- package/dist/visio/geometry.d.ts.map +1 -1
- package/dist/visio/index.cjs +12115 -7631
- package/dist/visio/index.d.ts +13 -0
- package/dist/visio/index.d.ts.map +1 -1
- package/dist/visio/index.mjs +12101 -7632
- package/dist/visio/infinite-line.d.ts +17 -0
- package/dist/visio/infinite-line.d.ts.map +1 -0
- package/dist/visio/model.d.ts +62 -0
- package/dist/visio/model.d.ts.map +1 -1
- package/dist/visio/package-kind.d.ts +34 -0
- package/dist/visio/package-kind.d.ts.map +1 -0
- package/dist/visio/page-theme.d.ts +7 -0
- package/dist/visio/page-theme.d.ts.map +1 -1
- package/dist/visio/paragraphs.d.ts +1 -1
- package/dist/visio/paragraphs.d.ts.map +1 -1
- package/dist/visio/parser.d.ts +2 -2
- package/dist/visio/parser.d.ts.map +1 -1
- package/dist/visio/shadow.d.ts +2 -1
- package/dist/visio/shadow.d.ts.map +1 -1
- package/dist/visio/shape-sections-types.d.ts +71 -0
- package/dist/visio/shape-sections-types.d.ts.map +1 -0
- package/dist/visio/shape-sections.d.ts +11 -0
- package/dist/visio/shape-sections.d.ts.map +1 -0
- package/dist/visio/shape-structure.d.ts +14 -1
- package/dist/visio/shape-structure.d.ts.map +1 -1
- package/dist/visio/shapes.d.ts +7 -1
- package/dist/visio/shapes.d.ts.map +1 -1
- package/dist/visio/stencil-file.d.ts +2 -2
- package/dist/visio/style.d.ts.map +1 -1
- package/dist/visio/swimlane-membership.d.ts +12 -0
- package/dist/visio/swimlane-membership.d.ts.map +1 -0
- package/dist/visio/swimlane-stack.d.ts +67 -0
- package/dist/visio/swimlane-stack.d.ts.map +1 -0
- package/dist/visio/tab-stops.d.ts +20 -0
- package/dist/visio/tab-stops.d.ts.map +1 -0
- package/dist/visio/theme-builtins.d.ts +3 -0
- package/dist/visio/theme-builtins.d.ts.map +1 -1
- package/dist/visio/theme-effects.d.ts +19 -0
- package/dist/visio/theme-effects.d.ts.map +1 -0
- package/dist/visio/theme-font.d.ts +13 -0
- package/dist/visio/theme-font.d.ts.map +1 -0
- package/dist/visio/theme-line.d.ts +10 -0
- package/dist/visio/theme-line.d.ts.map +1 -1
- package/dist/visio/theme-write.d.ts.map +1 -1
- package/dist/visio/theme.d.ts +7 -0
- package/dist/visio/theme.d.ts.map +1 -1
- package/dist/visio/ui/data-graphic-config.d.ts +46 -0
- package/dist/visio/ui/data-graphic-config.d.ts.map +1 -0
- package/dist/visio/ui/data-graphic-items.d.ts +23 -0
- package/dist/visio/ui/data-graphic-items.d.ts.map +1 -0
- package/dist/visio/ui/data-graphic-rules.d.ts +14 -0
- package/dist/visio/ui/data-graphic-rules.d.ts.map +1 -1
- package/dist/visio/ui/data-graphics.d.ts +10 -1
- package/dist/visio/ui/data-graphics.d.ts.map +1 -1
- package/dist/visio/ui/data-visualizer-edits.d.ts +22 -0
- package/dist/visio/ui/data-visualizer-edits.d.ts.map +1 -0
- package/dist/visio/ui/data-visualizer.d.ts +47 -0
- package/dist/visio/ui/data-visualizer.d.ts.map +1 -0
- package/dist/visio/ui/diagram-parts.d.ts +8 -1
- package/dist/visio/ui/diagram-parts.d.ts.map +1 -1
- package/dist/visio/ui/edit-commands.d.ts.map +1 -1
- package/dist/visio/ui/guides.d.ts +9 -1
- package/dist/visio/ui/guides.d.ts.map +1 -1
- package/dist/visio/ui/index.cjs +44031 -38653
- package/dist/visio/ui/index.d.ts +10 -0
- package/dist/visio/ui/index.d.ts.map +1 -1
- package/dist/visio/ui/index.mjs +43976 -38654
- package/dist/visio/ui/org-chart-edit.d.ts +52 -0
- package/dist/visio/ui/org-chart-edit.d.ts.map +1 -0
- package/dist/visio/ui/org-chart-import.d.ts +35 -0
- package/dist/visio/ui/org-chart-import.d.ts.map +1 -0
- package/dist/visio/ui/org-chart-layout.d.ts +43 -0
- package/dist/visio/ui/org-chart-layout.d.ts.map +1 -0
- package/dist/visio/ui/org-chart-stencil-data.d.ts +11 -0
- package/dist/visio/ui/org-chart-stencil-data.d.ts.map +1 -0
- package/dist/visio/ui/org-chart-template.d.ts +7 -0
- package/dist/visio/ui/org-chart-template.d.ts.map +1 -0
- package/dist/visio/ui/org-chart.d.ts +63 -0
- package/dist/visio/ui/org-chart.d.ts.map +1 -0
- package/dist/visio/ui/resize-snap.d.ts +51 -0
- package/dist/visio/ui/resize-snap.d.ts.map +1 -0
- package/dist/visio/ui/sample-drawing.d.ts +26 -0
- package/dist/visio/ui/sample-drawing.d.ts.map +1 -1
- package/dist/visio/ui/scene-validation.d.ts.map +1 -1
- package/dist/visio/ui/selection-connectors.d.ts +10 -0
- package/dist/visio/ui/selection-connectors.d.ts.map +1 -0
- package/dist/visio/ui/selection-resize.d.ts +2 -2
- package/dist/visio/ui/selection-resize.d.ts.map +1 -1
- package/dist/visio/ui/shape-group.d.ts +3 -1
- package/dist/visio/ui/shape-group.d.ts.map +1 -1
- package/dist/visio/ui/shape-move.d.ts.map +1 -1
- package/dist/visio/ui/shape-resize.d.ts +29 -1
- package/dist/visio/ui/shape-resize.d.ts.map +1 -1
- package/dist/visio/ui/shape-rotation.d.ts +3 -1
- package/dist/visio/ui/shape-rotation.d.ts.map +1 -1
- package/dist/visio/ui/snapshot-scene.d.ts.map +1 -1
- package/dist/visio/ui/swimlane.d.ts +37 -0
- package/dist/visio/ui/swimlane.d.ts.map +1 -0
- package/dist/visio/ui/templates.d.ts +30 -0
- package/dist/visio/ui/templates.d.ts.map +1 -0
- package/dist/xlsx/audit/ast-text.d.ts +12 -0
- package/dist/xlsx/audit/ast-text.d.ts.map +1 -0
- package/dist/xlsx/audit/error-check.d.ts +23 -0
- package/dist/xlsx/audit/error-check.d.ts.map +1 -0
- package/dist/xlsx/audit/evaluate-steps.d.ts +48 -0
- package/dist/xlsx/audit/evaluate-steps.d.ts.map +1 -0
- package/dist/xlsx/audit/index.d.ts +6 -0
- package/dist/xlsx/audit/index.d.ts.map +1 -0
- package/dist/xlsx/audit/trace.d.ts +59 -0
- package/dist/xlsx/audit/trace.d.ts.map +1 -0
- package/dist/xlsx/audit/watch.d.ts +17 -0
- package/dist/xlsx/audit/watch.d.ts.map +1 -0
- package/dist/xlsx/edit/filter.d.ts +5 -2
- package/dist/xlsx/edit/filter.d.ts.map +1 -1
- package/dist/xlsx/edit/index.d.ts +4 -1
- package/dist/xlsx/edit/index.d.ts.map +1 -1
- package/dist/xlsx/edit/session.d.ts.map +1 -1
- package/dist/xlsx/edit/sort-choices.d.ts +23 -0
- package/dist/xlsx/edit/sort-choices.d.ts.map +1 -0
- package/dist/xlsx/edit/sort-keys.d.ts +49 -0
- package/dist/xlsx/edit/sort-keys.d.ts.map +1 -0
- package/dist/xlsx/edit/sort-reapply.d.ts +11 -0
- package/dist/xlsx/edit/sort-reapply.d.ts.map +1 -0
- package/dist/xlsx/edit/sort.d.ts +14 -12
- package/dist/xlsx/edit/sort.d.ts.map +1 -1
- package/dist/xlsx/edit/types.d.ts +7 -6
- package/dist/xlsx/edit/types.d.ts.map +1 -1
- package/dist/xlsx/edit/view.d.ts +9 -1
- package/dist/xlsx/edit/view.d.ts.map +1 -1
- package/dist/xlsx/filter-criteria.d.ts +2 -1
- package/dist/xlsx/filter-criteria.d.ts.map +1 -1
- package/dist/xlsx/formula/engine-types.d.ts +8 -0
- package/dist/xlsx/formula/engine-types.d.ts.map +1 -1
- package/dist/xlsx/formula/engine.d.ts.map +1 -1
- package/dist/xlsx/index.cjs +5478 -4220
- package/dist/xlsx/index.d.ts +1 -0
- package/dist/xlsx/index.d.ts.map +1 -1
- package/dist/xlsx/index.mjs +5450 -4221
- package/dist/xlsx/layout/index.d.ts +1 -0
- package/dist/xlsx/layout/index.d.ts.map +1 -1
- package/dist/xlsx/layout/split.d.ts +55 -0
- package/dist/xlsx/layout/split.d.ts.map +1 -0
- package/dist/xlsx/layout/viewport.d.ts +2 -0
- package/dist/xlsx/layout/viewport.d.ts.map +1 -1
- package/dist/xlsx/load/index.cjs +305 -109
- package/dist/xlsx/load/index.mjs +305 -109
- package/dist/xlsx/model-sort.d.ts +27 -0
- package/dist/xlsx/model-sort.d.ts.map +1 -0
- package/dist/xlsx/model.d.ts +39 -1
- package/dist/xlsx/model.d.ts.map +1 -1
- package/dist/xlsx/read/ignored-errors.d.ts +4 -0
- package/dist/xlsx/read/ignored-errors.d.ts.map +1 -0
- package/dist/xlsx/read/sheet-props.d.ts.map +1 -1
- package/dist/xlsx/read/sort-state.d.ts +5 -0
- package/dist/xlsx/read/sort-state.d.ts.map +1 -0
- package/dist/xlsx/read/tables.d.ts +2 -2
- package/dist/xlsx/read/tables.d.ts.map +1 -1
- package/dist/xlsx/read/worksheet.d.ts.map +1 -1
- package/dist/xlsx/sort-lists.d.ts +6 -0
- package/dist/xlsx/sort-lists.d.ts.map +1 -0
- package/dist/xlsx/ui/audit-state.d.ts +19 -0
- package/dist/xlsx/ui/audit-state.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/audit.d.ts +3 -0
- package/dist/xlsx/ui/commands/audit.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/formulas.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/audit.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/audit.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/index.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/ribbon-tabs.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/rules.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/icons.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/sort-filter.d.ts.map +1 -1
- package/dist/xlsx/ui/context.d.ts +6 -1
- package/dist/xlsx/ui/context.d.ts.map +1 -1
- package/dist/xlsx/ui/grid/geometry.d.ts +29 -1
- package/dist/xlsx/ui/grid/geometry.d.ts.map +1 -1
- package/dist/xlsx/ui/index.cjs +10761 -9573
- package/dist/xlsx/ui/index.d.ts +1 -0
- package/dist/xlsx/ui/index.d.ts.map +1 -1
- package/dist/xlsx/ui/index.mjs +10755 -9574
- package/dist/xlsx/ui/ribbon/icon-paths.d.ts.map +1 -1
- package/dist/xlsx/ui/ribbon/tabs/review-view.d.ts.map +1 -1
- package/dist/xlsx/write/filter-columns.d.ts +14 -0
- package/dist/xlsx/write/filter-columns.d.ts.map +1 -1
- package/dist/xlsx/write/ignored-errors.d.ts +3 -0
- package/dist/xlsx/write/ignored-errors.d.ts.map +1 -0
- package/dist/xlsx/write/sheet-parts.d.ts.map +1 -1
- package/dist/xlsx/write/sheet-props.d.ts.map +1 -1
- package/dist/xlsx/write/sort-state.d.ts +55 -0
- package/dist/xlsx/write/sort-state.d.ts.map +1 -0
- package/dist/xlsx/write/table-patch.d.ts +2 -1
- package/dist/xlsx/write/table-patch.d.ts.map +1 -1
- package/dist/xlsx/write/tables.d.ts +2 -1
- package/dist/xlsx/write/tables.d.ts.map +1 -1
- package/dist/xlsx/write/worksheet.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/PptxHandler-MGKMIK22.cjs +0 -13
- package/dist/PptxHandler-TEC7SWBU.mjs +0 -4
- package/dist/chunk-MHNETXQB.mjs +0 -1
package/dist/text/index.cjs
CHANGED
|
@@ -953,6 +953,245 @@ function segmentByFont(text, fonts) {
|
|
|
953
953
|
return result;
|
|
954
954
|
}
|
|
955
955
|
|
|
956
|
+
// text/truetype/parse.ts
|
|
957
|
+
var u16 = (v, o) => o + 2 <= v.byteLength ? v.getUint16(o) : 0;
|
|
958
|
+
var i16 = (v, o) => o + 2 <= v.byteLength ? v.getInt16(o) : 0;
|
|
959
|
+
var u32 = (v, o) => o + 4 <= v.byteLength ? v.getUint32(o) : 0;
|
|
960
|
+
var tag = (v, o) => String.fromCharCode(v.getUint8(o), v.getUint8(o + 1), v.getUint8(o + 2), v.getUint8(o + 3));
|
|
961
|
+
function format4(view, at) {
|
|
962
|
+
const segments = u16(view, at + 6) / 2;
|
|
963
|
+
const ends = at + 14;
|
|
964
|
+
const starts = ends + segments * 2 + 2;
|
|
965
|
+
const deltas = starts + segments * 2;
|
|
966
|
+
const offsets = deltas + segments * 2;
|
|
967
|
+
return (code) => {
|
|
968
|
+
if (code > 65535) return 0;
|
|
969
|
+
let lo = 0;
|
|
970
|
+
let hi = segments - 1;
|
|
971
|
+
while (lo <= hi) {
|
|
972
|
+
const mid = lo + hi >> 1;
|
|
973
|
+
if (code > u16(view, ends + mid * 2)) lo = mid + 1;
|
|
974
|
+
else if (code < u16(view, starts + mid * 2)) hi = mid - 1;
|
|
975
|
+
else {
|
|
976
|
+
const range = u16(view, offsets + mid * 2);
|
|
977
|
+
if (!range) return code + u16(view, deltas + mid * 2) & 65535;
|
|
978
|
+
const slot = offsets + mid * 2 + range + (code - u16(view, starts + mid * 2)) * 2;
|
|
979
|
+
const glyph = u16(view, slot);
|
|
980
|
+
return glyph ? glyph + u16(view, deltas + mid * 2) & 65535 : 0;
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
return 0;
|
|
984
|
+
};
|
|
985
|
+
}
|
|
986
|
+
function format12(view, at) {
|
|
987
|
+
const groups = u32(view, at + 12);
|
|
988
|
+
return (code) => {
|
|
989
|
+
let lo = 0;
|
|
990
|
+
let hi = groups - 1;
|
|
991
|
+
while (lo <= hi) {
|
|
992
|
+
const mid = lo + hi >> 1;
|
|
993
|
+
const base = at + 16 + mid * 12;
|
|
994
|
+
if (code > u32(view, base + 4)) lo = mid + 1;
|
|
995
|
+
else if (code < u32(view, base)) hi = mid - 1;
|
|
996
|
+
else return u32(view, base + 8) + (code - u32(view, base));
|
|
997
|
+
}
|
|
998
|
+
return 0;
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
1001
|
+
function characterMap(view, table) {
|
|
1002
|
+
const count = u16(view, table + 2);
|
|
1003
|
+
let best;
|
|
1004
|
+
for (let index = 0; index < count; index++) {
|
|
1005
|
+
const platform = u16(view, table + 4 + index * 8);
|
|
1006
|
+
const encoding = u16(view, table + 6 + index * 8);
|
|
1007
|
+
const at = table + u32(view, table + 8 + index * 8);
|
|
1008
|
+
const format = u16(view, at);
|
|
1009
|
+
if (format !== 4 && format !== 12) continue;
|
|
1010
|
+
const rank = platform === 3 && encoding === 10 || platform === 0 && format === 12 ? 3 : platform === 3 && encoding === 1 ? 2 : platform === 0 ? 1 : 0;
|
|
1011
|
+
if (rank > 0 && (!best || rank > best.rank)) best = { rank, at };
|
|
1012
|
+
}
|
|
1013
|
+
if (!best) return void 0;
|
|
1014
|
+
return u16(view, best.at) === 12 ? format12(view, best.at) : format4(view, best.at);
|
|
1015
|
+
}
|
|
1016
|
+
function parseTrueType(data) {
|
|
1017
|
+
if (data.length < 12) return void 0;
|
|
1018
|
+
const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
1019
|
+
const base = tag(view, 0) === "ttcf" ? u32(view, 12) : 0;
|
|
1020
|
+
if (base + 12 > data.length) return void 0;
|
|
1021
|
+
if (u32(view, base) !== 65536 && tag(view, base) !== "true") return void 0;
|
|
1022
|
+
const count = u16(view, base + 4);
|
|
1023
|
+
const tables = /* @__PURE__ */ new Map();
|
|
1024
|
+
for (let index = 0; index < count; index++) {
|
|
1025
|
+
const entry = base + 12 + index * 16;
|
|
1026
|
+
if (entry + 16 > data.length) return void 0;
|
|
1027
|
+
const offset = u32(view, entry + 8);
|
|
1028
|
+
const length = u32(view, entry + 12);
|
|
1029
|
+
if (offset + length > data.length) return void 0;
|
|
1030
|
+
tables.set(tag(view, entry), { offset, length });
|
|
1031
|
+
}
|
|
1032
|
+
const head = tables.get("head");
|
|
1033
|
+
const hhea = tables.get("hhea");
|
|
1034
|
+
const maxp = tables.get("maxp");
|
|
1035
|
+
const hmtx = tables.get("hmtx");
|
|
1036
|
+
const loca = tables.get("loca");
|
|
1037
|
+
const glyf = tables.get("glyf");
|
|
1038
|
+
const cmap = tables.get("cmap");
|
|
1039
|
+
if (!head || !hhea || !maxp || !hmtx || !loca || !glyf || !cmap) return void 0;
|
|
1040
|
+
if (head.length < 54 || hhea.length < 36 || maxp.length < 6) return void 0;
|
|
1041
|
+
const unitsPerEm = u16(view, head.offset + 18);
|
|
1042
|
+
const glyphCount = u16(view, maxp.offset + 4);
|
|
1043
|
+
if (!unitsPerEm || !glyphCount) return void 0;
|
|
1044
|
+
const locaFormat = i16(view, head.offset + 50);
|
|
1045
|
+
const lookup = characterMap(view, cmap.offset);
|
|
1046
|
+
if (!lookup) return void 0;
|
|
1047
|
+
const metrics = u16(view, hhea.offset + 34);
|
|
1048
|
+
const os2 = tables.get("OS/2");
|
|
1049
|
+
const post = tables.get("post");
|
|
1050
|
+
return {
|
|
1051
|
+
data,
|
|
1052
|
+
tables,
|
|
1053
|
+
unitsPerEm,
|
|
1054
|
+
glyphCount,
|
|
1055
|
+
ascent: i16(view, hhea.offset + 4),
|
|
1056
|
+
descent: i16(view, hhea.offset + 6),
|
|
1057
|
+
bbox: [
|
|
1058
|
+
i16(view, head.offset + 36),
|
|
1059
|
+
i16(view, head.offset + 38),
|
|
1060
|
+
i16(view, head.offset + 40),
|
|
1061
|
+
i16(view, head.offset + 42)
|
|
1062
|
+
],
|
|
1063
|
+
italicAngle: post ? i16(view, post.offset + 4) + u16(view, post.offset + 6) / 65536 : 0,
|
|
1064
|
+
capHeight: os2 && os2.length >= 90 ? i16(view, os2.offset + 88) || void 0 : void 0,
|
|
1065
|
+
embeddingFlags: os2 ? u16(view, os2.offset + 8) : 0,
|
|
1066
|
+
locaFormat,
|
|
1067
|
+
glyphFor: (code) => {
|
|
1068
|
+
const glyph = lookup(code);
|
|
1069
|
+
return glyph < glyphCount ? glyph : 0;
|
|
1070
|
+
},
|
|
1071
|
+
advance: (glyph) => u16(view, hmtx.offset + Math.min(glyph, Math.max(0, metrics - 1)) * 4),
|
|
1072
|
+
bearing: (glyph) => glyph < metrics ? i16(view, hmtx.offset + glyph * 4 + 2) : i16(view, hmtx.offset + metrics * 4 + (glyph - metrics) * 2),
|
|
1073
|
+
outline: (glyph) => {
|
|
1074
|
+
if (glyph < 0 || glyph >= glyphCount) return new Uint8Array(0);
|
|
1075
|
+
const at = loca.offset + glyph * (locaFormat ? 4 : 2);
|
|
1076
|
+
const start = locaFormat ? u32(view, at) : u16(view, at) * 2;
|
|
1077
|
+
const end = locaFormat ? u32(view, at + 4) : u16(view, at + 2) * 2;
|
|
1078
|
+
if (end <= start || glyf.offset + end > data.length) return new Uint8Array(0);
|
|
1079
|
+
return data.subarray(glyf.offset + start, glyf.offset + end);
|
|
1080
|
+
}
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
// text/truetype/subset.ts
|
|
1085
|
+
var pad4 = (n) => n + 3 & -4;
|
|
1086
|
+
function checksum(bytes) {
|
|
1087
|
+
let sum = 0;
|
|
1088
|
+
for (let i = 0; i < bytes.length; i += 4)
|
|
1089
|
+
sum = sum + ((bytes[i] ?? 0) << 24 | (bytes[i + 1] ?? 0) << 16 | (bytes[i + 2] ?? 0) << 8 | (bytes[i + 3] ?? 0)) >>> 0;
|
|
1090
|
+
return sum;
|
|
1091
|
+
}
|
|
1092
|
+
function components(outline) {
|
|
1093
|
+
if (outline.length < 10) return [];
|
|
1094
|
+
const view = new DataView(outline.buffer, outline.byteOffset, outline.byteLength);
|
|
1095
|
+
if (view.getInt16(0) >= 0) return [];
|
|
1096
|
+
const found = [];
|
|
1097
|
+
let at = 10;
|
|
1098
|
+
for (let guard = 0; guard < 256 && at + 4 <= outline.length; guard++) {
|
|
1099
|
+
const flags = view.getUint16(at);
|
|
1100
|
+
found.push({ offset: at + 2, glyph: view.getUint16(at + 2) });
|
|
1101
|
+
if (!(flags & 32)) break;
|
|
1102
|
+
at += 4 + (flags & 1 ? 4 : 2);
|
|
1103
|
+
if (flags & 8) at += 2;
|
|
1104
|
+
else if (flags & 64) at += 4;
|
|
1105
|
+
else if (flags & 128) at += 8;
|
|
1106
|
+
}
|
|
1107
|
+
return found;
|
|
1108
|
+
}
|
|
1109
|
+
function subsetTrueType(font, used) {
|
|
1110
|
+
const glyphs = [0];
|
|
1111
|
+
const mapped = /* @__PURE__ */ new Map([[0, 0]]);
|
|
1112
|
+
const add = (glyph) => {
|
|
1113
|
+
if (mapped.has(glyph) || glyph >= font.glyphCount) return;
|
|
1114
|
+
mapped.set(glyph, glyphs.length);
|
|
1115
|
+
glyphs.push(glyph);
|
|
1116
|
+
};
|
|
1117
|
+
for (const glyph of used) add(glyph);
|
|
1118
|
+
for (let index = 1; index < glyphs.length; index++)
|
|
1119
|
+
for (const part of components(font.outline(glyphs[index]))) add(part.glyph);
|
|
1120
|
+
const outlines = glyphs.map((glyph) => {
|
|
1121
|
+
const source = font.outline(glyph);
|
|
1122
|
+
if (!source.length) return source;
|
|
1123
|
+
const copy = Uint8Array.from(source);
|
|
1124
|
+
const view2 = new DataView(copy.buffer);
|
|
1125
|
+
for (const part of components(copy)) view2.setUint16(part.offset, mapped.get(part.glyph) ?? 0);
|
|
1126
|
+
return copy;
|
|
1127
|
+
});
|
|
1128
|
+
const count = glyphs.length;
|
|
1129
|
+
let glyfLength = 0;
|
|
1130
|
+
for (const outline of outlines) glyfLength += pad4(outline.length);
|
|
1131
|
+
const glyf = new Uint8Array(glyfLength);
|
|
1132
|
+
const loca = new Uint8Array((count + 1) * 4);
|
|
1133
|
+
const locaView = new DataView(loca.buffer);
|
|
1134
|
+
let cursor = 0;
|
|
1135
|
+
outlines.forEach((outline, index) => {
|
|
1136
|
+
locaView.setUint32(index * 4, cursor);
|
|
1137
|
+
glyf.set(outline, cursor);
|
|
1138
|
+
cursor += pad4(outline.length);
|
|
1139
|
+
});
|
|
1140
|
+
locaView.setUint32(count * 4, cursor);
|
|
1141
|
+
const hmtx = new Uint8Array(count * 4);
|
|
1142
|
+
const hmtxView = new DataView(hmtx.buffer);
|
|
1143
|
+
glyphs.forEach((glyph, index) => {
|
|
1144
|
+
hmtxView.setUint16(index * 4, font.advance(glyph));
|
|
1145
|
+
hmtxView.setInt16(index * 4 + 2, font.bearing(glyph));
|
|
1146
|
+
});
|
|
1147
|
+
const copyTable = (name) => {
|
|
1148
|
+
const entry = font.tables.get(name);
|
|
1149
|
+
return entry ? Uint8Array.from(font.data.subarray(entry.offset, entry.offset + entry.length)) : void 0;
|
|
1150
|
+
};
|
|
1151
|
+
const head = copyTable("head");
|
|
1152
|
+
const hhea = copyTable("hhea");
|
|
1153
|
+
const maxp = copyTable("maxp");
|
|
1154
|
+
new DataView(head.buffer).setUint32(8, 0);
|
|
1155
|
+
new DataView(head.buffer).setInt16(50, 1);
|
|
1156
|
+
new DataView(hhea.buffer).setUint16(34, count);
|
|
1157
|
+
new DataView(maxp.buffer).setUint16(4, count);
|
|
1158
|
+
const tables = [];
|
|
1159
|
+
for (const [name, bytes] of [
|
|
1160
|
+
["glyf", glyf],
|
|
1161
|
+
["head", head],
|
|
1162
|
+
["hhea", hhea],
|
|
1163
|
+
["hmtx", hmtx],
|
|
1164
|
+
["loca", loca],
|
|
1165
|
+
["maxp", maxp]
|
|
1166
|
+
])
|
|
1167
|
+
if (bytes) tables.push([name, bytes]);
|
|
1168
|
+
const directory = 12 + tables.length * 16;
|
|
1169
|
+
let total = directory;
|
|
1170
|
+
for (const [, bytes] of tables) total += pad4(bytes.length);
|
|
1171
|
+
const out = new Uint8Array(total);
|
|
1172
|
+
const view = new DataView(out.buffer);
|
|
1173
|
+
view.setUint32(0, 65536);
|
|
1174
|
+
view.setUint16(4, tables.length);
|
|
1175
|
+
const power = 2 ** Math.floor(Math.log2(tables.length));
|
|
1176
|
+
view.setUint16(6, power * 16);
|
|
1177
|
+
view.setUint16(8, Math.log2(power));
|
|
1178
|
+
view.setUint16(10, tables.length * 16 - power * 16);
|
|
1179
|
+
let position = directory;
|
|
1180
|
+
let headAt = 0;
|
|
1181
|
+
tables.forEach(([name, bytes], index) => {
|
|
1182
|
+
const entry = 12 + index * 16;
|
|
1183
|
+
for (let i = 0; i < 4; i++) out[entry + i] = name.charCodeAt(i);
|
|
1184
|
+
view.setUint32(entry + 4, checksum(bytes));
|
|
1185
|
+
view.setUint32(entry + 8, position);
|
|
1186
|
+
view.setUint32(entry + 12, bytes.length);
|
|
1187
|
+
out.set(bytes, position);
|
|
1188
|
+
if (name === "head") headAt = position;
|
|
1189
|
+
position += pad4(bytes.length);
|
|
1190
|
+
});
|
|
1191
|
+
view.setUint32(headAt + 8, 2981146554 - checksum(out) >>> 0);
|
|
1192
|
+
return { data: out, glyphs };
|
|
1193
|
+
}
|
|
1194
|
+
|
|
956
1195
|
exports.FONT_SUBSTITUTION_MAP = FONT_SUBSTITUTION_MAP;
|
|
957
1196
|
exports.METRIC_FONT_SUBSTITUTES = METRIC_FONT_SUBSTITUTES;
|
|
958
1197
|
exports.PANOSE_FAMILY_MAP = PANOSE_FAMILY_MAP;
|
|
@@ -983,6 +1222,7 @@ exports.metricFontFamily = metricFontFamily;
|
|
|
983
1222
|
exports.parseLocaleNumber = parseLocaleNumber;
|
|
984
1223
|
exports.parsePanoseBytes = parsePanoseBytes;
|
|
985
1224
|
exports.parsePanoseString = parsePanoseString;
|
|
1225
|
+
exports.parseTrueType = parseTrueType;
|
|
986
1226
|
exports.parseTsv = parseTsv;
|
|
987
1227
|
exports.realignOrCollapseRuns = realignOrCollapseRuns;
|
|
988
1228
|
exports.resolveFontForScript = resolveFontForScript;
|
|
@@ -990,5 +1230,6 @@ exports.resolveScriptFontSet = resolveScriptFontSet;
|
|
|
990
1230
|
exports.segmentByFont = segmentByFont;
|
|
991
1231
|
exports.segmentByScript = segmentByScript;
|
|
992
1232
|
exports.stripFontStyleSuffix = stripFontStyleSuffix;
|
|
1233
|
+
exports.subsetTrueType = subsetTrueType;
|
|
993
1234
|
exports.toTsv = toTsv;
|
|
994
1235
|
exports.wrapStyledRuns = wrapStyledRuns;
|
package/dist/text/index.d.ts
CHANGED
|
@@ -11,4 +11,6 @@ export * from './realign-runs.js';
|
|
|
11
11
|
export * from './font-substitution.js';
|
|
12
12
|
export * from './metric-font-family.js';
|
|
13
13
|
export * from './script-fonts.js';
|
|
14
|
+
export { parseTrueType, type TrueTypeFont } from './truetype/parse.js';
|
|
15
|
+
export { subsetTrueType, type TrueTypeSubset } from './truetype/subset.js';
|
|
14
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/text/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../text/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,OAAO,EACN,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,kBAAkB,EACvB,KAAK,SAAS,GACd,MAAM,4BAA4B,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAE/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../text/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,OAAO,EACN,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,kBAAkB,EACvB,KAAK,SAAS,GACd,MAAM,4BAA4B,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAE/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/text/index.mjs
CHANGED
|
@@ -951,4 +951,243 @@ function segmentByFont(text, fonts) {
|
|
|
951
951
|
return result;
|
|
952
952
|
}
|
|
953
953
|
|
|
954
|
-
|
|
954
|
+
// text/truetype/parse.ts
|
|
955
|
+
var u16 = (v, o) => o + 2 <= v.byteLength ? v.getUint16(o) : 0;
|
|
956
|
+
var i16 = (v, o) => o + 2 <= v.byteLength ? v.getInt16(o) : 0;
|
|
957
|
+
var u32 = (v, o) => o + 4 <= v.byteLength ? v.getUint32(o) : 0;
|
|
958
|
+
var tag = (v, o) => String.fromCharCode(v.getUint8(o), v.getUint8(o + 1), v.getUint8(o + 2), v.getUint8(o + 3));
|
|
959
|
+
function format4(view, at) {
|
|
960
|
+
const segments = u16(view, at + 6) / 2;
|
|
961
|
+
const ends = at + 14;
|
|
962
|
+
const starts = ends + segments * 2 + 2;
|
|
963
|
+
const deltas = starts + segments * 2;
|
|
964
|
+
const offsets = deltas + segments * 2;
|
|
965
|
+
return (code) => {
|
|
966
|
+
if (code > 65535) return 0;
|
|
967
|
+
let lo = 0;
|
|
968
|
+
let hi = segments - 1;
|
|
969
|
+
while (lo <= hi) {
|
|
970
|
+
const mid = lo + hi >> 1;
|
|
971
|
+
if (code > u16(view, ends + mid * 2)) lo = mid + 1;
|
|
972
|
+
else if (code < u16(view, starts + mid * 2)) hi = mid - 1;
|
|
973
|
+
else {
|
|
974
|
+
const range = u16(view, offsets + mid * 2);
|
|
975
|
+
if (!range) return code + u16(view, deltas + mid * 2) & 65535;
|
|
976
|
+
const slot = offsets + mid * 2 + range + (code - u16(view, starts + mid * 2)) * 2;
|
|
977
|
+
const glyph = u16(view, slot);
|
|
978
|
+
return glyph ? glyph + u16(view, deltas + mid * 2) & 65535 : 0;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
return 0;
|
|
982
|
+
};
|
|
983
|
+
}
|
|
984
|
+
function format12(view, at) {
|
|
985
|
+
const groups = u32(view, at + 12);
|
|
986
|
+
return (code) => {
|
|
987
|
+
let lo = 0;
|
|
988
|
+
let hi = groups - 1;
|
|
989
|
+
while (lo <= hi) {
|
|
990
|
+
const mid = lo + hi >> 1;
|
|
991
|
+
const base = at + 16 + mid * 12;
|
|
992
|
+
if (code > u32(view, base + 4)) lo = mid + 1;
|
|
993
|
+
else if (code < u32(view, base)) hi = mid - 1;
|
|
994
|
+
else return u32(view, base + 8) + (code - u32(view, base));
|
|
995
|
+
}
|
|
996
|
+
return 0;
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
function characterMap(view, table) {
|
|
1000
|
+
const count = u16(view, table + 2);
|
|
1001
|
+
let best;
|
|
1002
|
+
for (let index = 0; index < count; index++) {
|
|
1003
|
+
const platform = u16(view, table + 4 + index * 8);
|
|
1004
|
+
const encoding = u16(view, table + 6 + index * 8);
|
|
1005
|
+
const at = table + u32(view, table + 8 + index * 8);
|
|
1006
|
+
const format = u16(view, at);
|
|
1007
|
+
if (format !== 4 && format !== 12) continue;
|
|
1008
|
+
const rank = platform === 3 && encoding === 10 || platform === 0 && format === 12 ? 3 : platform === 3 && encoding === 1 ? 2 : platform === 0 ? 1 : 0;
|
|
1009
|
+
if (rank > 0 && (!best || rank > best.rank)) best = { rank, at };
|
|
1010
|
+
}
|
|
1011
|
+
if (!best) return void 0;
|
|
1012
|
+
return u16(view, best.at) === 12 ? format12(view, best.at) : format4(view, best.at);
|
|
1013
|
+
}
|
|
1014
|
+
function parseTrueType(data) {
|
|
1015
|
+
if (data.length < 12) return void 0;
|
|
1016
|
+
const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
1017
|
+
const base = tag(view, 0) === "ttcf" ? u32(view, 12) : 0;
|
|
1018
|
+
if (base + 12 > data.length) return void 0;
|
|
1019
|
+
if (u32(view, base) !== 65536 && tag(view, base) !== "true") return void 0;
|
|
1020
|
+
const count = u16(view, base + 4);
|
|
1021
|
+
const tables = /* @__PURE__ */ new Map();
|
|
1022
|
+
for (let index = 0; index < count; index++) {
|
|
1023
|
+
const entry = base + 12 + index * 16;
|
|
1024
|
+
if (entry + 16 > data.length) return void 0;
|
|
1025
|
+
const offset = u32(view, entry + 8);
|
|
1026
|
+
const length = u32(view, entry + 12);
|
|
1027
|
+
if (offset + length > data.length) return void 0;
|
|
1028
|
+
tables.set(tag(view, entry), { offset, length });
|
|
1029
|
+
}
|
|
1030
|
+
const head = tables.get("head");
|
|
1031
|
+
const hhea = tables.get("hhea");
|
|
1032
|
+
const maxp = tables.get("maxp");
|
|
1033
|
+
const hmtx = tables.get("hmtx");
|
|
1034
|
+
const loca = tables.get("loca");
|
|
1035
|
+
const glyf = tables.get("glyf");
|
|
1036
|
+
const cmap = tables.get("cmap");
|
|
1037
|
+
if (!head || !hhea || !maxp || !hmtx || !loca || !glyf || !cmap) return void 0;
|
|
1038
|
+
if (head.length < 54 || hhea.length < 36 || maxp.length < 6) return void 0;
|
|
1039
|
+
const unitsPerEm = u16(view, head.offset + 18);
|
|
1040
|
+
const glyphCount = u16(view, maxp.offset + 4);
|
|
1041
|
+
if (!unitsPerEm || !glyphCount) return void 0;
|
|
1042
|
+
const locaFormat = i16(view, head.offset + 50);
|
|
1043
|
+
const lookup = characterMap(view, cmap.offset);
|
|
1044
|
+
if (!lookup) return void 0;
|
|
1045
|
+
const metrics = u16(view, hhea.offset + 34);
|
|
1046
|
+
const os2 = tables.get("OS/2");
|
|
1047
|
+
const post = tables.get("post");
|
|
1048
|
+
return {
|
|
1049
|
+
data,
|
|
1050
|
+
tables,
|
|
1051
|
+
unitsPerEm,
|
|
1052
|
+
glyphCount,
|
|
1053
|
+
ascent: i16(view, hhea.offset + 4),
|
|
1054
|
+
descent: i16(view, hhea.offset + 6),
|
|
1055
|
+
bbox: [
|
|
1056
|
+
i16(view, head.offset + 36),
|
|
1057
|
+
i16(view, head.offset + 38),
|
|
1058
|
+
i16(view, head.offset + 40),
|
|
1059
|
+
i16(view, head.offset + 42)
|
|
1060
|
+
],
|
|
1061
|
+
italicAngle: post ? i16(view, post.offset + 4) + u16(view, post.offset + 6) / 65536 : 0,
|
|
1062
|
+
capHeight: os2 && os2.length >= 90 ? i16(view, os2.offset + 88) || void 0 : void 0,
|
|
1063
|
+
embeddingFlags: os2 ? u16(view, os2.offset + 8) : 0,
|
|
1064
|
+
locaFormat,
|
|
1065
|
+
glyphFor: (code) => {
|
|
1066
|
+
const glyph = lookup(code);
|
|
1067
|
+
return glyph < glyphCount ? glyph : 0;
|
|
1068
|
+
},
|
|
1069
|
+
advance: (glyph) => u16(view, hmtx.offset + Math.min(glyph, Math.max(0, metrics - 1)) * 4),
|
|
1070
|
+
bearing: (glyph) => glyph < metrics ? i16(view, hmtx.offset + glyph * 4 + 2) : i16(view, hmtx.offset + metrics * 4 + (glyph - metrics) * 2),
|
|
1071
|
+
outline: (glyph) => {
|
|
1072
|
+
if (glyph < 0 || glyph >= glyphCount) return new Uint8Array(0);
|
|
1073
|
+
const at = loca.offset + glyph * (locaFormat ? 4 : 2);
|
|
1074
|
+
const start = locaFormat ? u32(view, at) : u16(view, at) * 2;
|
|
1075
|
+
const end = locaFormat ? u32(view, at + 4) : u16(view, at + 2) * 2;
|
|
1076
|
+
if (end <= start || glyf.offset + end > data.length) return new Uint8Array(0);
|
|
1077
|
+
return data.subarray(glyf.offset + start, glyf.offset + end);
|
|
1078
|
+
}
|
|
1079
|
+
};
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
// text/truetype/subset.ts
|
|
1083
|
+
var pad4 = (n) => n + 3 & -4;
|
|
1084
|
+
function checksum(bytes) {
|
|
1085
|
+
let sum = 0;
|
|
1086
|
+
for (let i = 0; i < bytes.length; i += 4)
|
|
1087
|
+
sum = sum + ((bytes[i] ?? 0) << 24 | (bytes[i + 1] ?? 0) << 16 | (bytes[i + 2] ?? 0) << 8 | (bytes[i + 3] ?? 0)) >>> 0;
|
|
1088
|
+
return sum;
|
|
1089
|
+
}
|
|
1090
|
+
function components(outline) {
|
|
1091
|
+
if (outline.length < 10) return [];
|
|
1092
|
+
const view = new DataView(outline.buffer, outline.byteOffset, outline.byteLength);
|
|
1093
|
+
if (view.getInt16(0) >= 0) return [];
|
|
1094
|
+
const found = [];
|
|
1095
|
+
let at = 10;
|
|
1096
|
+
for (let guard = 0; guard < 256 && at + 4 <= outline.length; guard++) {
|
|
1097
|
+
const flags = view.getUint16(at);
|
|
1098
|
+
found.push({ offset: at + 2, glyph: view.getUint16(at + 2) });
|
|
1099
|
+
if (!(flags & 32)) break;
|
|
1100
|
+
at += 4 + (flags & 1 ? 4 : 2);
|
|
1101
|
+
if (flags & 8) at += 2;
|
|
1102
|
+
else if (flags & 64) at += 4;
|
|
1103
|
+
else if (flags & 128) at += 8;
|
|
1104
|
+
}
|
|
1105
|
+
return found;
|
|
1106
|
+
}
|
|
1107
|
+
function subsetTrueType(font, used) {
|
|
1108
|
+
const glyphs = [0];
|
|
1109
|
+
const mapped = /* @__PURE__ */ new Map([[0, 0]]);
|
|
1110
|
+
const add = (glyph) => {
|
|
1111
|
+
if (mapped.has(glyph) || glyph >= font.glyphCount) return;
|
|
1112
|
+
mapped.set(glyph, glyphs.length);
|
|
1113
|
+
glyphs.push(glyph);
|
|
1114
|
+
};
|
|
1115
|
+
for (const glyph of used) add(glyph);
|
|
1116
|
+
for (let index = 1; index < glyphs.length; index++)
|
|
1117
|
+
for (const part of components(font.outline(glyphs[index]))) add(part.glyph);
|
|
1118
|
+
const outlines = glyphs.map((glyph) => {
|
|
1119
|
+
const source = font.outline(glyph);
|
|
1120
|
+
if (!source.length) return source;
|
|
1121
|
+
const copy = Uint8Array.from(source);
|
|
1122
|
+
const view2 = new DataView(copy.buffer);
|
|
1123
|
+
for (const part of components(copy)) view2.setUint16(part.offset, mapped.get(part.glyph) ?? 0);
|
|
1124
|
+
return copy;
|
|
1125
|
+
});
|
|
1126
|
+
const count = glyphs.length;
|
|
1127
|
+
let glyfLength = 0;
|
|
1128
|
+
for (const outline of outlines) glyfLength += pad4(outline.length);
|
|
1129
|
+
const glyf = new Uint8Array(glyfLength);
|
|
1130
|
+
const loca = new Uint8Array((count + 1) * 4);
|
|
1131
|
+
const locaView = new DataView(loca.buffer);
|
|
1132
|
+
let cursor = 0;
|
|
1133
|
+
outlines.forEach((outline, index) => {
|
|
1134
|
+
locaView.setUint32(index * 4, cursor);
|
|
1135
|
+
glyf.set(outline, cursor);
|
|
1136
|
+
cursor += pad4(outline.length);
|
|
1137
|
+
});
|
|
1138
|
+
locaView.setUint32(count * 4, cursor);
|
|
1139
|
+
const hmtx = new Uint8Array(count * 4);
|
|
1140
|
+
const hmtxView = new DataView(hmtx.buffer);
|
|
1141
|
+
glyphs.forEach((glyph, index) => {
|
|
1142
|
+
hmtxView.setUint16(index * 4, font.advance(glyph));
|
|
1143
|
+
hmtxView.setInt16(index * 4 + 2, font.bearing(glyph));
|
|
1144
|
+
});
|
|
1145
|
+
const copyTable = (name) => {
|
|
1146
|
+
const entry = font.tables.get(name);
|
|
1147
|
+
return entry ? Uint8Array.from(font.data.subarray(entry.offset, entry.offset + entry.length)) : void 0;
|
|
1148
|
+
};
|
|
1149
|
+
const head = copyTable("head");
|
|
1150
|
+
const hhea = copyTable("hhea");
|
|
1151
|
+
const maxp = copyTable("maxp");
|
|
1152
|
+
new DataView(head.buffer).setUint32(8, 0);
|
|
1153
|
+
new DataView(head.buffer).setInt16(50, 1);
|
|
1154
|
+
new DataView(hhea.buffer).setUint16(34, count);
|
|
1155
|
+
new DataView(maxp.buffer).setUint16(4, count);
|
|
1156
|
+
const tables = [];
|
|
1157
|
+
for (const [name, bytes] of [
|
|
1158
|
+
["glyf", glyf],
|
|
1159
|
+
["head", head],
|
|
1160
|
+
["hhea", hhea],
|
|
1161
|
+
["hmtx", hmtx],
|
|
1162
|
+
["loca", loca],
|
|
1163
|
+
["maxp", maxp]
|
|
1164
|
+
])
|
|
1165
|
+
if (bytes) tables.push([name, bytes]);
|
|
1166
|
+
const directory = 12 + tables.length * 16;
|
|
1167
|
+
let total = directory;
|
|
1168
|
+
for (const [, bytes] of tables) total += pad4(bytes.length);
|
|
1169
|
+
const out = new Uint8Array(total);
|
|
1170
|
+
const view = new DataView(out.buffer);
|
|
1171
|
+
view.setUint32(0, 65536);
|
|
1172
|
+
view.setUint16(4, tables.length);
|
|
1173
|
+
const power = 2 ** Math.floor(Math.log2(tables.length));
|
|
1174
|
+
view.setUint16(6, power * 16);
|
|
1175
|
+
view.setUint16(8, Math.log2(power));
|
|
1176
|
+
view.setUint16(10, tables.length * 16 - power * 16);
|
|
1177
|
+
let position = directory;
|
|
1178
|
+
let headAt = 0;
|
|
1179
|
+
tables.forEach(([name, bytes], index) => {
|
|
1180
|
+
const entry = 12 + index * 16;
|
|
1181
|
+
for (let i = 0; i < 4; i++) out[entry + i] = name.charCodeAt(i);
|
|
1182
|
+
view.setUint32(entry + 4, checksum(bytes));
|
|
1183
|
+
view.setUint32(entry + 8, position);
|
|
1184
|
+
view.setUint32(entry + 12, bytes.length);
|
|
1185
|
+
out.set(bytes, position);
|
|
1186
|
+
if (name === "head") headAt = position;
|
|
1187
|
+
position += pad4(bytes.length);
|
|
1188
|
+
});
|
|
1189
|
+
view.setUint32(headAt + 8, 2981146554 - checksum(out) >>> 0);
|
|
1190
|
+
return { data: out, glyphs };
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
export { FONT_SUBSTITUTION_MAP, METRIC_FONT_SUBSTITUTES, PANOSE_FAMILY_MAP, PANOSE_MONOSPACE_PROPORTION, PANOSE_SANS_SERIF_STYLES, PANOSE_WEIGHT_MAP, TEXT_CASE_MODES, buildFontFamilyString, buildLeaderString, changeTextCase, changeTextCaseRanges, classifyPanose, decimalAnchorIndex, decimalSeparatorForLanguage, designTextWidthEm, detectFontScript, distributeRunsText, formatLocaleNumber, getLeaderCharacter, getLeaderStyles, getPanoseWeight, getSubstituteFontFamily, getSubstituteFonts, hasDesignAdvances, hasDirectSubstitution, hasDistinctScriptFonts, metricFontFamily, parseLocaleNumber, parsePanoseBytes, parsePanoseString, parseTrueType, parseTsv, realignOrCollapseRuns, resolveFontForScript, resolveScriptFontSet, segmentByFont, segmentByScript, stripFontStyleSuffix, subsetTrueType, toTsv, wrapStyledRuns };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A reader for TrueType-flavoured sfnt fonts (`.ttf`, and the first font of a `.ttc`): the
|
|
3
|
+
* metrics, the character map and the outline tables a subsetter needs. OpenType fonts with
|
|
4
|
+
* CFF outlines are refused (`parseTrueType` returns `undefined`). DOM-free and dependency free.
|
|
5
|
+
*/
|
|
6
|
+
export interface TrueTypeFont {
|
|
7
|
+
readonly data: Uint8Array;
|
|
8
|
+
readonly tables: ReadonlyMap<string, {
|
|
9
|
+
offset: number;
|
|
10
|
+
length: number;
|
|
11
|
+
}>;
|
|
12
|
+
readonly unitsPerEm: number;
|
|
13
|
+
readonly glyphCount: number;
|
|
14
|
+
/** `hhea` ascent and descent in font units (descent is negative). */
|
|
15
|
+
readonly ascent: number;
|
|
16
|
+
readonly descent: number;
|
|
17
|
+
readonly bbox: readonly [number, number, number, number];
|
|
18
|
+
readonly italicAngle: number;
|
|
19
|
+
/** Cap height in font units, when the `OS/2` table has it. */
|
|
20
|
+
readonly capHeight: number | undefined;
|
|
21
|
+
/** `OS/2` `fsType`: embedding permissions (0 = installable). */
|
|
22
|
+
readonly embeddingFlags: number;
|
|
23
|
+
/** 0 short, 1 long `loca` offsets. */
|
|
24
|
+
readonly locaFormat: number;
|
|
25
|
+
/** The glyph for a code point, or 0 when the font has none. */
|
|
26
|
+
glyphFor(codePoint: number): number;
|
|
27
|
+
/** Advance width of a glyph in font units. */
|
|
28
|
+
advance(glyph: number): number;
|
|
29
|
+
/** Left side bearing of a glyph in font units. */
|
|
30
|
+
bearing(glyph: number): number;
|
|
31
|
+
/** The bytes of a glyph's outline in `glyf` (empty for blank glyphs). */
|
|
32
|
+
outline(glyph: number): Uint8Array;
|
|
33
|
+
}
|
|
34
|
+
/** Parse a TrueType font; `undefined` when it is not TrueType outlines or is malformed. */
|
|
35
|
+
export declare function parseTrueType(data: Uint8Array): TrueTypeFont | undefined;
|
|
36
|
+
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../text/truetype/parse.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACzE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,qEAAqE;IACrE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACzD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,gEAAgE;IAChE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,sCAAsC;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,8CAA8C;IAC9C,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,kDAAkD;IAClD,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,yEAAyE;IACzE,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC;CACnC;AA2ED,2FAA2F;AAC3F,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,GAAG,SAAS,CAqExE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subset a TrueType font to a list of glyphs. The listed glyphs become glyph ids 1..n in the
|
|
3
|
+
* order given (id 0 stays `.notdef`), so a PDF can address them by sequential CIDs; glyphs
|
|
4
|
+
* that composite outlines reference are appended after them with their ids rewritten.
|
|
5
|
+
* Hinting programs (`cvt `, `fpgm`, `prep`) are dropped: PDF viewers rasterise unhinted and the
|
|
6
|
+
* tables are most of a small subset's size. DOM-free.
|
|
7
|
+
*/
|
|
8
|
+
import type { TrueTypeFont } from './parse.js';
|
|
9
|
+
export interface TrueTypeSubset {
|
|
10
|
+
/** The font file bytes. */
|
|
11
|
+
readonly data: Uint8Array;
|
|
12
|
+
/** Original glyph id per new glyph id (index 0 is `.notdef`). */
|
|
13
|
+
readonly glyphs: readonly number[];
|
|
14
|
+
}
|
|
15
|
+
export declare function subsetTrueType(font: TrueTypeFont, used: readonly number[]): TrueTypeSubset;
|
|
16
|
+
//# sourceMappingURL=subset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subset.d.ts","sourceRoot":"","sources":["../../../text/truetype/subset.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,WAAW,cAAc;IAC9B,2BAA2B;IAC3B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,iEAAiE;IACjE,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAoCD,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,cAAc,CA6F1F"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type VisioFormulaAst } from './formula.js';
|
|
2
|
+
import type { VisioActionRun } from './shape-sections-types.js';
|
|
3
|
+
/** One `SETF(GetRef(cell), value)` step of an action. */
|
|
4
|
+
export interface VisioSetfStep {
|
|
5
|
+
/** The cell name as the formula wrote it (`Geometry2.NoShow`, `User.Mode`). */
|
|
6
|
+
target: string;
|
|
7
|
+
value: VisioFormulaAst;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The SETF steps of an Action formula, or why it is not one this editor runs. An action runs when
|
|
11
|
+
* it is `SETF(GetRef(cell), value)` on a cell of the shape itself, or several of them added
|
|
12
|
+
* together, whose value is computed from numbers and cells (`NOT(Geometry2.NoShow)`).
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseActionSteps(source: string | undefined): {
|
|
15
|
+
steps: VisioSetfStep[];
|
|
16
|
+
} | {
|
|
17
|
+
reason: string;
|
|
18
|
+
};
|
|
19
|
+
/** What the model records about running an action. */
|
|
20
|
+
export declare function actionRun(source: string | undefined): VisioActionRun;
|
|
21
|
+
//# sourceMappingURL=action-formula.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-formula.d.ts","sourceRoot":"","sources":["../../visio/action-formula.ts"],"names":[],"mappings":"AACA,OAAO,EAA0C,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,yDAAyD;AACzD,MAAM,WAAW,aAAa;IAC7B,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,eAAe,CAAC;CACvB;AAID;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC/B,MAAM,EAAE,MAAM,GAAG,SAAS,GACxB;IAAE,KAAK,EAAE,aAAa,EAAE,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAmCjD;AAED,sDAAsD;AACtD,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,cAAc,CAKpE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type VisioFormulaAst, type VisioFormulaReference, type VisioFormulaValue } from './formula.js';
|
|
2
|
+
/**
|
|
3
|
+
* The text a Menu formula yields, for the shapes Visio ships: a string, or `IF(condition, text,
|
|
4
|
+
* text)` over cells, nested and joined with `&`. Anything else is not text this editor can
|
|
5
|
+
* compute and gives `undefined`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function evaluateMenuText(ast: VisioFormulaAst, read: (reference: VisioFormulaReference) => VisioFormulaValue): string | undefined;
|
|
8
|
+
//# sourceMappingURL=action-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-menu.d.ts","sourceRoot":"","sources":["../../visio/action-menu.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,MAAM,WAAW,CAAC;AAEnB;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,eAAe,EACpB,IAAI,EAAE,CAAC,SAAS,EAAE,qBAAqB,KAAK,iBAAiB,GAC3D,MAAM,GAAG,SAAS,CAapB"}
|