1 line
34 KiB
Plaintext
1 line
34 KiB
Plaintext
|
|
{"version":3,"file":"TextStyle.mjs","sources":["../src/TextStyle.ts"],"sourcesContent":["// disabling eslint for now, going to rewrite this in v5\n/* eslint-disable */\n\nimport { TEXT_GRADIENT } from './const';\nimport { Color } from '@pixi/core';\n\nexport type TextStyleAlign = 'left'|'center'|'right'|'justify';\nexport type TextStyleFill = string|string[]|number|number[]|CanvasGradient|CanvasPattern;\nexport type TextStyleFontStyle = 'normal'|'italic'|'oblique';\nexport type TextStyleFontVariant = 'normal'|'small-caps';\nexport type TextStyleFontWeight = 'normal'|'bold'|'bolder'|'lighter'|'100'|'200'|'300'|'400'|'500'|'600'|'700'|'800'|'900';\nexport type TextStyleLineJoin = 'miter'|'round'|'bevel';\nexport type TextStyleTextBaseline = 'alphabetic'|'top'|'hanging'|'middle'|'ideographic'|'bottom';\nexport type TextStyleWhiteSpace = 'normal'|'pre'|'pre-line';\n\n/**\n * Generic interface for TextStyle options.\n * @memberof PIXI\n */\nexport interface ITextStyle {\n /**\n * Alignment for multiline text, does not affect single line text\n * @type {'left'|'center'|'right'|'justify'}\n */\n align: TextStyleAlign;\n /** Indicates if lines can be wrapped within words, it needs wordWrap to be set to true */\n breakWords: boolean;\n /** Set a drop shadow for the text */\n dropShadow: boolean;\n /** Set alpha for the drop shadow */\n dropShadowAlpha: number;\n /** Set a angle of the drop shadow */\n dropShadowAngle: number;\n /** Set a shadow blur radius */\n dropShadowBlur: number;\n /** A fill style to be used on the dropshadow e.g., 'red', '#00FF00' */\n dropShadowColor: string|number;\n /** Set a distance of the drop shadow */\n dropShadowDistance: number;\n /**\n * A canvas fillstyle that will be used on the text e.g., 'red', '#00FF00'.\n * Can be an array to create a gradient, e.g., `['#000000','#FFFFFF']`\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}\n * @type {string|string[]|number|number[]|CanvasGradient|CanvasPattern}\n */\n fill: TextStyleFill;\n /**\n * If fill is an array of colours to create a gradient, this can change the\n * type/direction of the gradient. See {@link PIXI.TEXT_GRADIENT}\n * @type {PIXI.TEXT_GRADIENT}\n */\n fillGradientType: TEXT_GRADIENT;\n /**\n * If fill is an array of colours to create a gradient, this array can set\n * the stop points (numbers between 0 and 1) for the color, overriding the\n * default behaviour of evenly spacing them.\n */\n fillGradientStops: number[];\n /**\n * The font family, can be a single font name, or a list of names where the first\n * is the preferred font.\n */\n fontFamily: string | string[];\n /**\n * The font size (as a number it converts to px, but as a string,\n * equivalents are '26px','20pt','160%' or '1.6em')\n */\n fontSize: number | string;\n /**\n * The font style.\n * @type {'normal'|'italic'|'oblique'}\n */\n fontStyle: TextStyleFontStyle;\n /**\n * The font variant.\n * @type {'normal'|'small-caps'}\n */\n fontVariant: TextStyleFontVariant;\n /**\n * The font weight.\n * @type {'normal'|'bold'|'bolder'|'lighter'|'100'|'200'|'300'|'400'|'500'|'600'|'700'|'800'|'900'}\n */\n fontWeight: TextStyleFontWeight;\n /** The height of the line, a number that represents the vertical space that a letter uses. */\n leading: number;\n /** The amount of spacing between letters, default is 0 */\n letterSpacing: number;\n /** The line height, a number that represents the vertical space that a letter uses */\n lineHeight: number;\n /**\n * The lineJoin property sets the type of corner created, it can resolve\n * spiked text issues. Possible values \"miter\" (creates a sharp corner),\n * \"round\" (creates a round corner) or \"bevel\" (creates a squared corner).\n * @type {'miter'|'round'|'bevel'}\n */\n lineJoin: TextStyleLineJoin;\n /**\n * The
|