UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

63 lines • 2.85 kB
import { Rect } from '@expofp/geometry'; import { type ImageDef, type TextAlignment, type TextDef } from '@expofp/renderer'; import { type FontSizeFactor } from '../../../../engine/defs'; import { type CustomFonts } from '../../../../engine/fonts'; import { type Booth } from '../../../../store/BoothStore'; import { type Exhibitor } from '../../../../store/ExhibitorStore'; import { BoothDrawerBaseWithoutPainter } from './BoothDrawerBase'; interface Prefix { fontSize: number; name: string; short?: boolean; } export default function configBoothLabels(booth: Booth): BoothLabelDrawer | undefined; export declare function getMinZoomFactorForDot(scaleFactors: number[]): number; export declare const isDirectionsMode: () => boolean; export declare function getFontUrlByWeight(weight: number, customFonts?: CustomFonts[], style?: string): string; interface LabelFontWeights { main: number; details: number; } export declare function getBoothLabelWeights(): LabelFontWeights; export declare function getExhibitorLabelWeights(): LabelFontWeights; export declare function getBadgeFontWeight(): number; export declare class BoothLabelDrawer extends BoothDrawerBaseWithoutPainter { protected canvasRect: Rect; protected paddingScaled: [number, number]; protected padding: number; protected minZoomDotVisible: number; protected maxZoomDotVisible: number; protected exh: Exhibitor[]; protected shapeLabel: TextDef; protected shapeDot: ImageDef; protected fontSizes: [FontSizeFactor[], FontSizeFactor[]]; protected lines: [string[], string[]]; protected topLeftAlignment: TextAlignment; protected centerAlignment: TextAlignment; protected prefixes: Prefix[]; protected fontUrls: [string, string]; constructor(booth: Booth); getShape(): (ImageDef | TextDef)[]; /** * Lays this booth's label out for a new pixel size: the font-size step, the alignment that follows * it, and the padding that scales with it. * @param pixelSize - Plan units per device pixel. * @returns The label when it moved, empty when nothing changed so the renderer skips the write. */ layOutLabel(pixelSize: number): TextDef[]; /** * Lays this booth's dot out for a new pixel size: it is drawn only in the band between the zoom * where the label stops fitting and the zoom where the dot itself would overflow the booth. * @param pixelSize - Plan units per device pixel. * @returns The dot when it moved, empty when nothing changed so the renderer skips the write. */ layOutDot(pixelSize: number): ImageDef[]; getShapeDot(): void; private createLines; private calculateFontSizeFactors; private calcArea; private optimizationLevel; private measureText; } export {}; //# sourceMappingURL=config-booth-labels.d.ts.map