s2maps-gpu
Version:
S2 Maps GPU - An open source, high-performance, and GPU-accelerated map engine for rendering large-scale, interactive maps.
26 lines (25 loc) • 855 B
TypeScript
/** Local Texture Pack area tracker */
interface Space {
widthOffset: number;
heightOffset: number;
}
/**
* Texture pack stores fonts and builds out SDF characters onto a texture sheet
* each time we encounter a new character, we need to build the fills and strokes
* and let the main painting thread know about the update
* each font will have its own vertical row, and if a row is filled, we start a new one
* the horizontal space is 2048 and we start a new row
*/
export default class TexturePack {
height: number;
maxWidth: number;
spaces: Record<number, Space>;
/**
* Add a glyph
* @param width - width of glyph
* @param height - height of glyph
* @returns the position of the glyph in the texture
*/
addGlyph(width: number, height: number): [offsetX: number, offsetY: number];
}
export {};