sard-uniapp
Version:
sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库
10 lines (9 loc) • 542 B
TypeScript
export type CanvasFontStyle = 'normal' | 'italic' | 'oblique' | (string & {});
export type CanvasTextAlign = 'center' | 'end' | 'left' | 'right' | 'start';
export type CanvasFontWeight = 'normal' | 'bold' | number | 'lighter' | 'bolder' | (string & {});
export declare function measureTextWidth(context: ReturnType<typeof uni.createCanvasContext>, text: string, { fontStyle, fontWeight, fontSize, fontFamily, }: {
fontStyle?: CanvasFontStyle;
fontWeight?: CanvasFontWeight;
fontSize?: number;
fontFamily?: string;
}): number;