{"version":3,"file":"HTMLText.mjs","sources":["../../../src/scene/text-html/HTMLText.ts"],"sourcesContent":["import { TextureStyle, type TextureStyleOptions } from '../../rendering/renderers/shared/texture/TextureStyle';\nimport { AbstractText, ensureTextOptions } from '../text/AbstractText';\nimport { type BatchableHTMLText } from './BatchableHTMLText';\nimport { HTMLTextStyle } from './HTMLTextStyle';\nimport { measureHtmlText } from './utils/measureHtmlText';\n\nimport type { View } from '../../rendering/renderers/shared/view/View';\nimport type { TextOptions, TextString } from '../text/AbstractText';\nimport type { HTMLTextStyleOptions } from './HTMLTextStyle';\n\n/**\n * Constructor options used for `HTMLText` instances. Extends the base text options\n * with HTML-specific features and texture styling capabilities.\n * @example\n * ```ts\n * // Basic HTML text\n * const basicText = new HTMLText({\n * text: 'Bold and Italic text',\n * style: {\n * fontSize: 24,\n * fill: 0xff1010\n * }\n * });\n *\n * // Rich HTML text with styling\n * const richText = new HTMLText({\n * text: 'Custom Tag',\n * style: {\n * fontFamily: 'Arial',\n * fontSize: 32,\n * fill: 0x4a4a4a,\n * align: 'center',\n * tagStyles: {\n * custom: {\n * fontSize: 32,\n * fill: '#00ff00',\n * fontStyle: 'italic'\n * }\n * }\n * }\n * textureStyle: {\n * scaleMode: 'linear',\n * }\n * });\n * ```\n * @category text\n * @standard\n */\nexport interface HTMLTextOptions extends TextOptions, PixiMixins.HTMLTextOptions\n{\n /**\n * Optional texture style to use for the text texture. This allows fine control over\n * how the text is rendered to a texture before being displayed.\n *\n * The texture style can affect:\n * - Scale mode (nearest/linear)\n * - Resolution\n * - Format (rgb/rgba)\n * - Alpha handling\n * @example\n * ```ts\n * const text = new HTMLText({\n * text: 'Crisp Text',\n * textureStyle: {\n * scaleMode: 'nearest', // Pixel-perfect scaling\n * }\n * });\n * ```\n * @advanced\n */\n textureStyle?: TextureStyle | TextureStyleOptions;\n}\n\n// eslint-disable-next-line requireExport/require-export-jsdoc, requireMemberAPI/require-member-api-doc\nexport interface HTMLText extends PixiMixins.HTMLText, AbstractText<\n HTMLTextStyle,\n HTMLTextStyleOptions,\n HTMLTextOptions,\n BatchableHTMLText\n> {}\n\n/**\n * A HTMLText object creates text using HTML/CSS rendering with SVG foreignObject.\n * This allows for rich text formatting using standard HTML tags and CSS styling.\n *\n * Key features:\n * - HTML tag support (, , etc.)\n * - CSS styling and custom style overrides\n * - Emoji and special character support\n * - Line breaking and word wrapping\n * - SVG-based rendering\n * @example\n * ```ts\n * import { HTMLText } from 'pixi.js';\n *\n * // Basic HTML text with tags\n * const text = new HTMLText({\n * text: '
Title
This is a bold and italic text.
',\n * style: {\n * fontFamily: 'Arial',\n * fontSize: 24,\n * fill: 0xff1010,\n * align: 'center',\n * }\n * });\n *\n * // Rich HTML text with custom styling\n * const richText = new HTMLText({\n * text: `\n *