UNPKG

@pmndrs/uikit

Version:

Build performant 3D user interfaces with Three.js and yoga.

7 lines (6 loc) 808 B
import { alignmentXMap, alignmentYMap } from '../../utils.js'; import type { GlyphLayout, GlyphOutProperties, PositionedGlyphLayout } from './types.js'; export declare function buildPositionedGlyphLayout(properties: GlyphOutProperties, availableWidth: number, availableHeight: number, textAlign: keyof typeof alignmentXMap | 'justify', verticalAlign: keyof typeof alignmentYMap): PositionedGlyphLayout; export declare function getTextXOffset(availableWidth: number, nonWhitespaceWidth: number, textAlign: keyof typeof alignmentXMap | 'justify'): number; export declare function getTextYOffset(layout: Pick<GlyphLayout, 'availableHeight' | 'lines' | 'lineHeight'>, verticalAlign: keyof typeof alignmentYMap): number; export declare function getWhitespaceWidth({ font, fontSize }: GlyphOutProperties): number;