import { Texture } from '@antv/g-device-api'; /** @memberof text */ export interface CharData { /** Unique id of character */ id: number; /** x-offset to apply when rendering character */ xOffset: number; /** y-offset to apply when rendering character. */ yOffset: number; /** Advancement to apply to next character. */ xAdvance: number; /** The kerning values for this character. */ kerning: Record; /** The texture of the character. */ texture?: Texture; } /** * The raw data of a character in a bitmap font. * @memberof text */ export interface RawCharData extends Omit { /** The page of the font texture that the character is on. */ page: number; /** The x position of the character in the page. */ x: number; /** The y position of the character in the page. */ y: number; /** The width of the character in the page. */ width: number; /** The height of the character in the page. */ height: number; /** The letter of the character. */ letter?: string; } /** * The raw data of a bitmap font. * @memberof text */ export interface BitmapFontData { /** The offset of the font face from the baseline. */ baseLineOffset: number; /** The map of characters by character code. */ chars: Record; /** The map of base page textures (i.e., sheets of glyphs). */ pages: { /** Unique id for bitmap texture */ id: number; /** File name */ file: string; }[]; /** The line-height of the font face in pixels. */ lineHeight: number; /** The size of the font face in pixels. */ fontSize: number; /** The name of the font face. */ fontFamily: string; /** The range and type of the distance field for this font. */ distanceField?: { /** Type of distance field */ type: 'sdf' | 'msdf' | 'none'; /** Range of the distance field in pixels */ range: number; }; } /** * Internal data format used to convert to BitmapFontData. * @private */ export interface BitmapFontRawData { info: { face: string; size: string; }[]; common: { lineHeight: string; base: string; }[]; page: { id: string; file: string; }[]; chars: { count: number; }[]; char: { id: string; page: string; xoffset: string; yoffset: string; xadvance: string; x: string; y: string; width: string; height: string; letter?: string; char?: string; }[]; kernings?: { count: number; }[]; kerning?: { first: string; second: string; amount: string; }[]; distanceField?: { fieldType: 'sdf' | 'msdf' | 'none'; distanceRange: string; }[]; } export declare const bitmapFontTextParser: { test(data: string | XMLDocument | BitmapFontData): boolean; parse(txt: string): BitmapFontData; };