UNPKG

illustrator.js

Version:

JavaScript image processing library

26 lines (25 loc) 1.16 kB
/// <reference types="node" /> import { ToolBox } from "../base/ToolBox"; export declare class TextTool extends ToolBox { registerFont(font: Buffer, nameAlias?: string): boolean; registerFontPath(fontPath: string, nameAlias?: string): boolean; registerFontsDir(fontDir: string): number; getFonts(): { family: string; styles: { weight: number; width: string; style: string; }[]; }[]; hasFont(name: string): boolean; setDirection(direction: "inherit" | "ltr" | "rtl"): this; setTextAlignment(alignment: "center" | "end" | "left" | "right" | "start"): this; setTextBaseline(alignment: "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top"): this; setFont(name: string, size: string, style?: string): this; setColor(color: string | CanvasGradient | CanvasPattern): this; setStrokeColor(color: string | CanvasGradient | CanvasPattern): this; writeText(text: string, x: number, y: number, maxWidth?: number): this; strokeText(text: string, x: number, y: number, maxWidth?: number): this; measure(text: string): TextMetrics; }