/** * Asymmetric Stroke * * Generates stroked outlines with independent X and Y border widths. * This enables effects like directional shadows, stretched borders, * and other asymmetric outline effects. * * The algorithm: * 1. Flatten curves to polylines with configurable precision * 2. For each segment, compute offset vectors scaled by (xBorder, yBorder) * 3. Handle line joins (miter, round, bevel) * 4. Generate both inner and outer contours for closed paths * 5. Handle caps for open paths */ import type { GlyphPath } from "../render/path.ts"; /** * Options for asymmetric stroking */ export interface AsymmetricStrokeOptions { /** X-axis border width (in font units) */ xBorder: number; /** Y-axis border width (in font units) */ yBorder: number; /** Precision for curve flattening (smaller = more accurate, default: 1) */ eps?: number; /** Line join style (default: "round") */ lineJoin?: "miter" | "round" | "bevel"; /** Miter limit for miter joins (default: 4) */ miterLimit?: number; } /** * Stroke a path with asymmetric X/Y borders * For filled text with border: combine outer outline with original fill, * or use outer outline alone for hollow border effect * @param path Input path to stroke * @param options Stroke options including xBorder and yBorder * @returns Two paths: outer (positive offset) and inner (negative offset) */ export declare function strokeAsymmetric(path: GlyphPath, options: AsymmetricStrokeOptions): { outer: GlyphPath; inner: GlyphPath; }; /** * Create a combined stroke path (both inner and outer as single path) * This creates a ring/donut shape that can be filled * @param path Input path to stroke * @param options Stroke options including xBorder and yBorder * @returns Single path containing both outer and inner borders as a fillable ring */ export declare function strokeAsymmetricCombined(path: GlyphPath, options: AsymmetricStrokeOptions): GlyphPath; /** * Stroke with uniform border (convenience function) * @param path Input path to stroke * @param border Border width in font units (applied to both X and Y) * @param options Additional stroke options (precision, line join, miter limit) * @returns Two paths: outer and inner borders */ export declare function strokeUniform(path: GlyphPath, border: number, options?: Omit): { outer: GlyphPath; inner: GlyphPath; };