@pdfme/schemas
Version:
TypeScript base PDF generator and React base UI. Open source, developed by the community, and completely free to use under the MIT license!
29 lines (28 loc) • 857 B
TypeScript
import type { Schema } from '@pdfme/common';
import type { Font as FontKitFont } from 'fontkit';
export type ALIGNMENT = 'left' | 'center' | 'right' | 'justify';
export type VERTICAL_ALIGNMENT = 'top' | 'middle' | 'bottom';
export type DYNAMIC_FONT_SIZE_FIT = 'horizontal' | 'vertical';
export type FontWidthCalcValues = {
font: FontKitFont;
fontSize: number;
characterSpacing: number;
boxWidthInPt: number;
};
export interface TextSchema extends Schema {
fontName?: string;
alignment: ALIGNMENT;
verticalAlignment: VERTICAL_ALIGNMENT;
fontSize: number;
lineHeight: number;
strikethrough?: boolean;
underline?: boolean;
characterSpacing: number;
dynamicFontSize?: {
min: number;
max: number;
fit: DYNAMIC_FONT_SIZE_FIT;
};
fontColor: string;
backgroundColor: string;
}