pptx-kit-preview 0.0.0 → 0.3.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/README.md +100 -3
- package/dist/index.d.ts +42 -0
- package/dist/index.js +4569 -0
- package/dist/index.js.map +1 -0
- package/dist/node.d.ts +42 -0
- package/dist/node.js +4687 -0
- package/dist/node.js.map +1 -0
- package/fonts/Caladea-Bold.ttf +0 -0
- package/fonts/Caladea-BoldItalic.ttf +0 -0
- package/fonts/Caladea-Italic.ttf +0 -0
- package/fonts/Caladea-Regular.ttf +0 -0
- package/fonts/Carlito-Bold.ttf +0 -0
- package/fonts/Carlito-BoldItalic.ttf +0 -0
- package/fonts/Carlito-Italic.ttf +0 -0
- package/fonts/Carlito-Regular.ttf +0 -0
- package/fonts/LICENSES.md +123 -0
- package/fonts/LiberationMono-Bold.ttf +0 -0
- package/fonts/LiberationMono-BoldItalic.ttf +0 -0
- package/fonts/LiberationMono-Italic.ttf +0 -0
- package/fonts/LiberationMono-Regular.ttf +0 -0
- package/fonts/LiberationSans-Bold.ttf +0 -0
- package/fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/fonts/LiberationSans-Italic.ttf +0 -0
- package/fonts/LiberationSans-Regular.ttf +0 -0
- package/fonts/LiberationSerif-Bold.ttf +0 -0
- package/fonts/LiberationSerif-BoldItalic.ttf +0 -0
- package/fonts/LiberationSerif-Italic.ttf +0 -0
- package/fonts/LiberationSerif-Regular.ttf +0 -0
- package/package.json +51 -5
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { PresentationData, SlideData } from 'pptx-kit';
|
|
2
|
+
import { TextMeasurer } from './index.js';
|
|
3
|
+
export { ARIAL, FontSpec, MONO, MeasureResult, RenderSlideOptions, SANS, SERIF, TIMES, TextLayoutMode, defaultMeasurer, renderSlideToSvg, substituteFamily } from './index.js';
|
|
4
|
+
|
|
5
|
+
declare const FONT_DIR: string;
|
|
6
|
+
/** Absolute paths of every bundled face — passed to resvg's `fontFiles`. */
|
|
7
|
+
declare const FONT_FILES: string[];
|
|
8
|
+
declare const buildFontkitMeasurer: () => TextMeasurer;
|
|
9
|
+
|
|
10
|
+
/** Raw, un-encoded raster: RGBA bytes in row-major order. */
|
|
11
|
+
interface RgbaImage {
|
|
12
|
+
readonly width: number;
|
|
13
|
+
readonly height: number;
|
|
14
|
+
/** `width * height * 4` bytes, R,G,B,A per pixel. */
|
|
15
|
+
readonly data: Uint8Array;
|
|
16
|
+
}
|
|
17
|
+
interface RenderImageOptions {
|
|
18
|
+
/**
|
|
19
|
+
* Target raster width in pixels. Height follows the slide's aspect ratio.
|
|
20
|
+
* Defaults to 1280 (matches the fidelity harness baseline).
|
|
21
|
+
*/
|
|
22
|
+
readonly width?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Text measurer used for wrap/positioning. Defaults to a shared fontkit
|
|
25
|
+
* measurer over the bundled fonts. Pass {@link buildFontkitMeasurer}'s
|
|
26
|
+
* result to control its lifetime, or a custom measurer to swap fonts.
|
|
27
|
+
*/
|
|
28
|
+
readonly measureText?: TextMeasurer;
|
|
29
|
+
}
|
|
30
|
+
/** Render one slide to PNG-encoded bytes. */
|
|
31
|
+
declare const renderSlideToImage: (pres: PresentationData, slide: SlideData, opts?: RenderImageOptions) => Uint8Array;
|
|
32
|
+
/**
|
|
33
|
+
* Render one slide to raw RGBA pixels plus the PNG encoding of the same frame.
|
|
34
|
+
* Both come from a single rasterization, so callers needing pixel access (SSIM,
|
|
35
|
+
* diffing) and a saveable file don't pay to render twice.
|
|
36
|
+
*/
|
|
37
|
+
declare const renderSlideToRgba: (pres: PresentationData, slide: SlideData, opts?: RenderImageOptions) => {
|
|
38
|
+
readonly image: RgbaImage;
|
|
39
|
+
readonly png: Uint8Array;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { FONT_DIR, FONT_FILES, type RenderImageOptions, type RgbaImage, TextMeasurer, buildFontkitMeasurer, renderSlideToImage, renderSlideToRgba };
|