@pdfme/common 2.0.2 → 2.1.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/cjs/__tests__/font.test.js +193 -27
- package/dist/cjs/__tests__/font.test.js.map +1 -1
- package/dist/cjs/__tests__/helper.test.js +15 -0
- package/dist/cjs/__tests__/helper.test.js.map +1 -1
- package/dist/cjs/src/constants.js +8 -5
- package/dist/cjs/src/constants.js.map +1 -1
- package/dist/cjs/src/font.js +147 -38
- package/dist/cjs/src/font.js.map +1 -1
- package/dist/cjs/src/helper.js +10 -1
- package/dist/cjs/src/helper.js.map +1 -1
- package/dist/cjs/src/index.js +11 -5
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/schema.js +1 -0
- package/dist/cjs/src/schema.js.map +1 -1
- package/dist/esm/__tests__/font.test.js +194 -28
- package/dist/esm/__tests__/font.test.js.map +1 -1
- package/dist/esm/__tests__/helper.test.js +16 -1
- package/dist/esm/__tests__/helper.test.js.map +1 -1
- package/dist/esm/src/constants.js +7 -4
- package/dist/esm/src/constants.js.map +1 -1
- package/dist/esm/src/font.js +145 -38
- package/dist/esm/src/font.js.map +1 -1
- package/dist/esm/src/helper.js +8 -1
- package/dist/esm/src/helper.js.map +1 -1
- package/dist/esm/src/index.js +4 -4
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/schema.js +1 -0
- package/dist/esm/src/schema.js.map +1 -1
- package/dist/types/src/constants.d.ts +7 -4
- package/dist/types/src/font.d.ts +20 -1
- package/dist/types/src/helper.d.ts +2 -0
- package/dist/types/src/index.d.ts +5 -5
- package/dist/types/src/schema.d.ts +94 -0
- package/dist/types/src/type.d.ts +1 -0
- package/package.json +1 -1
- package/src/constants.ts +7 -4
- package/src/font.ts +195 -63
- package/src/helper.ts +10 -1
- package/src/index.ts +24 -9
- package/src/schema.ts +1 -0
package/dist/cjs/src/font.js
CHANGED
@@ -32,11 +32,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
32
32
|
});
|
33
33
|
};
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
35
|
-
exports.calculateDynamicFontSize = exports.getFontKitFont = exports.heightOfFontAtSize = exports.getFontAlignmentValue = exports.checkFont = exports.getDefaultFont = exports.getFallbackFontName = void 0;
|
35
|
+
exports.calculateDynamicFontSize = exports.getSplittedLines = exports.getFontKitFont = exports.widthOfTextAtSize = exports.heightOfFontAtSize = exports.getFontAlignmentValue = exports.checkFont = exports.getDefaultFont = exports.getFallbackFontName = void 0;
|
36
36
|
const fontkit = __importStar(require("fontkit"));
|
37
37
|
const type_1 = require("./type");
|
38
38
|
const buffer_1 = require("buffer");
|
39
39
|
const constants_1 = require("./constants");
|
40
|
+
const helper_1 = require("./helper");
|
40
41
|
const _1 = require(".");
|
41
42
|
const getFallbackFontName = (font) => {
|
42
43
|
const initial = '';
|
@@ -84,7 +85,7 @@ const checkFont = (arg) => {
|
|
84
85
|
exports.checkFont = checkFont;
|
85
86
|
const getFontAlignmentValue = (fontKitFont, fontSize) => {
|
86
87
|
const { ascent, descent, unitsPerEm } = fontKitFont;
|
87
|
-
const fontSizeInPx = fontSize * constants_1.
|
88
|
+
const fontSizeInPx = fontSize * constants_1.PT_TO_PX_RATIO;
|
88
89
|
// Convert ascent and descent to px values
|
89
90
|
const ascentInPixels = (ascent / unitsPerEm) * fontSizeInPx;
|
90
91
|
const descentInPixels = (descent / unitsPerEm) * fontSizeInPx;
|
@@ -104,29 +105,17 @@ const heightOfFontAtSize = (fontKitFont, fontSize) => {
|
|
104
105
|
return (height / 1000) * fontSize;
|
105
106
|
};
|
106
107
|
exports.heightOfFontAtSize = heightOfFontAtSize;
|
107
|
-
const widthOfTextAtSize = (input, fontKitFont, fontSize) => {
|
108
|
-
const { glyphs } = fontKitFont.layout(input);
|
109
|
-
const scale = 1000 / fontKitFont.unitsPerEm;
|
110
|
-
return glyphs.reduce((totalWidth, glyph) => totalWidth + glyph.advanceWidth * scale, 0) * (fontSize / 1000);
|
111
|
-
};
|
112
108
|
const calculateCharacterSpacing = (textContent, textCharacterSpacing) => {
|
113
|
-
|
114
|
-
return (numberOfCharacters - 1) * textCharacterSpacing;
|
109
|
+
return (textContent.length - 1) * textCharacterSpacing;
|
115
110
|
};
|
116
|
-
const
|
117
|
-
const
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
const lineWidth = calculateTextWidthInMm(line, textWidth, characterSpacingCount);
|
123
|
-
if (lineWidth > maxLineWidth) {
|
124
|
-
longestLine = line;
|
125
|
-
maxLineWidth = lineWidth;
|
126
|
-
}
|
127
|
-
});
|
128
|
-
return longestLine;
|
111
|
+
const widthOfTextAtSize = (text, fontKitFont, fontSize, characterSpacing) => {
|
112
|
+
const { glyphs } = fontKitFont.layout(text);
|
113
|
+
const scale = 1000 / fontKitFont.unitsPerEm;
|
114
|
+
const standardWidth = glyphs.reduce((totalWidth, glyph) => totalWidth + glyph.advanceWidth * scale, 0) *
|
115
|
+
(fontSize / 1000);
|
116
|
+
return standardWidth + calculateCharacterSpacing(text, characterSpacing);
|
129
117
|
};
|
118
|
+
exports.widthOfTextAtSize = widthOfTextAtSize;
|
130
119
|
const fontKitFontCache = {};
|
131
120
|
const getFontKitFont = (textSchema, font) => __awaiter(void 0, void 0, void 0, function* () {
|
132
121
|
const fontName = textSchema.fontName || (0, exports.getFallbackFontName)(font);
|
@@ -143,28 +132,148 @@ const getFontKitFont = (textSchema, font) => __awaiter(void 0, void 0, void 0, f
|
|
143
132
|
return fontKitFont;
|
144
133
|
});
|
145
134
|
exports.getFontKitFont = getFontKitFont;
|
146
|
-
const
|
147
|
-
const
|
148
|
-
|
135
|
+
const isTextExceedingBoxWidth = (text, calcValues) => {
|
136
|
+
const { font, fontSize, characterSpacing, boxWidthInPt } = calcValues;
|
137
|
+
const textWidth = (0, exports.widthOfTextAtSize)(text, font, fontSize, characterSpacing);
|
138
|
+
return textWidth > boxWidthInPt;
|
149
139
|
};
|
150
|
-
|
151
|
-
|
152
|
-
|
140
|
+
/**
|
141
|
+
* Incrementally checks the current line for its real length
|
142
|
+
* and returns the position where it exceeds the box width.
|
143
|
+
* Returns `null` to indicate if textLine is shorter than the available box.
|
144
|
+
*/
|
145
|
+
const getOverPosition = (textLine, calcValues) => {
|
146
|
+
for (let i = 0; i <= textLine.length; i++) {
|
147
|
+
if (isTextExceedingBoxWidth(textLine.slice(0, i + 1), calcValues)) {
|
148
|
+
return i;
|
149
|
+
}
|
150
|
+
}
|
151
|
+
return null;
|
152
|
+
};
|
153
|
+
/**
|
154
|
+
* Gets the position of the split. Splits the exceeding line at
|
155
|
+
* the last whitespace prior to it exceeding the bounding box width.
|
156
|
+
*/
|
157
|
+
const getSplitPosition = (textLine, calcValues) => {
|
158
|
+
const overPos = getOverPosition(textLine, calcValues);
|
159
|
+
if (overPos === null)
|
160
|
+
return textLine.length; // input line is shorter than the available space
|
161
|
+
let overPosTmp = overPos;
|
162
|
+
while (textLine[overPosTmp] !== ' ' && overPosTmp >= 0) {
|
163
|
+
overPosTmp--;
|
164
|
+
}
|
165
|
+
// For very long lines with no whitespace use the original overPos
|
166
|
+
return overPosTmp > 0 ? overPosTmp : overPos;
|
167
|
+
};
|
168
|
+
/**
|
169
|
+
* Recursively splits the line at getSplitPosition.
|
170
|
+
* If there is some leftover, split the rest again in the same manner.
|
171
|
+
*/
|
172
|
+
const getSplittedLines = (textLine, calcValues) => {
|
173
|
+
const splitPos = getSplitPosition(textLine, calcValues);
|
174
|
+
const splittedLine = textLine.substring(0, splitPos);
|
175
|
+
const rest = textLine.substring(splitPos).trimStart();
|
176
|
+
if (rest === textLine) {
|
177
|
+
// if we went so small that we want to split on the first char
|
178
|
+
// then end recursion to avoid infinite loop
|
179
|
+
return [textLine];
|
180
|
+
}
|
181
|
+
if (rest.length === 0) {
|
182
|
+
// end recursion if there is no leftover
|
183
|
+
return [splittedLine];
|
184
|
+
}
|
185
|
+
return [splittedLine, ...(0, exports.getSplittedLines)(rest, calcValues)];
|
186
|
+
};
|
187
|
+
exports.getSplittedLines = getSplittedLines;
|
188
|
+
/**
|
189
|
+
* If using dynamic font size, iteratively increment or decrement the
|
190
|
+
* font size to fit the containing box.
|
191
|
+
* Calculating space usage involves splitting lines where they exceed
|
192
|
+
* the box width based on the proposed size.
|
193
|
+
*/
|
194
|
+
const calculateDynamicFontSize = ({ textSchema, font, input, startingFontSize, }) => __awaiter(void 0, void 0, void 0, function* () {
|
195
|
+
var _a;
|
196
|
+
const { fontSize: schemaFontSize, dynamicFontSize: dynamicFontSizeSetting, characterSpacing: schemaCharacterSpacing, width: boxWidth, height: boxHeight, lineHeight = constants_1.DEFAULT_LINE_HEIGHT, } = textSchema;
|
197
|
+
const fontSize = startingFontSize || schemaFontSize || constants_1.DEFAULT_FONT_SIZE;
|
153
198
|
if (!dynamicFontSizeSetting)
|
154
199
|
return fontSize;
|
155
|
-
|
200
|
+
if (dynamicFontSizeSetting.max < dynamicFontSizeSetting.min)
|
201
|
+
return fontSize;
|
202
|
+
const characterSpacing = schemaCharacterSpacing !== null && schemaCharacterSpacing !== void 0 ? schemaCharacterSpacing : constants_1.DEFAULT_CHARACTER_SPACING;
|
156
203
|
const fontKitFont = yield (0, exports.getFontKitFont)(textSchema, font);
|
157
|
-
const
|
158
|
-
const textWidth = widthOfTextAtSize(textContent, fontKitFont, fontSize);
|
204
|
+
const textContentRows = input.split('\n');
|
159
205
|
let dynamicFontSize = fontSize;
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
206
|
+
if (dynamicFontSize < dynamicFontSizeSetting.min) {
|
207
|
+
dynamicFontSize = dynamicFontSizeSetting.min;
|
208
|
+
}
|
209
|
+
else if (dynamicFontSize > dynamicFontSizeSetting.max) {
|
210
|
+
dynamicFontSize = dynamicFontSizeSetting.max;
|
211
|
+
}
|
212
|
+
const dynamicFontFit = (_a = dynamicFontSizeSetting.fit) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_DYNAMIC_FIT;
|
213
|
+
const calculateConstraints = (size) => {
|
214
|
+
let totalWidthInMm = 0;
|
215
|
+
let totalHeightInMm = 0;
|
216
|
+
const boxWidthInPt = (0, helper_1.mm2pt)(boxWidth);
|
217
|
+
const textHeight = (0, exports.heightOfFontAtSize)(fontKitFont, size);
|
218
|
+
const textHeightInMm = (0, helper_1.pt2mm)(textHeight * lineHeight);
|
219
|
+
textContentRows.forEach((paragraph) => {
|
220
|
+
const lines = (0, exports.getSplittedLines)(paragraph, {
|
221
|
+
font: fontKitFont,
|
222
|
+
fontSize: size,
|
223
|
+
characterSpacing,
|
224
|
+
boxWidthInPt,
|
225
|
+
});
|
226
|
+
lines.forEach((line) => {
|
227
|
+
if (dynamicFontFit === constants_1.DYNAMIC_FIT_VERTICAL) {
|
228
|
+
// For vertical fit we want to consider the width of text lines where we detect a split
|
229
|
+
const textWidth = (0, exports.widthOfTextAtSize)(line, fontKitFont, size, characterSpacing);
|
230
|
+
const textWidthInMm = (0, helper_1.pt2mm)(textWidth);
|
231
|
+
totalWidthInMm = Math.max(totalWidthInMm, textWidthInMm);
|
232
|
+
}
|
233
|
+
totalHeightInMm += textHeightInMm;
|
234
|
+
});
|
235
|
+
if (dynamicFontFit === constants_1.DYNAMIC_FIT_HORIZONTAL) {
|
236
|
+
// For horizontal fit we want to consider the line's width 'unsplit'
|
237
|
+
const textWidth = (0, exports.widthOfTextAtSize)(paragraph, fontKitFont, size, characterSpacing);
|
238
|
+
const textWidthInMm = (0, helper_1.pt2mm)(textWidth);
|
239
|
+
totalWidthInMm = Math.max(totalWidthInMm, textWidthInMm);
|
240
|
+
}
|
241
|
+
});
|
242
|
+
return { totalWidthInMm, totalHeightInMm };
|
243
|
+
};
|
244
|
+
const shouldFontGrowToFit = (totalWidthInMm, totalHeightInMm) => {
|
245
|
+
if (dynamicFontSize >= dynamicFontSizeSetting.max) {
|
246
|
+
return false;
|
247
|
+
}
|
248
|
+
if (dynamicFontFit === constants_1.DYNAMIC_FIT_HORIZONTAL) {
|
249
|
+
return totalWidthInMm < boxWidth;
|
250
|
+
}
|
251
|
+
return totalHeightInMm < boxHeight;
|
252
|
+
};
|
253
|
+
const shouldFontShrinkToFit = (totalWidthInMm, totalHeightInMm) => {
|
254
|
+
if (dynamicFontSize <= dynamicFontSizeSetting.min || dynamicFontSize <= 0) {
|
255
|
+
return false;
|
256
|
+
}
|
257
|
+
return totalWidthInMm > boxWidth || totalHeightInMm > boxHeight;
|
258
|
+
};
|
259
|
+
let { totalWidthInMm, totalHeightInMm } = calculateConstraints(dynamicFontSize);
|
260
|
+
// Attempt to increase the font size up to desired fit
|
261
|
+
while (shouldFontGrowToFit(totalWidthInMm, totalHeightInMm)) {
|
262
|
+
dynamicFontSize += constants_1.FONT_SIZE_ADJUSTMENT;
|
263
|
+
const { totalWidthInMm: newWidth, totalHeightInMm: newHeight } = calculateConstraints(dynamicFontSize);
|
264
|
+
if (newHeight < boxHeight) {
|
265
|
+
totalWidthInMm = newWidth;
|
266
|
+
totalHeightInMm = newHeight;
|
267
|
+
}
|
268
|
+
else {
|
269
|
+
dynamicFontSize -= constants_1.FONT_SIZE_ADJUSTMENT;
|
270
|
+
break;
|
271
|
+
}
|
164
272
|
}
|
165
|
-
|
166
|
-
|
167
|
-
|
273
|
+
// Attempt to decrease the font size down to desired fit
|
274
|
+
while (shouldFontShrinkToFit(totalWidthInMm, totalHeightInMm)) {
|
275
|
+
dynamicFontSize -= constants_1.FONT_SIZE_ADJUSTMENT;
|
276
|
+
({ totalWidthInMm, totalHeightInMm } = calculateConstraints(dynamicFontSize));
|
168
277
|
}
|
169
278
|
return dynamicFontSize;
|
170
279
|
});
|
package/dist/cjs/src/font.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"font.js","sourceRoot":"","sources":["../../../src/font.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AAEnC,iCAA0E;AAC1E,mCAAgC;AAChC,
|
1
|
+
{"version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C,EAAE;QAC7D,eAAe,IAAI,gCAAoB,CAAC;QACxC,CAAC,EAAE,cAAc,EAAE,eAAe,EAAE,GAAG,oBAAoB,CAAC,eAAe,CAAC,CAAC,CAAC;KAC/E;IAED,OAAO,eAAe,CAAC;AACzB,CAAC,CAAA,CAAC;AA/GW,QAAA,wBAAwB,4BA+GnC"}
|
package/dist/cjs/src/helper.js
CHANGED
@@ -1,10 +1,19 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.validateBarcodeInput = exports.checkGenerateProps = exports.checkDesignerProps = exports.checkPreviewProps = exports.checkUIProps = exports.checkTemplate = exports.checkUIOptions = exports.checkInputs = exports.b64toUint8Array = exports.getB64BasePdf = void 0;
|
3
|
+
exports.validateBarcodeInput = exports.checkGenerateProps = exports.checkDesignerProps = exports.checkPreviewProps = exports.checkUIProps = exports.checkTemplate = exports.checkUIOptions = exports.checkInputs = exports.b64toUint8Array = exports.getB64BasePdf = exports.pt2mm = exports.mm2pt = void 0;
|
4
4
|
const zod_1 = require("zod");
|
5
5
|
const buffer_1 = require("buffer");
|
6
6
|
const schema_1 = require("./schema");
|
7
|
+
const constants_1 = require("./constants");
|
7
8
|
const font_1 = require("./font");
|
9
|
+
const mm2pt = (mm) => {
|
10
|
+
return parseFloat(String(mm)) * constants_1.MM_TO_PT_RATIO;
|
11
|
+
};
|
12
|
+
exports.mm2pt = mm2pt;
|
13
|
+
const pt2mm = (pt) => {
|
14
|
+
return pt * constants_1.PT_TO_MM_RATIO;
|
15
|
+
};
|
16
|
+
exports.pt2mm = pt2mm;
|
8
17
|
const blob2Base64Pdf = (blob) => {
|
9
18
|
return new Promise((resolve, reject) => {
|
10
19
|
const reader = new FileReader();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/helper.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,mCAAgC;AAEhC,qCAQkB;AAClB,
|
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C,CAAC;AAjFW,QAAA,oBAAoB,wBAiF/B"}
|
package/dist/cjs/src/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.calculateDynamicFontSize = exports.validateBarcodeInput = exports.checkGenerateProps = exports.checkDesignerProps = exports.checkPreviewProps = exports.checkUIProps = exports.checkTemplate = exports.checkUIOptions = exports.checkInputs = exports.getFontAlignmentValue = exports.getFontKitFont = exports.checkFont = exports.heightOfFontAtSize = exports.getDefaultFont = exports.getFallbackFontName = exports.b64toUint8Array = exports.getB64BasePdf = exports.isBarcodeSchema = exports.isImageSchema = exports.isTextSchema = exports.schemaTypes = exports.DEFAULT_FONT_VALUE = exports.BLANK_PDF = exports.
|
3
|
+
exports.calculateDynamicFontSize = exports.validateBarcodeInput = exports.checkGenerateProps = exports.checkDesignerProps = exports.checkPreviewProps = exports.checkUIProps = exports.checkTemplate = exports.checkUIOptions = exports.checkInputs = exports.getFontAlignmentValue = exports.getFontKitFont = exports.checkFont = exports.mm2pt = exports.widthOfTextAtSize = exports.heightOfFontAtSize = exports.getSplittedLines = exports.getDefaultFont = exports.getFallbackFontName = exports.b64toUint8Array = exports.getB64BasePdf = exports.isBarcodeSchema = exports.isImageSchema = exports.isTextSchema = exports.schemaTypes = exports.DEFAULT_FONT_VALUE = exports.BLANK_PDF = exports.PT_TO_PX_RATIO = exports.PT_TO_MM_RATIO = exports.MM_TO_PT_RATIO = exports.FONT_SIZE_ADJUSTMENT = exports.DEFAULT_DYNAMIC_FIT = exports.DYNAMIC_FIT_HORIZONTAL = exports.DYNAMIC_FIT_VERTICAL = exports.DEFAULT_FONT_COLOR = exports.DEFAULT_CHARACTER_SPACING = exports.DEFAULT_LINE_HEIGHT = exports.DEFAULT_ALIGNMENT = exports.DEFAULT_FONT_SIZE = exports.DEFAULT_FONT_NAME = void 0;
|
4
4
|
const constants_js_1 = require("./constants.js");
|
5
5
|
Object.defineProperty(exports, "DEFAULT_FONT_NAME", { enumerable: true, get: function () { return constants_js_1.DEFAULT_FONT_NAME; } });
|
6
6
|
Object.defineProperty(exports, "DEFAULT_FONT_SIZE", { enumerable: true, get: function () { return constants_js_1.DEFAULT_FONT_SIZE; } });
|
@@ -8,10 +8,13 @@ Object.defineProperty(exports, "DEFAULT_ALIGNMENT", { enumerable: true, get: fun
|
|
8
8
|
Object.defineProperty(exports, "DEFAULT_LINE_HEIGHT", { enumerable: true, get: function () { return constants_js_1.DEFAULT_LINE_HEIGHT; } });
|
9
9
|
Object.defineProperty(exports, "DEFAULT_CHARACTER_SPACING", { enumerable: true, get: function () { return constants_js_1.DEFAULT_CHARACTER_SPACING; } });
|
10
10
|
Object.defineProperty(exports, "DEFAULT_FONT_COLOR", { enumerable: true, get: function () { return constants_js_1.DEFAULT_FONT_COLOR; } });
|
11
|
-
Object.defineProperty(exports, "
|
12
|
-
Object.defineProperty(exports, "
|
13
|
-
Object.defineProperty(exports, "
|
14
|
-
Object.defineProperty(exports, "
|
11
|
+
Object.defineProperty(exports, "DYNAMIC_FIT_VERTICAL", { enumerable: true, get: function () { return constants_js_1.DYNAMIC_FIT_VERTICAL; } });
|
12
|
+
Object.defineProperty(exports, "DYNAMIC_FIT_HORIZONTAL", { enumerable: true, get: function () { return constants_js_1.DYNAMIC_FIT_HORIZONTAL; } });
|
13
|
+
Object.defineProperty(exports, "DEFAULT_DYNAMIC_FIT", { enumerable: true, get: function () { return constants_js_1.DEFAULT_DYNAMIC_FIT; } });
|
14
|
+
Object.defineProperty(exports, "FONT_SIZE_ADJUSTMENT", { enumerable: true, get: function () { return constants_js_1.FONT_SIZE_ADJUSTMENT; } });
|
15
|
+
Object.defineProperty(exports, "MM_TO_PT_RATIO", { enumerable: true, get: function () { return constants_js_1.MM_TO_PT_RATIO; } });
|
16
|
+
Object.defineProperty(exports, "PT_TO_MM_RATIO", { enumerable: true, get: function () { return constants_js_1.PT_TO_MM_RATIO; } });
|
17
|
+
Object.defineProperty(exports, "PT_TO_PX_RATIO", { enumerable: true, get: function () { return constants_js_1.PT_TO_PX_RATIO; } });
|
15
18
|
Object.defineProperty(exports, "BLANK_PDF", { enumerable: true, get: function () { return constants_js_1.BLANK_PDF; } });
|
16
19
|
Object.defineProperty(exports, "DEFAULT_FONT_VALUE", { enumerable: true, get: function () { return constants_js_1.DEFAULT_FONT_VALUE; } });
|
17
20
|
const type_js_1 = require("./type.js");
|
@@ -29,13 +32,16 @@ Object.defineProperty(exports, "checkUIProps", { enumerable: true, get: function
|
|
29
32
|
Object.defineProperty(exports, "checkPreviewProps", { enumerable: true, get: function () { return helper_js_1.checkPreviewProps; } });
|
30
33
|
Object.defineProperty(exports, "checkDesignerProps", { enumerable: true, get: function () { return helper_js_1.checkDesignerProps; } });
|
31
34
|
Object.defineProperty(exports, "checkGenerateProps", { enumerable: true, get: function () { return helper_js_1.checkGenerateProps; } });
|
35
|
+
Object.defineProperty(exports, "mm2pt", { enumerable: true, get: function () { return helper_js_1.mm2pt; } });
|
32
36
|
Object.defineProperty(exports, "validateBarcodeInput", { enumerable: true, get: function () { return helper_js_1.validateBarcodeInput; } });
|
33
37
|
const font_js_1 = require("./font.js");
|
34
38
|
Object.defineProperty(exports, "calculateDynamicFontSize", { enumerable: true, get: function () { return font_js_1.calculateDynamicFontSize; } });
|
35
39
|
Object.defineProperty(exports, "getFallbackFontName", { enumerable: true, get: function () { return font_js_1.getFallbackFontName; } });
|
36
40
|
Object.defineProperty(exports, "getDefaultFont", { enumerable: true, get: function () { return font_js_1.getDefaultFont; } });
|
37
41
|
Object.defineProperty(exports, "heightOfFontAtSize", { enumerable: true, get: function () { return font_js_1.heightOfFontAtSize; } });
|
42
|
+
Object.defineProperty(exports, "widthOfTextAtSize", { enumerable: true, get: function () { return font_js_1.widthOfTextAtSize; } });
|
38
43
|
Object.defineProperty(exports, "checkFont", { enumerable: true, get: function () { return font_js_1.checkFont; } });
|
39
44
|
Object.defineProperty(exports, "getFontKitFont", { enumerable: true, get: function () { return font_js_1.getFontKitFont; } });
|
40
45
|
Object.defineProperty(exports, "getFontAlignmentValue", { enumerable: true, get: function () { return font_js_1.getFontAlignmentValue; } });
|
46
|
+
Object.defineProperty(exports, "getSplittedLines", { enumerable: true, get: function () { return font_js_1.getSplittedLines; } });
|
41
47
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAgBwB;AAsDtB,kGArEA,gCAAiB,OAqEA;AACjB,kGArEA,gCAAiB,OAqEA;AACjB,kGArEA,gCAAiB,OAqEA;AACjB,oGArEA,kCAAmB,OAqEA;AACnB,0GArEA,wCAAyB,OAqEA;AACzB,mGArEA,iCAAkB,OAqEA;AAClB,qGArEA,mCAAoB,OAqEA;AACpB,uGArEA,qCAAsB,OAqEA;AACtB,oGArEA,kCAAmB,OAqEA;AACnB,qGArEA,mCAAoB,OAqEA;AACpB,+FArEA,6BAAc,OAqEA;AACd,+FArEA,6BAAc,OAqEA;AACd,+FArEA,6BAAc,OAqEA;AACd,0FArEA,wBAAS,OAqEA;AACT,mGArEA,iCAAkB,OAqEA;AAnEpB,uCAAsF;AAoEpF,4FApEO,qBAAW,OAoEP;AAEX,8FAtEoB,uBAAa,OAsEpB;AACb,gGAvEmC,yBAAe,OAuEnC;AAFf,6FArEoD,sBAAY,OAqEpD;AA3Cd,2CAYqB;AAkCnB,8FA7CA,yBAAa,OA6CA;AACb,gGA7CA,2BAAe,OA6CA;AAUf,4FAtDA,uBAAW,OAsDA;AACX,+FAtDA,0BAAc,OAsDA;AACd,8FAtDA,yBAAa,OAsDA;AACb,6FAtDA,wBAAY,OAsDA;AACZ,kGAtDA,6BAAiB,OAsDA;AACjB,mGAtDA,8BAAkB,OAsDA;AAClB,mGAtDA,8BAAkB,OAsDA;AAVlB,sFA3CA,iBAAK,OA2CA;AAWL,qGArDA,gCAAoB,OAqDA;AAnDtB,uCAWmB;AAyCjB,yGAnDA,kCAAwB,OAmDA;AAjBxB,oGAjCA,6BAAmB,OAiCA;AACnB,+FAjCA,wBAAc,OAiCA;AAEd,mGAlCA,4BAAkB,OAkCA;AAClB,kGAlCA,2BAAiB,OAkCA;AAEjB,0FAnCA,mBAAS,OAmCA;AACT,+FAnCA,wBAAc,OAmCA;AACd,sGAnCA,+BAAqB,OAmCA;AANrB,iGA5BA,0BAAgB,OA4BA"}
|
package/dist/cjs/src/schema.js
CHANGED
@@ -33,6 +33,7 @@ exports.TextSchema = exports.CommonSchema.extend({
|
|
33
33
|
dynamicFontSize: zod_1.z.object({
|
34
34
|
max: zod_1.z.number(),
|
35
35
|
min: zod_1.z.number(),
|
36
|
+
fit: zod_1.z.string().optional(),
|
36
37
|
}).optional(),
|
37
38
|
});
|
38
39
|
exports.ImageSchema = exports.CommonSchema.extend({ type: zod_1.z.literal(exports.SchemaType.Enum.image) });
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/schema.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,6BAAwB;AAExB,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AACzC,QAAA,IAAI,GAAG,OAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAErB,QAAA,IAAI,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAExE,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AAC3C,QAAA,SAAS,GAAG,OAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAE5C,k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