index.d.ts 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. /// <reference path="./global.d.ts" />
  2. import { Container } from '@pixi/display';
  3. import type { Dict } from '@pixi/utils';
  4. import type { ExtensionMetadata } from '@pixi/core';
  5. import type { IDestroyOptions } from '@pixi/display';
  6. import type { ITextStyle } from '@pixi/text';
  7. import type { Loader } from '@pixi/loaders';
  8. import { LoaderResource } from '@pixi/loaders';
  9. import { Mesh } from '@pixi/mesh';
  10. import { ObservablePoint } from '@pixi/math';
  11. import type { Rectangle } from '@pixi/math';
  12. import type { Renderer } from '@pixi/core';
  13. import { TextStyle } from '@pixi/text';
  14. import type { TextStyleAlign } from '@pixi/text';
  15. import { Texture } from '@pixi/core';
  16. /**
  17. * Auto-detect BitmapFont parsing format based on data.
  18. * @private
  19. * @param {any} data - Data to detect format
  20. * @returns {any} Format or null
  21. */
  22. export declare function autoDetectFormat(data: unknown): typeof formats[number] | null;
  23. /**
  24. * BitmapFont represents a typeface available for use with the BitmapText class. Use the `install`
  25. * method for adding a font to be used.
  26. * @memberof PIXI
  27. */
  28. export declare class BitmapFont {
  29. /**
  30. * This character set includes all the letters in the alphabet (both lower- and upper- case).
  31. * @type {string[][]}
  32. * @example
  33. * BitmapFont.from("ExampleFont", style, { chars: BitmapFont.ALPHA })
  34. */
  35. static readonly ALPHA: (string | string[])[];
  36. /**
  37. * This character set includes all decimal digits (from 0 to 9).
  38. * @type {string[][]}
  39. * @example
  40. * BitmapFont.from("ExampleFont", style, { chars: BitmapFont.NUMERIC })
  41. */
  42. static readonly NUMERIC: string[][];
  43. /**
  44. * This character set is the union of `BitmapFont.ALPHA` and `BitmapFont.NUMERIC`.
  45. * @type {string[][]}
  46. */
  47. static readonly ALPHANUMERIC: (string | string[])[];
  48. /**
  49. * This character set consists of all the ASCII table.
  50. * @member {string[][]}
  51. * @see http://www.asciitable.com/
  52. */
  53. static readonly ASCII: string[][];
  54. /**
  55. * Collection of default options when using `BitmapFont.from`.
  56. * @property {number} [resolution=1] -
  57. * @property {number} [textureWidth=512] -
  58. * @property {number} [textureHeight=512] -
  59. * @property {number} [padding=4] -
  60. * @property {string|string[]|string[][]} chars = PIXI.BitmapFont.ALPHANUMERIC
  61. */
  62. static readonly defaultOptions: IBitmapFontOptions;
  63. /** Collection of available/installed fonts. */
  64. static readonly available: Dict<BitmapFont>;
  65. /** The name of the font face. */
  66. readonly font: string;
  67. /** The size of the font face in pixels. */
  68. readonly size: number;
  69. /** The line-height of the font face in pixels. */
  70. readonly lineHeight: number;
  71. /** The map of characters by character code. */
  72. readonly chars: Dict<IBitmapFontCharacter>;
  73. /** The map of base page textures (i.e., sheets of glyphs). */
  74. readonly pageTextures: Dict<Texture>;
  75. /** The range of the distance field in pixels. */
  76. readonly distanceFieldRange: number;
  77. /** The kind of distance field for this font or "none". */
  78. readonly distanceFieldType: string;
  79. private _ownsTextures;
  80. /**
  81. * @param data
  82. * @param textures
  83. * @param ownsTextures - Setting to `true` will destroy page textures
  84. * when the font is uninstalled.
  85. */
  86. constructor(data: BitmapFontData, textures: Texture[] | Dict<Texture>, ownsTextures?: boolean);
  87. /** Remove references to created glyph textures. */
  88. destroy(): void;
  89. /**
  90. * Register a new bitmap font.
  91. * @param data - The
  92. * characters map that could be provided as xml or raw string.
  93. * @param textures - List of textures for each page.
  94. * @param ownsTextures - Set to `true` to destroy page textures
  95. * when the font is uninstalled. By default fonts created with
  96. * `BitmapFont.from` or from the `BitmapFontLoader` are `true`.
  97. * @returns {PIXI.BitmapFont} Result font object with font, size, lineHeight
  98. * and char fields.
  99. */
  100. static install(data: string | XMLDocument | BitmapFontData, textures: Texture | Texture[] | Dict<Texture>, ownsTextures?: boolean): BitmapFont;
  101. /**
  102. * Remove bitmap font by name.
  103. * @param name - Name of the font to uninstall.
  104. */
  105. static uninstall(name: string): void;
  106. /**
  107. * Generates a bitmap-font for the given style and character set. This does not support
  108. * kernings yet. With `style` properties, only the following non-layout properties are used:
  109. *
  110. * - {@link PIXI.TextStyle#dropShadow|dropShadow}
  111. * - {@link PIXI.TextStyle#dropShadowDistance|dropShadowDistance}
  112. * - {@link PIXI.TextStyle#dropShadowColor|dropShadowColor}
  113. * - {@link PIXI.TextStyle#dropShadowBlur|dropShadowBlur}
  114. * - {@link PIXI.TextStyle#dropShadowAngle|dropShadowAngle}
  115. * - {@link PIXI.TextStyle#fill|fill}
  116. * - {@link PIXI.TextStyle#fillGradientStops|fillGradientStops}
  117. * - {@link PIXI.TextStyle#fillGradientType|fillGradientType}
  118. * - {@link PIXI.TextStyle#fontFamily|fontFamily}
  119. * - {@link PIXI.TextStyle#fontSize|fontSize}
  120. * - {@link PIXI.TextStyle#fontVariant|fontVariant}
  121. * - {@link PIXI.TextStyle#fontWeight|fontWeight}
  122. * - {@link PIXI.TextStyle#lineJoin|lineJoin}
  123. * - {@link PIXI.TextStyle#miterLimit|miterLimit}
  124. * - {@link PIXI.TextStyle#stroke|stroke}
  125. * - {@link PIXI.TextStyle#strokeThickness|strokeThickness}
  126. * - {@link PIXI.TextStyle#textBaseline|textBaseline}
  127. * @param name - The name of the custom font to use with BitmapText.
  128. * @param textStyle - Style options to render with BitmapFont.
  129. * @param options - Setup options for font or name of the font.
  130. * @param {string|string[]|string[][]} [options.chars=PIXI.BitmapFont.ALPHANUMERIC] - characters included
  131. * in the font set. You can also use ranges. For example, `[['a', 'z'], ['A', 'Z'], "!@#$%^&*()~{}[] "]`.
  132. * Don't forget to include spaces ' ' in your character set!
  133. * @param {number} [options.resolution=1] - Render resolution for glyphs.
  134. * @param {number} [options.textureWidth=512] - Optional width of atlas, smaller values to reduce memory.
  135. * @param {number} [options.textureHeight=512] - Optional height of atlas, smaller values to reduce memory.
  136. * @param {number} [options.padding=4] - Padding between glyphs on texture atlas.
  137. * @returns Font generated by style options.
  138. * @example
  139. * PIXI.BitmapFont.from("TitleFont", {
  140. * fontFamily: "Arial",
  141. * fontSize: 12,
  142. * strokeThickness: 2,
  143. * fill: "purple"
  144. * });
  145. *
  146. * const title = new PIXI.BitmapText("This is the title", { fontName: "TitleFont" });
  147. */
  148. static from(name: string, textStyle?: TextStyle | Partial<ITextStyle>, options?: IBitmapFontOptions): BitmapFont;
  149. }
  150. /**
  151. * Normalized parsed data from .fnt files.
  152. * @memberof PIXI
  153. */
  154. export declare class BitmapFontData {
  155. /** @readonly */
  156. info: IBitmapFontDataInfo[];
  157. /** @readonly */
  158. common: IBitmapFontDataCommon[];
  159. /** @readonly */
  160. page: IBitmapFontDataPage[];
  161. /** @readonly */
  162. char: IBitmapFontDataChar[];
  163. /** @readonly */
  164. kerning: IBitmapFontDataKerning[];
  165. /** @readonly */
  166. distanceField: IBitmapFontDataDistanceField[];
  167. constructor();
  168. }
  169. /**
  170. * {@link PIXI.Loader Loader} middleware for loading
  171. * bitmap-based fonts suitable for using with {@link PIXI.BitmapText}.
  172. * @memberof PIXI
  173. */
  174. export declare class BitmapFontLoader {
  175. /** @ignore */
  176. static extension: ExtensionMetadata;
  177. /**
  178. * Called when the plugin is installed.
  179. * @see PIXI.extensions.add
  180. */
  181. static add(): void;
  182. /**
  183. * Called after a resource is loaded.
  184. * @see PIXI.Loader.loaderMiddleware
  185. * @param this
  186. * @param {PIXI.LoaderResource} resource
  187. * @param {Function} next
  188. */
  189. static use(this: Loader, resource: LoaderResource, next: (...args: any[]) => void): void;
  190. /**
  191. * Get folder path from a resource.
  192. * @param loader
  193. * @param resource
  194. */
  195. private static getBaseUrl;
  196. /**
  197. * Replacement for NodeJS's path.dirname
  198. * @param {string} url - Path to get directory for
  199. */
  200. private static dirname;
  201. }
  202. /**
  203. * A BitmapText object will create a line or multiple lines of text using bitmap font.
  204. *
  205. * The primary advantage of this class over Text is that all of your textures are pre-generated and loading,
  206. * meaning that rendering is fast, and changing text has no performance implications.
  207. *
  208. * Supporting character sets other than latin, such as CJK languages, may be impractical due to the number of characters.
  209. *
  210. * To split a line you can use '\n', '\r' or '\r\n' in your string.
  211. *
  212. * PixiJS can auto-generate fonts on-the-fly using BitmapFont or use fnt files provided by:
  213. * http://www.angelcode.com/products/bmfont/ for Windows or
  214. * http://www.bmglyph.com/ for Mac.
  215. *
  216. * You can also use SDF, MSDF and MTSDF BitmapFonts for vector-like scaling appearance provided by:
  217. * https://github.com/soimy/msdf-bmfont-xml for SDF and MSDF fnt files or
  218. * https://github.com/Chlumsky/msdf-atlas-gen for SDF, MSDF and MTSDF json files
  219. *
  220. * A BitmapText can only be created when the font is loaded.
  221. *
  222. * ```js
  223. * // in this case the font is in a file called 'desyrel.fnt'
  224. * let bitmapText = new PIXI.BitmapText("text using a fancy font!", {
  225. * fontName: "Desyrel",
  226. * fontSize: 35,
  227. * align: "right"
  228. * });
  229. * ```
  230. * @memberof PIXI
  231. */
  232. export declare class BitmapText extends Container {
  233. static styleDefaults: Partial<IBitmapTextStyle>;
  234. /** Set to `true` if the BitmapText needs to be redrawn. */
  235. dirty: boolean;
  236. /**
  237. * The resolution / device pixel ratio of the canvas.
  238. *
  239. * This is set to automatically match the renderer resolution by default, but can be overridden by setting manually.
  240. * @default PIXI.settings.RESOLUTION
  241. */
  242. _resolution: number;
  243. _autoResolution: boolean;
  244. /**
  245. * Private tracker for the width of the overall text.
  246. * @private
  247. */
  248. protected _textWidth: number;
  249. /**
  250. * Private tracker for the height of the overall text.
  251. * @private
  252. */
  253. protected _textHeight: number;
  254. /**
  255. * Private tracker for the current text.
  256. * @private
  257. */
  258. protected _text: string;
  259. /**
  260. * The max width of this bitmap text in pixels. If the text provided is longer than the
  261. * value provided, line breaks will be automatically inserted in the last whitespace.
  262. * Disable by setting value to 0
  263. * @private
  264. */
  265. protected _maxWidth: number;
  266. /**
  267. * The max line height. This is useful when trying to use the total height of the Text,
  268. * ie: when trying to vertically align. (Internally used)
  269. * @private
  270. */
  271. protected _maxLineHeight: number;
  272. /**
  273. * Letter spacing. This is useful for setting the space between characters.
  274. * @private
  275. */
  276. protected _letterSpacing: number;
  277. /**
  278. * Text anchor.
  279. * @readonly
  280. * @private
  281. */
  282. protected _anchor: ObservablePoint;
  283. /**
  284. * Private tracker for the current font.
  285. * @private
  286. */
  287. protected _font?: BitmapFont;
  288. /**
  289. * Private tracker for the current font name.
  290. * @private
  291. */
  292. protected _fontName: string;
  293. /**
  294. * Private tracker for the current font size.
  295. * @private
  296. */
  297. protected _fontSize?: number;
  298. /**
  299. * Private tracker for the current text align.
  300. * @type {string}
  301. * @private
  302. */
  303. protected _align: TextStyleAlign;
  304. /** Collection of page mesh data. */
  305. protected _activePagesMeshData: PageMeshData[];
  306. /**
  307. * Private tracker for the current tint.
  308. * @private
  309. */
  310. protected _tint: number;
  311. /**
  312. * If true PixiJS will Math.floor() x/y values when rendering.
  313. * @default PIXI.settings.ROUND_PIXELS
  314. */
  315. protected _roundPixels: boolean;
  316. /** Cached char texture is destroyed when BitmapText is destroyed. */
  317. private _textureCache;
  318. /**
  319. * @param text - A string that you would like the text to display.
  320. * @param style - The style parameters.
  321. * @param {string} style.fontName - The installed BitmapFont name.
  322. * @param {number} [style.fontSize] - The size of the font in pixels, e.g. 24. If undefined,
  323. *. this will default to the BitmapFont size.
  324. * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center', 'right' or 'justify'),
  325. * does not affect single line text.
  326. * @param {number} [style.tint=0xFFFFFF] - The tint color.
  327. * @param {number} [style.letterSpacing=0] - The amount of spacing between letters.
  328. * @param {number} [style.maxWidth=0] - The max width of the text before line wrapping.
  329. */
  330. constructor(text: string, style?: Partial<IBitmapTextStyle>);
  331. /** Renders text and updates it when needed. This should only be called if the BitmapFont is regenerated. */
  332. updateText(): void;
  333. updateTransform(): void;
  334. _render(renderer: Renderer): void;
  335. /**
  336. * Validates text before calling parent's getLocalBounds
  337. * @returns - The rectangular bounding area
  338. */
  339. getLocalBounds(): Rectangle;
  340. /**
  341. * Updates text when needed
  342. * @private
  343. */
  344. protected validate(): void;
  345. /**
  346. * The tint of the BitmapText object.
  347. * @default 0xffffff
  348. */
  349. get tint(): number;
  350. set tint(value: number);
  351. /**
  352. * The alignment of the BitmapText object.
  353. * @member {string}
  354. * @default 'left'
  355. */
  356. get align(): TextStyleAlign;
  357. set align(value: TextStyleAlign);
  358. /** The name of the BitmapFont. */
  359. get fontName(): string;
  360. set fontName(value: string);
  361. /** The size of the font to display. */
  362. get fontSize(): number;
  363. set fontSize(value: number | undefined);
  364. /**
  365. * The anchor sets the origin point of the text.
  366. *
  367. * The default is `(0,0)`, this means the text's origin is the top left.
  368. *
  369. * Setting the anchor to `(0.5,0.5)` means the text's origin is centered.
  370. *
  371. * Setting the anchor to `(1,1)` would mean the text's origin point will be the bottom right corner.
  372. */
  373. get anchor(): ObservablePoint;
  374. set anchor(value: ObservablePoint);
  375. /** The text of the BitmapText object. */
  376. get text(): string;
  377. set text(text: string);
  378. /**
  379. * The max width of this bitmap text in pixels. If the text provided is longer than the
  380. * value provided, line breaks will be automatically inserted in the last whitespace.
  381. * Disable by setting the value to 0.
  382. */
  383. get maxWidth(): number;
  384. set maxWidth(value: number);
  385. /**
  386. * The max line height. This is useful when trying to use the total height of the Text,
  387. * i.e. when trying to vertically align.
  388. * @readonly
  389. */
  390. get maxLineHeight(): number;
  391. /**
  392. * The width of the overall text, different from fontSize,
  393. * which is defined in the style object.
  394. * @readonly
  395. */
  396. get textWidth(): number;
  397. /** Additional space between characters. */
  398. get letterSpacing(): number;
  399. set letterSpacing(value: number);
  400. /**
  401. * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
  402. * Advantages can include sharper image quality (like text) and faster rendering on canvas.
  403. * The main disadvantage is movement of objects may appear less smooth.
  404. * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}
  405. * @default PIXI.settings.ROUND_PIXELS
  406. */
  407. get roundPixels(): boolean;
  408. set roundPixels(value: boolean);
  409. /**
  410. * The height of the overall text, different from fontSize,
  411. * which is defined in the style object.
  412. * @readonly
  413. */
  414. get textHeight(): number;
  415. /**
  416. * The resolution / device pixel ratio of the canvas.
  417. *
  418. * This is set to automatically match the renderer resolution by default, but can be overridden by setting manually.
  419. * @default 1
  420. */
  421. get resolution(): number;
  422. set resolution(value: number);
  423. destroy(options?: boolean | IDestroyOptions): void;
  424. }
  425. declare const formats: readonly [typeof TextFormat, typeof XMLFormat, typeof XMLStringFormat];
  426. export declare interface IBitmapFontCharacter {
  427. xOffset: number;
  428. yOffset: number;
  429. xAdvance: number;
  430. texture: Texture;
  431. page: number;
  432. kerning: Dict<number>;
  433. }
  434. /** @memberof PIXI */
  435. export declare interface IBitmapFontDataChar {
  436. /** Unique id of character */
  437. id: number;
  438. /** {@link PIXI.IBitmapFontDataPage} id */
  439. page: number;
  440. /** x-position of character in page. */
  441. x: number;
  442. /** y-position of character in page. */
  443. y: number;
  444. /** Width of character in page. */
  445. width: number;
  446. /** Height of character in page. */
  447. height: number;
  448. /** x-offset to apply when rendering character */
  449. xoffset: number;
  450. /** y-offset to apply when rendering character. */
  451. yoffset: number;
  452. /** Advancement to apply to next character. */
  453. xadvance: number;
  454. }
  455. /** @memberof PIXI */
  456. export declare interface IBitmapFontDataCommon {
  457. /** Line height, in pixels. */
  458. lineHeight: number;
  459. }
  460. /** @memberof PIXI */
  461. export declare interface IBitmapFontDataDistanceField {
  462. /** Type of distance field */
  463. fieldType: string;
  464. /** Range of distance */
  465. distanceRange: number;
  466. }
  467. /** @memberof PIXI */
  468. export declare interface IBitmapFontDataInfo {
  469. /** Font face */
  470. face: string;
  471. /** Font size */
  472. size: number;
  473. }
  474. /** @memberof PIXI */
  475. export declare interface IBitmapFontDataKerning {
  476. /** First character of pair */
  477. first: number;
  478. /** Second character of pair */
  479. second: number;
  480. /** x-offset to apply between first & second characters when they are next to each other. */
  481. amount: number;
  482. }
  483. /** @memberof PIXI */
  484. export declare interface IBitmapFontDataPage {
  485. /** Unique id for bitmap texture */
  486. id: number;
  487. /** File name */
  488. file: string;
  489. }
  490. /** @memberof PIXI */
  491. export declare interface IBitmapFontOptions {
  492. /**
  493. * The character set to generate.
  494. * @default PIXI.BitmapFont.ALPHANUMERIC
  495. */
  496. chars?: string | (string | string[])[];
  497. /**
  498. * The resolution for rendering.
  499. * @default 1
  500. */
  501. resolution?: number;
  502. /**
  503. * The padding between glyphs in the atlas.
  504. * @default 4
  505. */
  506. padding?: number;
  507. /**
  508. * The width of the texture atlas.
  509. * @default 512
  510. */
  511. textureWidth?: number;
  512. /**
  513. * The height of the texture atlas.
  514. * @default 512
  515. */
  516. textureHeight?: number;
  517. /**
  518. * Skip generation of kerning information for the BitmapFont.
  519. * If true, this could potentially increase the performance, but may impact the rendered text appearance.
  520. * @default false
  521. */
  522. skipKerning?: boolean;
  523. }
  524. /**
  525. * Internal data format used to convert to BitmapFontData.
  526. * @private
  527. */
  528. export declare interface IBitmapFontRawData {
  529. info: {
  530. face: string;
  531. size: string;
  532. }[];
  533. common: {
  534. lineHeight: string;
  535. }[];
  536. page: {
  537. id: string;
  538. file: string;
  539. }[];
  540. chars: {
  541. count: number;
  542. }[];
  543. char: {
  544. id: string;
  545. page: string;
  546. x: string;
  547. y: string;
  548. width: string;
  549. height: string;
  550. xoffset: string;
  551. yoffset: string;
  552. xadvance: string;
  553. }[];
  554. kernings?: {
  555. count: number;
  556. }[];
  557. kerning?: {
  558. first: string;
  559. second: string;
  560. amount: string;
  561. }[];
  562. distanceField?: {
  563. fieldType: string;
  564. distanceRange: string;
  565. }[];
  566. }
  567. export declare interface IBitmapTextFontDescriptor {
  568. name: string;
  569. size: number;
  570. }
  571. export declare interface IBitmapTextStyle {
  572. fontName: string;
  573. fontSize: number;
  574. tint: number;
  575. align: TextStyleAlign;
  576. letterSpacing: number;
  577. maxWidth: number;
  578. }
  579. declare interface PageMeshData {
  580. index: number;
  581. indexCount: number;
  582. vertexCount: number;
  583. uvsCount: number;
  584. total: number;
  585. mesh: Mesh;
  586. vertices?: Float32Array;
  587. uvs?: Float32Array;
  588. indices?: Uint16Array;
  589. }
  590. /**
  591. * BitmapFont format that's Text-based.
  592. * @private
  593. */
  594. export declare class TextFormat {
  595. /**
  596. * Check if resource refers to txt font data.
  597. * @param data
  598. * @returns - True if resource could be treated as font data, false otherwise.
  599. */
  600. static test(data: unknown): boolean;
  601. /**
  602. * Convert text font data to a javascript object.
  603. * @param txt - Raw string data to be converted
  604. * @returns - Parsed font data
  605. */
  606. static parse(txt: string): BitmapFontData;
  607. }
  608. /**
  609. * BitmapFont format that's XML-based.
  610. * @private
  611. */
  612. export declare class XMLFormat {
  613. /**
  614. * Check if resource refers to xml font data.
  615. * @param data
  616. * @returns - True if resource could be treated as font data, false otherwise.
  617. */
  618. static test(data: unknown): boolean;
  619. /**
  620. * Convert the XML into BitmapFontData that we can use.
  621. * @param xml
  622. * @returns - Data to use for BitmapFont
  623. */
  624. static parse(xml: XMLDocument): BitmapFontData;
  625. }
  626. /**
  627. * BitmapFont format that's XML-based.
  628. * @private
  629. */
  630. export declare class XMLStringFormat {
  631. /**
  632. * Check if resource refers to text xml font data.
  633. * @param data
  634. * @returns - True if resource could be treated as font data, false otherwise.
  635. */
  636. static test(data: unknown): boolean;
  637. /**
  638. * Convert the text XML into BitmapFontData that we can use.
  639. * @param xmlTxt
  640. * @returns - Data to use for BitmapFont
  641. */
  642. static parse(xmlTxt: string): BitmapFontData;
  643. }
  644. export { }