@aurigma/design-atoms-interfaces
Version:
72 lines (71 loc) • 2.49 kB
TypeScript
import { IContentItemData } from "./IContentItemData";
import { IFontSettingsData } from "./IFontSettingsData";
import { ITextPermissionsData } from "./ITextPermissionsData";
/**
* A structure defining the basic text parameters.
* @example
* ```json
* {
* "defaultItemsConfig": {
* "text": {
* "font": {
* "postScriptName": "Impact",
* "size": 33,
* "fauxBold": true,
* "fauxItalic": true
* },
* "color": "rgb(30,30,30)",
* "shadow": {
* "color": "rgb(255,0,0)",
* "size": 0.4,
* "angle": 45,
* "distance": 2
* },
* "stroke": {
* "size": 0.3
* },
* "overflowStrategy": "FitToWidth",
* "textPermissions": {
* "allowChangeFontColor": false,
* "allowChangeShadow": false,
* "allowChangeStroke": false
* }
* }
* }
* }
* ```
* @public
*/
export interface IBaseTextItemData<TTextAlignment, TStrokeSettings, TShadowSettings> extends IContentItemData {
/** The default content for new text elements. It is an empty string for text with rich formatting and `"Text"` for plain text. */
text?: string;
/** The font parameters. */
font?: IFontSettingsData;
/** The text alignment. */
alignment?: TTextAlignment;
/** Enables the underline. The default value is `false`. */
underline?: boolean;
/** The text color. The default value is `"rgba(0,0,0,1)"`. */
color?: string;
/** The spacing between characters, in points. The default value is `0`. */
tracking?: number;
/** The spacing between base lines, in points. */
leading?: number;
/** The spacing between base lines on proof images, in points. */
previewLeading?: number;
/** Allows you to scale text horizontally. The default value is `1`. */
horizontalScale?: number;
/** Allows you to scale text vertically. The default value is `1`. */
verticalScale?: number;
/** The text scaling on proof images. */
previewScale?: number;
/** The stroke parameters. */
stroke?: TStrokeSettings;
/** The shadow parameters. */
shadow?: TShadowSettings;
/** Defines permissions for new text elements. */
textPermissions?: ITextPermissionsData;
overlapLinesEnabled?: boolean;
checkTextCrop?: boolean;
overprintText?: boolean;
}