You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
parttimejob/node_modules/zrender/lib/contain/text.d.ts

24 lines
1.3 KiB

import BoundingRect, { RectLike } from '../core/BoundingRect';
import { TextAlign, TextVerticalAlign, BuiltinTextPosition } from '../core/types';
export declare function getWidth(text: string, font: string): number;
export declare function innerGetBoundingRect(text: string, font: string, textAlign?: TextAlign, textBaseline?: TextVerticalAlign): BoundingRect;
export declare function getBoundingRect(text: string, font: string, textAlign?: TextAlign, textBaseline?: TextVerticalAlign): BoundingRect;
export declare function adjustTextX(x: number, width: number, textAlign: TextAlign): number;
export declare function adjustTextY(y: number, height: number, verticalAlign: TextVerticalAlign): number;
export declare function getLineHeight(font?: string): number;
export declare function measureText(text: string, font?: string): {
width: number;
};
export declare function parsePercent(value: number | string, maxValue: number): number;
export interface TextPositionCalculationResult {
x: number;
y: number;
align: TextAlign;
verticalAlign: TextVerticalAlign;
}
export declare function calculateTextPosition(out: TextPositionCalculationResult, opts: {
position?: BuiltinTextPosition | (number | string)[];
distance?: number;
global?: boolean;
}, rect: RectLike): TextPositionCalculationResult;