1 | import { Context } from '../Context.js';
|
---|
2 | import { Shape, ShapeConfig } from '../Shape.js';
|
---|
3 | import { Text } from './Text.js';
|
---|
4 | import { GetSet, PathSegment, Vector2d } from '../types.js';
|
---|
5 | export interface TextPathConfig extends ShapeConfig {
|
---|
6 | text?: string;
|
---|
7 | data?: string;
|
---|
8 | fontFamily?: string;
|
---|
9 | fontSize?: number;
|
---|
10 | fontStyle?: string;
|
---|
11 | letterSpacing?: number;
|
---|
12 | }
|
---|
13 | export declare class TextPath extends Shape<TextPathConfig> {
|
---|
14 | dummyCanvas: HTMLCanvasElement;
|
---|
15 | dataArray: PathSegment[];
|
---|
16 | glyphInfo: Array<{
|
---|
17 | transposeX: number;
|
---|
18 | transposeY: number;
|
---|
19 | text: string;
|
---|
20 | rotation: number;
|
---|
21 | p0: Vector2d;
|
---|
22 | p1: Vector2d;
|
---|
23 | }>;
|
---|
24 | partialText: string;
|
---|
25 | pathLength: number;
|
---|
26 | textWidth: number;
|
---|
27 | textHeight: number;
|
---|
28 | constructor(config?: TextPathConfig);
|
---|
29 | _getTextPathLength(): number;
|
---|
30 | _getPointAtLength(length: number): {
|
---|
31 | x: any;
|
---|
32 | y: any;
|
---|
33 | } | null;
|
---|
34 | _readDataAttribute(): void;
|
---|
35 | _sceneFunc(context: Context): void;
|
---|
36 | _hitFunc(context: Context): void;
|
---|
37 | getTextWidth(): number;
|
---|
38 | getTextHeight(): number;
|
---|
39 | setText(text: string): Text;
|
---|
40 | _getContextFont(): string;
|
---|
41 | _getTextSize(text: string): {
|
---|
42 | width: number;
|
---|
43 | height: number;
|
---|
44 | };
|
---|
45 | _setTextData(): null | undefined;
|
---|
46 | getSelfRect(): {
|
---|
47 | x: number;
|
---|
48 | y: number;
|
---|
49 | width: number;
|
---|
50 | height: number;
|
---|
51 | };
|
---|
52 | destroy(): this;
|
---|
53 | fontFamily: GetSet<string, this>;
|
---|
54 | fontSize: GetSet<number, this>;
|
---|
55 | fontStyle: GetSet<string, this>;
|
---|
56 | fontVariant: GetSet<string, this>;
|
---|
57 | align: GetSet<string, this>;
|
---|
58 | letterSpacing: GetSet<number, this>;
|
---|
59 | text: GetSet<string, this>;
|
---|
60 | data: GetSet<string, this>;
|
---|
61 | kerningFunc: GetSet<(leftChar: string, rightChar: string) => number, this>;
|
---|
62 | textBaseline: GetSet<string, this>;
|
---|
63 | textDecoration: GetSet<string, this>;
|
---|
64 | }
|
---|