UNPKG

@zsnout/ithkuil

Version:

A set of tools which can generate and parse romanized Ithkuil text and which can generate Ithkuil script from text and JSON data.

82 lines (81 loc) 3.37 kB
/** * Whether compact mode should be used, and options applying to it if so. * * In compact mode, intersections are approximated so that letters appear close * together while still fully readable. Compact mode usually produces * better-looking output, but runs much slower. * * In traditional non-compact mode, the rightmost edge of a character and the * leftmost edge of the next character are placed with space between them. * However, this often leads to unusual-looking whitespace. */ export type RowCompactModeOption = { /** * The interval to start approximations with when finding intersections in * compact mode. Lower values give more precision but slower performance, * with both inversely proportional to the value of this property. * * For example, a value of `2` will take five times longer but give five * times better results than a value of `10`. * * It is recommended to use values no smaller than `1`. If additional * precision is needed, adjust `spacingImprovements` instead; it has much * better performance. * * @default 5 */ readonly baseSpacingInterval?: number | undefined; /** * The number of improvements to make when finding intersections in * compact mode. Higher values give exponentially more precision but * linearly slower performance. * * For example, a value of `6` will give 16 times better results than a * value of `2`, but will take three times as long. * * It is recommended to use values no larger than `10`, as doing so will * result in changes so small they are hardly visible to the human eye. * * @default 5 */ readonly spacingImprovements?: number | undefined; } | (boolean & { readonly baseSpacingInterval?: undefined; readonly spacingImprovements?: undefined; }); /** Properties that modify the output of a `Row`. */ export interface RowProps { /** The element(s) to be arranged. */ readonly children?: SVGElement | SVGElement[] | undefined; /** * Whether compact mode should be used, and options applying to it if so. * * In compact mode, intersections are approximated so that letters appear * close together while still fully readable. Compact mode usually produces * better-looking output, but runs much slower. * * In traditional non-compact mode, the rightmost edge of a character and the * leftmost edge of the next character are placed with space between them. * However, this often leads to unusual-looking whitespace. */ readonly compact?: RowCompactModeOption | undefined; /** Elements which should precede the `children`. */ readonly intro?: SVGElement | readonly SVGElement[] | undefined; /** If `true`, stacks in the reverse direction. */ readonly reverse?: boolean | undefined; /** * The amount of space between elements. * * @default 10 */ readonly space?: number | undefined; /** If `true`, makes a vertical column. If `false`, makes a horizontal row. */ readonly vertical?: boolean | undefined; } /** * Combines several shapes into a single row. * * @param props Properties that modify the output of this `Row`. * @returns An `SVGGElement` containing the elements. */ export declare function Row(props: RowProps): SVGGElement;