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.

43 lines (42 loc) 3.95 kB
import { type DiacriticName } from "../index.js"; /** Handwritten core shapes for numerals. */ export declare const HANDWRITTEN_ONES: readonly ["M -20 35 c 0 -40 40 -30 40 -70", "M -20 35 c 0 -15 20 -15 40 0 v -70", "M -20 35 c 0 -20 40 0 40 0 c -70 -30 0 -50 0 -70", "M -20 35 c 0 -15 20 -15 40 0 c 0 -30 -20 -35 -40 -35 c 30 0 40 -15 40 -35", "M -20 35 v -35 c 30 10 40 -15 40 -35", "M -20 35 v -35 c 0 20 15 35 40 35 v -70", "M -20 35 v -27.5 c 0 15 7.5 27.5 20 27.5 c 12.5 0 20 -12.5 20 -27.5 a 17.5 17.5 0 0 0 -17.5 -17.5 a 17.5 17.5 0 0 0 17.5 -17.5 v -7.5", "M -20 35 c 0 -20 10 -45 40 -35 v -35", "M -20 35 c 0 -20 20 -35 40 -35 h -40 c 20 0 40 -15 40 -35", "M -20 35 c 0 -30 20 -35 25 -30 c -15 0 -15 30 0 30 c 15 0 15 -15 15 -35 v -35"]; /** Handwritten hundreds extensions for numerals. */ export declare const HANDWRITTEN_HUNDREDS: readonly ["", "M 20 -35 c -30 0 -40 -15 -40 -15", "M 20 -35 c 0 -30 -50 -30 -35 -15", "M 20 -35 a 10 10 0 0 1 10 -10 c -15 -5 -15 -15 -15 -15", "M 20 -35 a 10 10 0 0 0 -10 -10 c 15 -5 15 -15 15 -15", "M 20 -35 h 30 c -22.5 0 -30 -15 -30 -15", "M 20 -35 h -30 c 22.5 0 30 -15 30 -15", "M 20 -35 a 20 10 0 1 1 10 -15", "M 20 -35 a 20 10 0 1 0 -10 -15", "M 20 -35 c -10 10 -20 -5 -10 -15"]; /** Handwritten tens extensions for numerals. */ export declare const HANDWRITTEN_TENS: readonly ["", "M -20 35 c 30 0 40 15 40 15", "M -20 35 c 0 30 50 30 35 15", "M -20 35 a -10 -10 0 0 1 -10 10 c 15 5 15 15 15 15", "M -20 35 a -10 -10 0 0 0 10 10 c -15 5 -15 15 -15 15", "M -20 35 h -30 c 22.5 0 30 15 30 15", "M -20 35 h 30 c -22.5 0 -30 15 -30 15", "M -20 35 a -20 -10 0 1 1 -10 15", "M -20 35 a -20 -10 0 1 0 10 15", "M -20 35 c 10 -10 20 5 10 15"]; /** * Variants of the handwritten tens extensions for use when the ones digit is 1, * 2, 3, 5, 6, or 9, to provide proper spacing. */ export declare const HANDWRITTEN_TENS_WITH_COLLISIONS: readonly ["", "M -20 35 v 5 c 30 0 40 15 40 15", "M -20 35 c 0 30 50 30 35 15", "M -20 35 a -10 -10 0 0 1 -10 10 c 15 5 15 15 15 15", "M -20 35 a -10 -10 0 0 0 10 10 c -15 5 -15 15 -15 15", "M -20 35 h -30 c 22.5 0 30 15 30 15", "M -20 35 v 10 h 30 c -22.5 0 -30 15 -30 15", "M -20 35 v 5 a -20 -10 0 1 1 -10 15", "M -20 35 a -20 -10 0 1 0 10 15", "M -20 35 v 5 c 10 -10 20 5 10 15"]; /** A special case for XX96 numerals, to provide proper spacing. */ export declare const HANDWRITTEN_96 = "M -20 35 v 10 c 10 -10 20 5 10 15"; /** A special case for XX76 and XX79 numerals, to provide proper spacing. */ export declare const HANDWRITTEN_76_79 = "M -20 35 v 10 a -20 -10 0 1 1 -10 15"; /** Handwritten thousands diacritics for numerals. */ export declare const HANDWRITTEN_THOUSANDS: readonly ["", "M 0 0 h 20", "M 0 0 c 0 12 15 12 15 0", "M 0 0 l 15 15", "M 0 0 l -15 15", "M 0 0 h -15 l 10 10", "M 0 0 h 15 l -10 10", "M 0 0 c 12 0 12 15 0 15", "M 0 0 c -12 0 -12 15 0 15", "M 0 0 c 0 -12 15 -12 15 0"]; /** The positions of handwritten thousands diacritics. */ export declare const HANDWRITTEN_THOUSANDS_POSITIONS: readonly (readonly [number, number])[]; /** Information representing a numeric character. */ export interface NumeralCharacter { /** Whether this character should be handwritten. */ readonly handwritten?: boolean | undefined; /** The value of this character. */ readonly value: number | bigint; /** The diacritic superposed above the character. */ readonly superposed?: DiacriticName | undefined; /** The diacritic posed to the right of the character. */ readonly right?: DiacriticName | undefined; /** The diacritic underposed below the character. */ readonly underposed?: DiacriticName | undefined; } /** A digit from zero to nine. */ export type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; /** * Renders a numeral as a group of SVG paths. * * @param numeral Information about the numeral. * @returns A group of SVG paths. */ export declare function Numeral(numeral: NumeralCharacter): SVGGElement;