@pdfme/schemas 6.0.3 → 6.0.5-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/dist/barcodes/constants.d.ts +4 -0
  2. package/dist/barcodes/helper.d.ts +21 -0
  3. package/dist/barcodes/index.d.ts +4 -0
  4. package/dist/barcodes/pdfRender.d.ts +3 -0
  5. package/dist/barcodes/propPanel.d.ts +3 -0
  6. package/{src/barcodes/types.ts → dist/barcodes/types.d.ts} +5 -7
  7. package/dist/barcodes/uiRender.d.ts +3 -0
  8. package/dist/builtins-CgaZ0UX3.js +613 -0
  9. package/dist/builtins-CgaZ0UX3.js.map +1 -0
  10. package/dist/builtins.d.ts +4 -0
  11. package/dist/builtins.js +2 -0
  12. package/dist/checkbox/index.d.ts +6 -0
  13. package/dist/constants.d.ts +2 -0
  14. package/dist/date/date.d.ts +2 -0
  15. package/dist/date/dateTime.d.ts +2 -0
  16. package/dist/date/helper.d.ts +20 -0
  17. package/dist/date/time.d.ts +2 -0
  18. package/dist/date/types.d.ts +17 -0
  19. package/dist/dynamicTemplate-D_DHR3-X.js +1128 -0
  20. package/dist/dynamicTemplate-D_DHR3-X.js.map +1 -0
  21. package/dist/graphics/image.d.ts +5 -0
  22. package/dist/graphics/imagehelper.d.ts +4 -0
  23. package/dist/graphics/signature.d.ts +4 -0
  24. package/dist/graphics/svg.d.ts +4 -0
  25. package/{src/index.ts → dist/index.d.ts} +1 -22
  26. package/dist/index.js +5383 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/multiVariableText/helper.d.ts +3 -0
  29. package/dist/multiVariableText/index.d.ts +4 -0
  30. package/dist/multiVariableText/pdfRender.d.ts +3 -0
  31. package/dist/multiVariableText/propPanel.d.ts +3 -0
  32. package/{src/multiVariableText/types.ts → dist/multiVariableText/types.d.ts} +2 -3
  33. package/dist/multiVariableText/uiRender.d.ts +3 -0
  34. package/dist/multiVariableText/variables.d.ts +10 -0
  35. package/dist/radioGroup/index.d.ts +7 -0
  36. package/dist/sanitize.d.ts +1 -0
  37. package/dist/select/index.d.ts +7 -0
  38. package/dist/shapes/line.d.ts +6 -0
  39. package/dist/shapes/rectAndEllipse.d.ts +11 -0
  40. package/dist/tables/cell.d.ts +4 -0
  41. package/dist/tables/classes.d.ts +69 -0
  42. package/dist/tables/dynamicTemplate.d.ts +7 -0
  43. package/dist/tables/helper.d.ts +265 -0
  44. package/dist/tables/index.d.ts +4 -0
  45. package/dist/tables/pdfRender.d.ts +3 -0
  46. package/dist/tables/propPanel.d.ts +3 -0
  47. package/dist/tables/tableHelper.d.ts +10 -0
  48. package/dist/tables/types.d.ts +88 -0
  49. package/dist/tables/uiRender.d.ts +3 -0
  50. package/dist/tables.js +2 -0
  51. package/dist/text/constants.d.ts +23 -0
  52. package/dist/text/extraFormatter.d.ts +25 -0
  53. package/dist/text/helper.d.ts +40 -0
  54. package/dist/text/icons/index.d.ts +9 -0
  55. package/dist/text/index.d.ts +4 -0
  56. package/dist/text/pdfRender.d.ts +3 -0
  57. package/dist/text/propPanel.d.ts +3 -0
  58. package/dist/text/types.d.ts +28 -0
  59. package/dist/text/uiRender.d.ts +11 -0
  60. package/dist/utils.d.ts +40 -0
  61. package/dist/utils.js +215 -0
  62. package/dist/utils.js.map +1 -0
  63. package/package.json +5 -1
  64. package/src/barcodes/constants.ts +0 -20
  65. package/src/barcodes/helper.ts +0 -187
  66. package/src/barcodes/index.ts +0 -23
  67. package/src/barcodes/pdfRender.ts +0 -37
  68. package/src/barcodes/propPanel.ts +0 -249
  69. package/src/barcodes/uiRender.ts +0 -94
  70. package/src/builtins.ts +0 -8
  71. package/src/checkbox/index.ts +0 -70
  72. package/src/constants.ts +0 -2
  73. package/src/date/date.ts +0 -9
  74. package/src/date/dateTime.ts +0 -9
  75. package/src/date/helper.ts +0 -544
  76. package/src/date/time.ts +0 -9
  77. package/src/date/types.ts +0 -19
  78. package/src/graphics/image.ts +0 -201
  79. package/src/graphics/imagehelper.ts +0 -156
  80. package/src/graphics/signature.ts +0 -136
  81. package/src/graphics/svg.ts +0 -121
  82. package/src/multiVariableText/helper.ts +0 -65
  83. package/src/multiVariableText/index.ts +0 -16
  84. package/src/multiVariableText/pdfRender.ts +0 -21
  85. package/src/multiVariableText/propPanel.ts +0 -169
  86. package/src/multiVariableText/uiRender.ts +0 -157
  87. package/src/multiVariableText/variables.ts +0 -63
  88. package/src/radioGroup/index.ts +0 -115
  89. package/src/sanitize.ts +0 -50
  90. package/src/select/index.ts +0 -205
  91. package/src/shapes/line.ts +0 -94
  92. package/src/shapes/rectAndEllipse.ts +0 -152
  93. package/src/tables/cell.ts +0 -152
  94. package/src/tables/classes.ts +0 -402
  95. package/src/tables/dynamicTemplate.ts +0 -88
  96. package/src/tables/helper.ts +0 -216
  97. package/src/tables/index.ts +0 -15
  98. package/src/tables/pdfRender.ts +0 -144
  99. package/src/tables/propPanel.ts +0 -111
  100. package/src/tables/tableHelper.ts +0 -289
  101. package/src/tables/types.ts +0 -87
  102. package/src/tables/uiRender.ts +0 -436
  103. package/src/text/constants.ts +0 -104
  104. package/src/text/extraFormatter.ts +0 -83
  105. package/src/text/helper.ts +0 -573
  106. package/src/text/icons/index.ts +0 -30
  107. package/src/text/index.ts +0 -16
  108. package/src/text/pdfRender.ts +0 -240
  109. package/src/text/propPanel.ts +0 -184
  110. package/src/text/types.ts +0 -30
  111. package/src/text/uiRender.ts +0 -292
  112. package/src/utils.ts +0 -354
  113. package/tsconfig.build.json +0 -14
  114. package/tsconfig.json +0 -16
  115. package/vite.config.mts +0 -51
  116. /package/{src/tables.ts → dist/tables.d.ts} +0 -0
@@ -1,240 +0,0 @@
1
- import { PDFFont, PDFDocument } from '@pdfme/pdf-lib';
2
- import type { Font as FontKitFont } from 'fontkit';
3
- import type { TextSchema } from './types.js';
4
- import {
5
- PDFRenderProps,
6
- ColorType,
7
- Font,
8
- getDefaultFont,
9
- getFallbackFontName,
10
- mm2pt,
11
- } from '@pdfme/common';
12
- import {
13
- VERTICAL_ALIGN_TOP,
14
- VERTICAL_ALIGN_MIDDLE,
15
- VERTICAL_ALIGN_BOTTOM,
16
- DEFAULT_FONT_SIZE,
17
- DEFAULT_ALIGNMENT,
18
- DEFAULT_VERTICAL_ALIGNMENT,
19
- DEFAULT_LINE_HEIGHT,
20
- DEFAULT_CHARACTER_SPACING,
21
- DEFAULT_FONT_COLOR,
22
- } from './constants.js';
23
- import {
24
- calculateDynamicFontSize,
25
- heightOfFontAtSize,
26
- getFontDescentInPt,
27
- getFontKitFont,
28
- fetchRemoteFontData,
29
- widthOfTextAtSize,
30
- splitTextToSize,
31
- } from './helper.js';
32
- import { convertForPdfLayoutProps, rotatePoint, hex2PrintingColor } from '../utils.js';
33
-
34
- const embedAndGetFontObj = async (arg: {
35
- pdfDoc: PDFDocument;
36
- font: Font;
37
- _cache: Map<PDFDocument, { [key: string]: PDFFont }>;
38
- }) => {
39
- const { pdfDoc, font, _cache } = arg;
40
- if (_cache.has(pdfDoc)) {
41
- return _cache.get(pdfDoc) as { [key: string]: PDFFont };
42
- }
43
-
44
- const fontValues = await Promise.all(
45
- Object.values(font).map(async (v) => {
46
- let fontData = v.data;
47
- if (typeof fontData === 'string' && fontData.startsWith('http')) {
48
- fontData = await fetchRemoteFontData(fontData);
49
- }
50
- return pdfDoc.embedFont(fontData, {
51
- subset: typeof v.subset === 'undefined' ? true : v.subset,
52
- });
53
- }),
54
- );
55
-
56
- const fontObj = Object.keys(font).reduce(
57
- (acc, cur, i) => Object.assign(acc, { [cur]: fontValues[i] }),
58
- {} as { [key: string]: PDFFont },
59
- );
60
-
61
- _cache.set(pdfDoc, fontObj);
62
- return fontObj;
63
- };
64
-
65
- const getFontProp = ({
66
- value,
67
- fontKitFont,
68
- schema,
69
- colorType,
70
- }: {
71
- value: string;
72
- fontKitFont: FontKitFont;
73
- colorType?: ColorType;
74
- schema: TextSchema;
75
- }) => {
76
- const fontSize = schema.dynamicFontSize
77
- ? calculateDynamicFontSize({ textSchema: schema, fontKitFont, value })
78
- : (schema.fontSize ?? DEFAULT_FONT_SIZE);
79
- const color = hex2PrintingColor(schema.fontColor || DEFAULT_FONT_COLOR, colorType);
80
-
81
- return {
82
- alignment: schema.alignment ?? DEFAULT_ALIGNMENT,
83
- verticalAlignment: schema.verticalAlignment ?? DEFAULT_VERTICAL_ALIGNMENT,
84
- lineHeight: schema.lineHeight ?? DEFAULT_LINE_HEIGHT,
85
- characterSpacing: schema.characterSpacing ?? DEFAULT_CHARACTER_SPACING,
86
- fontSize,
87
- color,
88
- };
89
- };
90
-
91
- export const pdfRender = async (arg: PDFRenderProps<TextSchema>) => {
92
- const { value, pdfDoc, pdfLib, page, options, schema, _cache } = arg;
93
- if (!value) return;
94
-
95
- const { font = getDefaultFont(), colorType } = options;
96
-
97
- const [pdfFontObj, fontKitFont] = await Promise.all([
98
- embedAndGetFontObj({
99
- pdfDoc,
100
- font,
101
- _cache: _cache as unknown as Map<PDFDocument, { [key: string]: PDFFont }>,
102
- }),
103
- getFontKitFont(schema.fontName, font, _cache as Map<string, FontKitFont>),
104
- ]);
105
- const fontProp = getFontProp({ value, fontKitFont, schema, colorType });
106
-
107
- const { fontSize, color, alignment, verticalAlignment, lineHeight, characterSpacing } = fontProp;
108
-
109
- const fontName = (
110
- schema.fontName ? schema.fontName : getFallbackFontName(font)
111
- ) as keyof typeof pdfFontObj;
112
- const pdfFontValue = pdfFontObj && pdfFontObj[fontName];
113
-
114
- const pageHeight = page.getHeight();
115
- const {
116
- width,
117
- height,
118
- rotate,
119
- position: { x, y },
120
- opacity,
121
- } = convertForPdfLayoutProps({ schema, pageHeight, applyRotateTranslate: false });
122
-
123
- const pivotPoint = { x: x + width / 2, y: pageHeight - mm2pt(schema.position.y) - height / 2 };
124
-
125
- if (schema.backgroundColor) {
126
- const color = hex2PrintingColor(schema.backgroundColor, colorType);
127
- if (rotate.angle !== 0) {
128
- // Apply the same rotation logic as text rendering to match UI behavior
129
- const rotatedPoint = rotatePoint({ x, y }, pivotPoint, rotate.angle);
130
- page.drawRectangle({ x: rotatedPoint.x, y: rotatedPoint.y, width, height, rotate, color });
131
- } else {
132
- page.drawRectangle({ x, y, width, height, rotate, color });
133
- }
134
- }
135
-
136
- const firstLineTextHeight = heightOfFontAtSize(fontKitFont, fontSize);
137
- const descent = getFontDescentInPt(fontKitFont, fontSize);
138
- const halfLineHeightAdjustment = lineHeight === 0 ? 0 : ((lineHeight - 1) * fontSize) / 2;
139
-
140
- const lines = splitTextToSize({
141
- value,
142
- characterSpacing,
143
- fontSize,
144
- fontKitFont,
145
- boxWidthInPt: width,
146
- });
147
-
148
- // Text lines are rendered from the bottom upwards, we need to adjust the position down
149
- let yOffset = 0;
150
- if (verticalAlignment === VERTICAL_ALIGN_TOP) {
151
- yOffset = firstLineTextHeight + halfLineHeightAdjustment;
152
- } else {
153
- const otherLinesHeight = lineHeight * fontSize * (lines.length - 1);
154
-
155
- if (verticalAlignment === VERTICAL_ALIGN_BOTTOM) {
156
- yOffset = height - otherLinesHeight + descent - halfLineHeightAdjustment;
157
- } else if (verticalAlignment === VERTICAL_ALIGN_MIDDLE) {
158
- yOffset =
159
- (height - otherLinesHeight - firstLineTextHeight + descent) / 2 + firstLineTextHeight;
160
- }
161
- }
162
-
163
- const segmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' });
164
-
165
- lines.forEach((line, rowIndex) => {
166
- const trimmed = line.replace('\n', '');
167
- const textWidth = widthOfTextAtSize(trimmed, fontKitFont, fontSize, characterSpacing);
168
- const textHeight = heightOfFontAtSize(fontKitFont, fontSize);
169
- const rowYOffset = lineHeight * fontSize * rowIndex;
170
-
171
- // Adobe Acrobat Reader shows an error if `drawText` is called with an empty text
172
- if (line === '') {
173
- // return; // this also works
174
- line = '\r\n';
175
- }
176
-
177
- let xLine = x;
178
- if (alignment === 'center') {
179
- xLine += (width - textWidth) / 2;
180
- } else if (alignment === 'right') {
181
- xLine += width - textWidth;
182
- }
183
-
184
- let yLine = pageHeight - mm2pt(schema.position.y) - yOffset - rowYOffset;
185
-
186
- // draw strikethrough
187
- if (schema.strikethrough && textWidth > 0) {
188
- const _x = xLine + textWidth + 1;
189
- const _y = yLine + textHeight / 3;
190
- page.drawLine({
191
- start: rotatePoint({ x: xLine, y: _y }, pivotPoint, rotate.angle),
192
- end: rotatePoint({ x: _x, y: _y }, pivotPoint, rotate.angle),
193
- thickness: (1 / 12) * fontSize,
194
- color: color,
195
- opacity,
196
- });
197
- }
198
-
199
- // draw underline
200
- if (schema.underline && textWidth > 0) {
201
- const _x = xLine + textWidth + 1;
202
- const _y = yLine - textHeight / 12;
203
- page.drawLine({
204
- start: rotatePoint({ x: xLine, y: _y }, pivotPoint, rotate.angle),
205
- end: rotatePoint({ x: _x, y: _y }, pivotPoint, rotate.angle),
206
- thickness: (1 / 12) * fontSize,
207
- color: color,
208
- opacity,
209
- });
210
- }
211
-
212
- if (rotate.angle !== 0) {
213
- // As we draw each line individually from different points, we must translate each lines position
214
- // relative to the UI rotation pivot point. see comments in convertForPdfLayoutProps() for more info.
215
- const rotatedPoint = rotatePoint({ x: xLine, y: yLine }, pivotPoint, rotate.angle);
216
- xLine = rotatedPoint.x;
217
- yLine = rotatedPoint.y;
218
- }
219
-
220
- let spacing = characterSpacing;
221
- if (alignment === 'justify' && line.slice(-1) !== '\n') {
222
- // if alignment is `justify` but the end of line is not newline, then adjust the spacing
223
- const iterator = segmenter.segment(trimmed)[Symbol.iterator]();
224
- const len = Array.from(iterator).length;
225
- spacing += (width - textWidth) / len;
226
- }
227
- page.pushOperators(pdfLib.setCharacterSpacing(spacing));
228
-
229
- page.drawText(trimmed, {
230
- x: xLine,
231
- y: yLine,
232
- rotate,
233
- size: fontSize,
234
- color,
235
- lineHeight: lineHeight * fontSize,
236
- font: pdfFontValue,
237
- opacity,
238
- });
239
- });
240
- };
@@ -1,184 +0,0 @@
1
- import {
2
- DEFAULT_FONT_NAME,
3
- PropPanel,
4
- PropPanelWidgetProps,
5
- PropPanelSchema,
6
- getFallbackFontName,
7
- } from '@pdfme/common';
8
- import type { TextSchema } from './types.js';
9
- import {
10
- DEFAULT_FONT_SIZE,
11
- DEFAULT_ALIGNMENT,
12
- DEFAULT_VERTICAL_ALIGNMENT,
13
- DEFAULT_CHARACTER_SPACING,
14
- DEFAULT_LINE_HEIGHT,
15
- DEFAULT_FONT_COLOR,
16
- DYNAMIC_FIT_VERTICAL,
17
- DYNAMIC_FIT_HORIZONTAL,
18
- DEFAULT_DYNAMIC_FIT,
19
- DEFAULT_DYNAMIC_MIN_FONT_SIZE,
20
- DEFAULT_DYNAMIC_MAX_FONT_SIZE,
21
- } from './constants.js';
22
- import { DEFAULT_OPACITY, HEX_COLOR_PATTERN } from '../constants.js';
23
- import { getExtraFormatterSchema } from './extraFormatter.js';
24
-
25
- const UseDynamicFontSize = (props: PropPanelWidgetProps) => {
26
- const { rootElement, changeSchemas, activeSchema, i18n } = props;
27
-
28
- const checkbox = document.createElement('input');
29
- checkbox.type = 'checkbox';
30
- checkbox.checked = Boolean((activeSchema as { dynamicFontSize?: unknown })?.dynamicFontSize);
31
- checkbox.onchange = (e: Event) => {
32
- const val = (e.target as HTMLInputElement).checked
33
- ? {
34
- min: DEFAULT_DYNAMIC_MIN_FONT_SIZE,
35
- max: DEFAULT_DYNAMIC_MAX_FONT_SIZE,
36
- fit: DEFAULT_DYNAMIC_FIT,
37
- }
38
- : undefined;
39
- changeSchemas([{ key: 'dynamicFontSize', value: val, schemaId: activeSchema.id }]);
40
- };
41
- const label = document.createElement('label');
42
- const span = document.createElement('span');
43
- span.innerText = i18n('schemas.text.dynamicFontSize') || '';
44
- span.style.cssText = 'margin-left: 0.5rem';
45
- label.style.cssText = 'display: flex; width: 100%;';
46
- label.appendChild(checkbox);
47
- label.appendChild(span);
48
- rootElement.appendChild(label);
49
- };
50
-
51
- export const propPanel: PropPanel<TextSchema> = {
52
- schema: ({ options, activeSchema, i18n }) => {
53
- const font = options.font || { [DEFAULT_FONT_NAME]: { data: '', fallback: true } };
54
- const fontNames = Object.keys(font);
55
- const fallbackFontName = getFallbackFontName(font);
56
-
57
- const enableDynamicFont = Boolean(
58
- (activeSchema as { dynamicFontSize?: unknown })?.dynamicFontSize,
59
- );
60
-
61
- const textSchema: Record<string, PropPanelSchema> = {
62
- fontName: {
63
- title: i18n('schemas.text.fontName'),
64
- type: 'string',
65
- widget: 'select',
66
- default: fallbackFontName,
67
- placeholder: fallbackFontName,
68
- props: { options: fontNames.map((name) => ({ label: name, value: name })) },
69
- span: 12,
70
- },
71
- fontSize: {
72
- title: i18n('schemas.text.size'),
73
- type: 'number',
74
- widget: 'inputNumber',
75
- span: 6,
76
- disabled: enableDynamicFont,
77
- props: { min: 0 },
78
- },
79
- characterSpacing: {
80
- title: i18n('schemas.text.spacing'),
81
- type: 'number',
82
- widget: 'inputNumber',
83
- span: 6,
84
- props: { min: 0 },
85
- },
86
- formatter: getExtraFormatterSchema(i18n),
87
- lineHeight: {
88
- title: i18n('schemas.text.lineHeight'),
89
- type: 'number',
90
- widget: 'inputNumber',
91
- props: { step: 0.1, min: 0 },
92
- span: 8,
93
- },
94
- useDynamicFontSize: { type: 'boolean', widget: 'UseDynamicFontSize', bind: false, span: 16 },
95
- dynamicFontSize: {
96
- type: 'object',
97
- widget: 'card',
98
- column: 3,
99
- properties: {
100
- min: {
101
- title: i18n('schemas.text.min'),
102
- type: 'number',
103
- widget: 'inputNumber',
104
- hidden: !enableDynamicFont,
105
- props: { min: 0 },
106
- },
107
- max: {
108
- title: i18n('schemas.text.max'),
109
- type: 'number',
110
- widget: 'inputNumber',
111
- hidden: !enableDynamicFont,
112
- props: { min: 0 },
113
- },
114
- fit: {
115
- title: i18n('schemas.text.fit'),
116
- type: 'string',
117
- widget: 'select',
118
- hidden: !enableDynamicFont,
119
- props: {
120
- options: [
121
- { label: i18n('schemas.horizontal'), value: DYNAMIC_FIT_HORIZONTAL },
122
- { label: i18n('schemas.vertical'), value: DYNAMIC_FIT_VERTICAL },
123
- ],
124
- },
125
- },
126
- },
127
- },
128
- fontColor: {
129
- title: i18n('schemas.textColor'),
130
- type: 'string',
131
- widget: 'color',
132
- props: {
133
- disabledAlpha: true,
134
- },
135
- rules: [
136
- {
137
- pattern: HEX_COLOR_PATTERN,
138
- message: i18n('validation.hexColor'),
139
- },
140
- ],
141
- },
142
- backgroundColor: {
143
- title: i18n('schemas.bgColor'),
144
- type: 'string',
145
- widget: 'color',
146
- props: {
147
- disabledAlpha: true,
148
- },
149
- rules: [
150
- {
151
- pattern: HEX_COLOR_PATTERN,
152
- message: i18n('validation.hexColor'),
153
- },
154
- ],
155
- },
156
- };
157
-
158
- return textSchema;
159
- },
160
- widgets: { UseDynamicFontSize },
161
- defaultSchema: {
162
- name: '',
163
- type: 'text',
164
- content: 'Type Something...',
165
- position: { x: 0, y: 0 },
166
- width: 45,
167
- height: 10,
168
- // If the value of "rotate" is set to undefined or not set at all, rotation will be disabled in the UI.
169
- // Check this document: https://pdfme.com//docs/custom-schemas#learning-how-to-create-from-pdfmeschemas-code
170
- rotate: 0,
171
- alignment: DEFAULT_ALIGNMENT,
172
- verticalAlignment: DEFAULT_VERTICAL_ALIGNMENT,
173
- fontSize: DEFAULT_FONT_SIZE,
174
- lineHeight: DEFAULT_LINE_HEIGHT,
175
- characterSpacing: DEFAULT_CHARACTER_SPACING,
176
- dynamicFontSize: undefined,
177
- fontColor: DEFAULT_FONT_COLOR,
178
- fontName: undefined,
179
- backgroundColor: '',
180
- opacity: DEFAULT_OPACITY,
181
- strikethrough: false,
182
- underline: false,
183
- },
184
- };
package/src/text/types.ts DELETED
@@ -1,30 +0,0 @@
1
- import type { Schema } from '@pdfme/common';
2
- import type { Font as FontKitFont } from 'fontkit';
3
-
4
- export type ALIGNMENT = 'left' | 'center' | 'right' | 'justify';
5
- export type VERTICAL_ALIGNMENT = 'top' | 'middle' | 'bottom';
6
- export type DYNAMIC_FONT_SIZE_FIT = 'horizontal' | 'vertical';
7
-
8
- export type FontWidthCalcValues = {
9
- font: FontKitFont;
10
- fontSize: number;
11
- characterSpacing: number;
12
- boxWidthInPt: number;
13
- };
14
- export type TextSchema = Schema & {
15
- fontName?: string;
16
- alignment: ALIGNMENT;
17
- verticalAlignment: VERTICAL_ALIGNMENT;
18
- fontSize: number;
19
- lineHeight: number;
20
- strikethrough?: boolean;
21
- underline?: boolean;
22
- characterSpacing: number;
23
- dynamicFontSize?: {
24
- min: number;
25
- max: number;
26
- fit: DYNAMIC_FONT_SIZE_FIT;
27
- };
28
- fontColor: string;
29
- backgroundColor: string;
30
- };