@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.
51 lines (50 loc) • 2.22 kB
TypeScript
import { type Level, type Valence } from "../../generate/index.js";
import { type RowCompactModeOption } from "../index.js";
import { type TertiarySegmentName } from "./segment.js";
/** An object mapping levels to their corresponding diacritics. */
export declare const LEVEL_TO_DIACRITIC_MAP: {
readonly MIN: "DOT";
readonly SBE: "HORIZ_WITH_TOP_LINE";
readonly IFR: "VERT_WITH_LEFT_LINE";
readonly DFC: "CURVE_TO_TOP";
readonly EQU: "DIAG_BAR";
readonly SUR: "CURVE_TO_BOTTOM";
readonly SPL: "VERT_WITH_RIGHT_LINE";
readonly SPQ: "HORIZ_WITH_BOTTOM_LINE";
readonly MAX: "HORIZ_BAR";
};
/** Information about a tertiary character. */
export interface TertiaryCharacter {
/** Whether this character is handwritten. */
readonly handwritten?: boolean | undefined;
/** The absolute level shown on the character. */
readonly absoluteLevel?: Level | undefined;
/** The top segment of the character. */
readonly top?: TertiarySegmentName | undefined;
/** The valence segment of the character. */
readonly valence?: Valence | undefined;
/** The bottom segment of the character. */
readonly bottom?: TertiarySegmentName | undefined;
/** The relative level shown on the character. */
readonly relativeLevel?: Level | undefined;
/**
* Whether compact mode should be used to place level diacritics, 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;
}
/**
* Renders a tertiary character as a group of SVG paths.
*
* @param tertiary Information about the tertiary character.
* @returns An `SVGGElement` containing the tertiary character's elements.
*/
export declare function Tertiary(tertiary: TertiaryCharacter): SVGGElement;