import { Texture } from '../display/webgl/texture.js'; import type { BaseTexture } from '../display/webgl/base_texture.js'; /** One glyph in a bitmap font, as parsed from the font descriptor. */ export type BitmapFontChar = { x: number; y: number; width: number; height: number; xOffset: number; yOffset: number; xAdvance: number; kerning: Record; texture?: Texture; }; /** A parsed bitmap font: its metrics and the glyphs it can draw. */ /** A bitmap font descriptor in the JSON form the packers emit, with attributes prefixed by `_`. */ export type JsonBitmapFontDescriptor = { font: { info: Record; common: Record; chars: { char: Record[]; }; kernings?: { kerning?: Record[]; }; }; }; export type BitmapFontData = { font: string; size: number; lineHeight: number; chars: Record; }; /** * Finalizes bitmap font data by attaching textures to characters. * @param {BaseTexture} baseTexture - The base texture for the font. * @param {object} bitmapFontData - The bitmap font data to finalize. * @returns {object} The finalized bitmap font data. */ export declare const finalizeBitmapFont: (baseTexture: BaseTexture, bitmapFontData: BitmapFontData) => BitmapFontData; /** * Parses XML bitmap font data. * @param {object} xml - The XML document containing the bitmap font data. * @param {BaseTexture} baseTexture - The base texture for the font. * @param {number} xSpacing - Horizontal spacing between characters. * @param {number} ySpacing - Vertical spacing between characters. * @returns {object} The parsed bitmap font data. */ export declare const xmlBitmapFont: (xml: XMLDocument, baseTexture: BaseTexture, xSpacing: number, ySpacing: number) => BitmapFontData; /** * Parses XML bitmap font data (alias for xmlBitmapFont). * @param {object} xml - The XML document containing the bitmap font data. * @param {BaseTexture} baseTexture - The base texture for the font. * @param {number} xSpacing - Horizontal spacing between characters. * @param {number} ySpacing - Vertical spacing between characters. * @returns {object} The parsed bitmap font data. */ export declare const bitmapFont: (xml: XMLDocument, baseTexture: BaseTexture, xSpacing: number, ySpacing: number) => BitmapFontData; /** * Parses JSON bitmap font data. * @param {object} json - The JSON object containing the bitmap font data. * @param {BaseTexture} baseTexture - The base texture for the font. * @param {number} xSpacing - Horizontal spacing between characters. * @param {number} ySpacing - Vertical spacing between characters. * @returns {object} The parsed bitmap font data. */ export declare const jsonBitmapFont: (json: JsonBitmapFontDescriptor, baseTexture: BaseTexture, xSpacing: number, ySpacing: number) => BitmapFontData; //# sourceMappingURL=loader_parser.d.ts.map