import { Polygons } from "../../polygons.js"; import { Stroke } from "../../stroke.js"; import { FontInterface, StrokeDrawer } from "../index.js"; import { KShotai } from "../shotai.js"; interface MinchoAdjustedStroke { readonly stroke: Stroke; /** Value computed by {@link Mincho.adjustKirikuchi} if a1 = 2 and a2 = 32 and x1 > x2 and y1 < y2; otherwise equals to a2_opt_1 */ kirikuchiAdjustment: number; /** Value computed by {@link Mincho.adjustTate} if a1 in {1,3,7} and x1 = x2; otherwise equals to a2_opt_2 + a2_opt_3 * 10 */ tateAdjustment: number; /** Value computed by {@link Mincho.adjustHane} if a1 in {1,2,6} and a3 = 4; otherwise equals to a3_opt_1 */ haneAdjustment: number; /** Value computed by {@link Mincho.adjustUroko} or {@link Mincho.adjustUroko2} if a1 = 1 and a3 = 0; otherwise equals to a3_opt */ urokoAdjustment: number; /** Value computed by {@link Mincho.adjustKakato} if a1 = 1 and a3 in {13,23}; otherwise equals to a3_opt */ kakatoAdjustment: number; /** Value computed by {@link Mincho.adjustMage} if a1 = 3 and y2 = y3; otherwise equals to a3_opt_2 */ mageAdjustment: number; } /** @internal */ export declare function dfTransform(polygons: Polygons, x1: number, y1: number, x2: number, y2: number, a2_100: number, a3_100: number, a2_opt: number, a3_opt: number): void; /** Mincho-style font (明朝体). */ declare class Mincho implements FontInterface { readonly shotai: KShotai; /** * Precision for polygon approximation of curving strokes. * It must be a positive divisor of 1000. A smaller `kRate` will result in * smoother curves approximated with a larger number of points (roughly * 2 × 1000 / `kRate` per curve stroke). */ kRate: number; /** Half of the width of mincho-style horizontal (thinner) strokes. */ kMinWidthY: number; /** Determines the size of ウロコ at the 開放 end of mincho-style horizontal strokes. */ kMinWidthU: number; /** Half of the width of mincho-style vertical (thicker) strokes. */ kMinWidthT: number; /** * Half of the width of gothic-style strokes. * Also used to determine the size of mincho's ornamental elements. */ kWidth: number; /** Size of カカト in gothic. */ kKakato: number; /** Width at the end of 右払い relative to `2 * kMinWidthT`. */ kL2RDfatten: number; /** Size of the curve at the end of 左ハネ, and at the middle of 折れ and 乙線 strokes. */ kMage: number; /** * Whether to use off-curve points to approximate curving strokes * with quadratic Bézier curves (experimental). */ kUseCurve: boolean; /** Length of 左下カド's カカト in mincho for each shortening level (0 to 3) and 413 (左下zh用新). */ kAdjustKakatoL: number[]; /** Length of 右下カド's カカト in mincho for each shortening level (0 to 3). */ kAdjustKakatoR: number[]; /** Width of the collision box below カカト for shortening adjustment. */ kAdjustKakatoRangeX: number; /** Height of the collision box below カカト for each shortening adjustment level (0 to 3). */ kAdjustKakatoRangeY: number[]; /** Number of カカト shortening levels. Must be set to 3. */ kAdjustKakatoStep: number; /** Size of ウロコ at the 開放 end of mincho-style horizontal strokes for each shrinking level (0 to max({@link kAdjustUrokoLengthStep}, {@link kAdjustUroko2Step})). */ kAdjustUrokoX: number[]; /** Size of ウロコ at the 開放 end of mincho-style horizontal strokes for each shrinking level (0 to max({@link kAdjustUrokoLengthStep}, {@link kAdjustUroko2Step})). */ kAdjustUrokoY: number[]; /** Threshold length of horizontal strokes for shrinking its ウロコ for each adjustment level ({@link kAdjustUrokoLengthStep} to 1). */ kAdjustUrokoLength: number[]; /** Number of ウロコ shrinking levels by adjustment using collision detection. */ kAdjustUrokoLengthStep: number; /** Size of the collision box to the left of ウロコ at the 開放 end of mincho-style horizontal strokes for each shrinking adjustment level ({@link kAdjustUrokoLengthStep} to 1). */ kAdjustUrokoLine: number[]; /** Number of ウロコ shrinking levels by adjustment based on the density of horizontal strokes. */ kAdjustUroko2Step: number; /** Parameter for shrinking adjustment of ウロコ based on the density of horizontal strokes. */ kAdjustUroko2Length: number; /** Parameter for thinning adjustment of mincho-style vertical strokes. */ kAdjustTateStep: number; /** Parameter for thinning adjustment of the latter half of mincho-style 折れ strokes. */ kAdjustMageStep: number; constructor(); setSize(size?: number): void; /** @internal */ getDrawers(strokesArray: Stroke[]): StrokeDrawer[]; /** @internal */ adjustStrokes(strokesArray: Stroke[]): MinchoAdjustedStroke[]; protected adjustHane(adjStrokes: MinchoAdjustedStroke[]): MinchoAdjustedStroke[]; protected adjustMage(adjStrokes: MinchoAdjustedStroke[]): MinchoAdjustedStroke[]; protected adjustTate(adjStrokes: MinchoAdjustedStroke[]): MinchoAdjustedStroke[]; protected adjustKakato(adjStrokes: MinchoAdjustedStroke[]): MinchoAdjustedStroke[]; protected adjustUroko(adjStrokes: MinchoAdjustedStroke[]): MinchoAdjustedStroke[]; protected adjustUroko2(adjStrokes: MinchoAdjustedStroke[]): MinchoAdjustedStroke[]; protected adjustKirikuchi(adjStrokes: MinchoAdjustedStroke[]): MinchoAdjustedStroke[]; } export default Mincho;