import type { GlyphMetrics, StyleGlyph } from './alpha-image'; import { RGBAImage } from './alpha-image'; /** * SDF_SCALE controls the pixel density of locally generated glyphs relative * to "normal" SDFs which are generated at 24pt font and a "pixel ratio" of 1. * The GlyphManager will generate glyphs SDF_SCALE times as large, * but with the same glyph metrics, and the quad generation code will scale them * back down so they display at the same size. * * The choice of SDF_SCALE is a trade-off between performance and quality. * Glyph generation time grows quadratically with the the scale, while quality * improvements drop off rapidly when the scale is higher than the pixel ratio * of the device. The scale of 2 buys noticeable improvements on HDPI screens * at acceptable cost. */ export declare const SDF_SCALE = 4; export declare const BASE_FONT_WIDTH: number; export declare const BASE_FONT_BUFFER: number; export declare const RADIUS: number; export declare const glyphPadding = 1; type Rect = { x: number; y: number; w: number; h: number; }; export type GlyphPosition = { rect: Rect; metrics: GlyphMetrics; }; export type GlyphPositions = Record>; /** * Merge SDFs into a large squared atlas with `potpack`, * because on WebGL1 context, all textures are resized to a power of two to produce the best quality. * * @see https://doc.babylonjs.com/advanced_topics/webGL2#power-of-two-textures */ export declare class GlyphAtlas { image: RGBAImage; positions: GlyphPositions; constructor(stacks: Record>); } export {};