text.d.ts 676 B

1234567891011121314151617
  1. import type { DisplayObject, Text } from '../shapes';
  2. /**
  3. * 计算文本在画布中的宽度
  4. */
  5. export declare const measureTextWidth: {
  6. (...args: any[]): any;
  7. cache: Map<any, any>;
  8. };
  9. export declare const getFont: (textShape: Text) => {
  10. fontSize: number;
  11. fontFamily: string;
  12. fontWeight: number | "unset" | "initial" | "inherit" | "normal" | "bold" | "bolder" | "lighter";
  13. fontStyle: "unset" | "initial" | "inherit" | "normal" | "italic" | "oblique";
  14. fontVariant: string | undefined;
  15. };
  16. export declare function textOf(node: DisplayObject): Text | null;
  17. export declare function applyToText(node: DisplayObject, style: Record<string, any>): void;