@shotstack/shotstack-canvas 2.0.6 → 2.0.7
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/entry.node.cjs +15 -15
- package/dist/entry.node.js +15 -15
- package/dist/entry.web.js +2 -2
- package/package.json +2 -2
package/dist/entry.node.cjs
CHANGED
|
@@ -573,7 +573,7 @@ var wordTimingSchema = import_zod2.wordTimingSchema.extend({
|
|
|
573
573
|
confidence: import_zod.z.number().min(0).max(1).optional()
|
|
574
574
|
});
|
|
575
575
|
var richCaptionFontSchema = import_zod.z.object({
|
|
576
|
-
family: import_zod.z.string().default(
|
|
576
|
+
family: import_zod.z.string().default("Roboto"),
|
|
577
577
|
size: import_zod.z.number().int().min(1).max(500).default(24),
|
|
578
578
|
weight: import_zod.z.union([import_zod.z.string(), import_zod.z.number()]).default("400"),
|
|
579
579
|
color: import_zod.z.string().regex(HEX6).default("#ffffff"),
|
|
@@ -4875,7 +4875,7 @@ function extractFontConfig(asset) {
|
|
|
4875
4875
|
const font = asset.font;
|
|
4876
4876
|
const active = asset.active?.font;
|
|
4877
4877
|
return {
|
|
4878
|
-
family: font?.family ??
|
|
4878
|
+
family: font?.family ?? "Roboto",
|
|
4879
4879
|
size: font?.size ?? 24,
|
|
4880
4880
|
weight: String(font?.weight ?? "400"),
|
|
4881
4881
|
baseColor: font?.color ?? "#ffffff",
|
|
@@ -5799,14 +5799,14 @@ async function createNodeRawEncoder(config, options) {
|
|
|
5799
5799
|
}
|
|
5800
5800
|
|
|
5801
5801
|
// src/core/rich-caption-renderer.ts
|
|
5802
|
-
var
|
|
5803
|
-
var
|
|
5804
|
-
"300":
|
|
5805
|
-
"400":
|
|
5806
|
-
"500":
|
|
5807
|
-
"600":
|
|
5808
|
-
"700":
|
|
5809
|
-
"800":
|
|
5802
|
+
var ROBOTO_FONT_URL = "https://fonts.gstatic.com/s/roboto/v50/KFOmCnqEu92Fr1Me5WZLCzYlKw.ttf";
|
|
5803
|
+
var ROBOTO_FONT_URLS = {
|
|
5804
|
+
"300": ROBOTO_FONT_URL,
|
|
5805
|
+
"400": ROBOTO_FONT_URL,
|
|
5806
|
+
"500": ROBOTO_FONT_URL,
|
|
5807
|
+
"600": ROBOTO_FONT_URL,
|
|
5808
|
+
"700": ROBOTO_FONT_URL,
|
|
5809
|
+
"800": ROBOTO_FONT_URL
|
|
5810
5810
|
};
|
|
5811
5811
|
var RichCaptionRenderer = class {
|
|
5812
5812
|
width;
|
|
@@ -5836,12 +5836,12 @@ var RichCaptionRenderer = class {
|
|
|
5836
5836
|
async initialize() {
|
|
5837
5837
|
this.fontRegistry = await FontRegistry.getSharedInstance(this.wasmBaseURL);
|
|
5838
5838
|
this.layoutEngine = new CaptionLayoutEngine(this.fontRegistry);
|
|
5839
|
-
const weightsToLoad = Object.keys(
|
|
5839
|
+
const weightsToLoad = Object.keys(ROBOTO_FONT_URLS);
|
|
5840
5840
|
const loadPromises = weightsToLoad.map(async (weight) => {
|
|
5841
|
-
const existingFace = await this.fontRegistry.getFace({ family: "
|
|
5841
|
+
const existingFace = await this.fontRegistry.getFace({ family: "Roboto", weight });
|
|
5842
5842
|
if (!existingFace) {
|
|
5843
|
-
const bytes = await loadFileOrHttpToArrayBuffer(
|
|
5844
|
-
await this.fontRegistry.registerFromBytes(bytes, { family: "
|
|
5843
|
+
const bytes = await loadFileOrHttpToArrayBuffer(ROBOTO_FONT_URLS[weight]);
|
|
5844
|
+
await this.fontRegistry.registerFromBytes(bytes, { family: "Roboto", weight });
|
|
5845
5845
|
}
|
|
5846
5846
|
});
|
|
5847
5847
|
await Promise.all(loadPromises);
|
|
@@ -5885,7 +5885,7 @@ var RichCaptionRenderer = class {
|
|
|
5885
5885
|
maxLines: asset.maxLines ?? 2,
|
|
5886
5886
|
position: asset.position ?? "bottom",
|
|
5887
5887
|
fontSize: font?.size ?? 24,
|
|
5888
|
-
fontFamily: font?.family ?? "
|
|
5888
|
+
fontFamily: font?.family ?? "Roboto",
|
|
5889
5889
|
fontWeight: String(font?.weight ?? "400"),
|
|
5890
5890
|
letterSpacing: style?.letterSpacing ?? 0,
|
|
5891
5891
|
wordSpacing: typeof style?.wordSpacing === "number" ? style.wordSpacing : 0,
|
package/dist/entry.node.js
CHANGED
|
@@ -184,7 +184,7 @@ var wordTimingSchema = baseWordTimingSchema.extend({
|
|
|
184
184
|
confidence: z.number().min(0).max(1).optional()
|
|
185
185
|
});
|
|
186
186
|
var richCaptionFontSchema = z.object({
|
|
187
|
-
family: z.string().default(
|
|
187
|
+
family: z.string().default("Roboto"),
|
|
188
188
|
size: z.number().int().min(1).max(500).default(24),
|
|
189
189
|
weight: z.union([z.string(), z.number()]).default("400"),
|
|
190
190
|
color: z.string().regex(HEX6).default("#ffffff"),
|
|
@@ -4485,7 +4485,7 @@ function extractFontConfig(asset) {
|
|
|
4485
4485
|
const font = asset.font;
|
|
4486
4486
|
const active = asset.active?.font;
|
|
4487
4487
|
return {
|
|
4488
|
-
family: font?.family ??
|
|
4488
|
+
family: font?.family ?? "Roboto",
|
|
4489
4489
|
size: font?.size ?? 24,
|
|
4490
4490
|
weight: String(font?.weight ?? "400"),
|
|
4491
4491
|
baseColor: font?.color ?? "#ffffff",
|
|
@@ -5409,14 +5409,14 @@ async function createNodeRawEncoder(config, options) {
|
|
|
5409
5409
|
}
|
|
5410
5410
|
|
|
5411
5411
|
// src/core/rich-caption-renderer.ts
|
|
5412
|
-
var
|
|
5413
|
-
var
|
|
5414
|
-
"300":
|
|
5415
|
-
"400":
|
|
5416
|
-
"500":
|
|
5417
|
-
"600":
|
|
5418
|
-
"700":
|
|
5419
|
-
"800":
|
|
5412
|
+
var ROBOTO_FONT_URL = "https://fonts.gstatic.com/s/roboto/v50/KFOmCnqEu92Fr1Me5WZLCzYlKw.ttf";
|
|
5413
|
+
var ROBOTO_FONT_URLS = {
|
|
5414
|
+
"300": ROBOTO_FONT_URL,
|
|
5415
|
+
"400": ROBOTO_FONT_URL,
|
|
5416
|
+
"500": ROBOTO_FONT_URL,
|
|
5417
|
+
"600": ROBOTO_FONT_URL,
|
|
5418
|
+
"700": ROBOTO_FONT_URL,
|
|
5419
|
+
"800": ROBOTO_FONT_URL
|
|
5420
5420
|
};
|
|
5421
5421
|
var RichCaptionRenderer = class {
|
|
5422
5422
|
width;
|
|
@@ -5446,12 +5446,12 @@ var RichCaptionRenderer = class {
|
|
|
5446
5446
|
async initialize() {
|
|
5447
5447
|
this.fontRegistry = await FontRegistry.getSharedInstance(this.wasmBaseURL);
|
|
5448
5448
|
this.layoutEngine = new CaptionLayoutEngine(this.fontRegistry);
|
|
5449
|
-
const weightsToLoad = Object.keys(
|
|
5449
|
+
const weightsToLoad = Object.keys(ROBOTO_FONT_URLS);
|
|
5450
5450
|
const loadPromises = weightsToLoad.map(async (weight) => {
|
|
5451
|
-
const existingFace = await this.fontRegistry.getFace({ family: "
|
|
5451
|
+
const existingFace = await this.fontRegistry.getFace({ family: "Roboto", weight });
|
|
5452
5452
|
if (!existingFace) {
|
|
5453
|
-
const bytes = await loadFileOrHttpToArrayBuffer(
|
|
5454
|
-
await this.fontRegistry.registerFromBytes(bytes, { family: "
|
|
5453
|
+
const bytes = await loadFileOrHttpToArrayBuffer(ROBOTO_FONT_URLS[weight]);
|
|
5454
|
+
await this.fontRegistry.registerFromBytes(bytes, { family: "Roboto", weight });
|
|
5455
5455
|
}
|
|
5456
5456
|
});
|
|
5457
5457
|
await Promise.all(loadPromises);
|
|
@@ -5495,7 +5495,7 @@ var RichCaptionRenderer = class {
|
|
|
5495
5495
|
maxLines: asset.maxLines ?? 2,
|
|
5496
5496
|
position: asset.position ?? "bottom",
|
|
5497
5497
|
fontSize: font?.size ?? 24,
|
|
5498
|
-
fontFamily: font?.family ?? "
|
|
5498
|
+
fontFamily: font?.family ?? "Roboto",
|
|
5499
5499
|
fontWeight: String(font?.weight ?? "400"),
|
|
5500
5500
|
letterSpacing: style?.letterSpacing ?? 0,
|
|
5501
5501
|
wordSpacing: typeof style?.wordSpacing === "number" ? style.wordSpacing : 0,
|
package/dist/entry.web.js
CHANGED
|
@@ -18062,7 +18062,7 @@ var wordTimingSchema = baseWordTimingSchema.extend({
|
|
|
18062
18062
|
confidence: external_exports.number().min(0).max(1).optional()
|
|
18063
18063
|
});
|
|
18064
18064
|
var richCaptionFontSchema = external_exports.object({
|
|
18065
|
-
family: external_exports.string().default(
|
|
18065
|
+
family: external_exports.string().default("Roboto"),
|
|
18066
18066
|
size: external_exports.number().int().min(1).max(500).default(24),
|
|
18067
18067
|
weight: external_exports.union([external_exports.string(), external_exports.number()]).default("400"),
|
|
18068
18068
|
color: external_exports.string().regex(HEX6).default("#ffffff"),
|
|
@@ -36035,7 +36035,7 @@ function extractFontConfig(asset) {
|
|
|
36035
36035
|
const font = asset.font;
|
|
36036
36036
|
const active = asset.active?.font;
|
|
36037
36037
|
return {
|
|
36038
|
-
family: font?.family ??
|
|
36038
|
+
family: font?.family ?? "Roboto",
|
|
36039
36039
|
size: font?.size ?? 24,
|
|
36040
36040
|
weight: String(font?.weight ?? "400"),
|
|
36041
36041
|
baseColor: font?.color ?? "#ffffff",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shotstack/shotstack-canvas",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "Text layout & animation engine (HarfBuzz) for Node & Web - fully self-contained.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/entry.node.cjs",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@resvg/resvg-js": "^2.6.2",
|
|
47
47
|
"@resvg/resvg-wasm": "^2.6.2",
|
|
48
|
-
"@shotstack/schemas": "1.
|
|
48
|
+
"@shotstack/schemas": "1.8.3",
|
|
49
49
|
"canvas": "npm:@napi-rs/canvas@^0.1.54",
|
|
50
50
|
"ffmpeg-static": "^5.2.0",
|
|
51
51
|
"fontkit": "^2.0.4",
|