UNPKG

ag-charts-community

Version:

Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue

72 lines (71 loc) 2.43 kB
import { Shape } from "./shape"; import { BBox } from "../bbox"; export declare type FontStyle = 'normal' | 'italic' | 'oblique'; export declare type FontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'; export declare class Text extends Shape { static className: string; protected static defaultStyles: { fill: string; stroke: undefined; strokeWidth: number; lineDash: undefined; lineDashOffset: number; lineCap: import("./shape").ShapeLineCap; lineJoin: import("./shape").ShapeLineJoin; opacity: number; fillShadow: undefined; strokeShadow: undefined; } & { textAlign: CanvasTextAlign; fontStyle: undefined; fontWeight: undefined; fontSize: number; fontFamily: string; textBaseline: CanvasTextBaseline; }; private _x; set x(value: number); get x(): number; private _y; set y(value: number); get y(): number; private lineBreakRegex; private lines; private splitText; private _text; set text(value: string); get text(): string; private _font?; get font(): string; private _dirtyFont; set dirtyFont(value: boolean); get dirtyFont(): boolean; private _fontStyle?; set fontStyle(value: FontStyle | undefined); get fontStyle(): FontStyle | undefined; private _fontWeight?; set fontWeight(value: FontWeight | undefined); get fontWeight(): FontWeight | undefined; private _fontSize; set fontSize(value: number); get fontSize(): number; private _fontFamily; set fontFamily(value: string); get fontFamily(): string; private _textAlign; set textAlign(value: CanvasTextAlign); get textAlign(): CanvasTextAlign; private _textBaseline; set textBaseline(value: CanvasTextBaseline); get textBaseline(): CanvasTextBaseline; private _lineHeight; set lineHeight(value: number); get lineHeight(): number; computeBBox(): BBox | undefined; private getPreciseBBox; private getApproximateBBox; isPointInPath(x: number, y: number): boolean; isPointInStroke(x: number, y: number): boolean; render(ctx: CanvasRenderingContext2D): void; } export declare function getFont(fontSize: number, fontFamily: string, fontStyle?: string, fontWeight?: string): string;