/** * ZUI Typography System * Typography tokens based on ZeppOS 3.0 design specifications * * Text is the most direct way of expressing information. Font distinguishes * the layer and priority of information through size, weight, and style. */ import type { ThemeTypography } from '../core/types'; /** * Font family definitions * - primary: Noto Sans - main system font * - number: Zepp OS Number Regular - special digits display * - condensed: Zepp OS Number Condensed - workout numbers */ export declare const fontFamilies: { readonly primary: "Noto Sans"; readonly number: "Zepp OS Number"; readonly condensed: "Zepp OS Number Condensed"; }; /** * Typography scale for 480×480 resolution * * Based on Snellen theory: * - Optimal viewing distance: 25-50 cm * - Visual angle: 5 minutes of arc * - Minimum font size: 24px (Caption1) * * Line height = font size × 1.25 */ export declare const fontSizes: { readonly caption1: { readonly size: 24; readonly lineHeight: 30; }; readonly subheadline: { readonly size: 28; readonly lineHeight: 35; }; readonly body: { readonly size: 32; readonly lineHeight: 40; }; readonly title: { readonly size: 36; readonly lineHeight: 45; }; readonly title1: { readonly size: 40; readonly lineHeight: 50; }; readonly largeTitle: { readonly size: 48; readonly lineHeight: 60; }; }; /** * Font size entry type */ export interface FontSizeEntry { size: number; lineHeight: number; } /** * Font sizes configuration type */ export interface FontSizesConfig { caption1: FontSizeEntry; subheadline: FontSizeEntry; body: FontSizeEntry; title: FontSizeEntry; title1: FontSizeEntry; largeTitle: FontSizeEntry; } /** * Typography scale for other resolutions */ export declare const fontSizesByResolution: Record; /** * Font weight definitions */ export declare const fontWeights: { readonly regular: 400; readonly medium: 500; readonly semibold: 600; readonly bold: 700; }; /** * Line height calculation multiplier * Line height = font size × 1.25 */ export declare const LINE_HEIGHT_MULTIPLIER = 1.25; /** * Calculate line height from font size */ export declare function calculateLineHeight(fontSize: number): number; export type FontSizeKey = keyof typeof fontSizes; export type FontWeightKey = keyof typeof fontWeights; export type FontFamilyKey = keyof typeof fontFamilies; export interface TextStyle { fontFamily: string; fontSize: number; lineHeight: number; fontWeight: number; } /** * Text scrolling configuration for text that exceeds display space * * Speed: 100% screen width every 6800ms * For 480px screen: ~71px per 1000ms * Pause at start: 2000ms before restart */ export declare const textScrollConfig: { readonly speedPerMs: number; readonly pauseDuration: 2000; /** * Calculate scroll duration for given text width */ readonly getScrollDuration: (textWidth: number, screenWidth?: number) => number; }; export type TextCase = 'none' | 'uppercase' | 'lowercase' | 'capitalize' | 'titleCase' | 'sentenceCase'; /** * Apply text case transformation * @param text - Input text * @param textCase - Case transformation type */ export declare function applyTextCase(text: string, textCase: TextCase): string; /** * Predefined title styles for common use cases */ export declare const titleStyles: { readonly pageTitle: { readonly size: 32; readonly lineHeight: 40; readonly weight: 500; }; readonly sectionTitle: { readonly size: 28; readonly lineHeight: 35; readonly weight: 500; }; readonly cardTitle: { readonly size: 24; readonly lineHeight: 30; readonly weight: 500; }; readonly listTitle: { readonly size: 22; readonly lineHeight: 28; readonly weight: 400; }; }; /** * Default typography theme */ export declare const defaultTypography: ThemeTypography; /** * Get complete text style by size key and optional weight */ export declare function getTextStyle(size: FontSizeKey, weight?: FontWeightKey, family?: FontFamilyKey): TextStyle; /** * Get font sizes for specific screen resolution */ export declare function getFontSizesForResolution(resolution: number): FontSizesConfig; /** * Calculate minimum font size for a screen * Based on Snellen theory: size = 0.0143 × PPI × 5 * * @param ppi - Pixels per inch */ export declare function calculateMinFontSize(ppi: number): number; /** * Check if text needs scrolling * @param textWidth - Width of rendered text * @param containerWidth - Width of container */ export declare function needsScrolling(textWidth: number, containerWidth: number): boolean; /** * Create text style object for ZeppOS widget */ export declare function createTextStyleOptions(size: FontSizeKey, weight?: FontWeightKey, color?: number): Record; //# sourceMappingURL=typography.d.ts.map