@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.
25 lines (24 loc) • 940 B
JavaScript
import { jsx as _jsx } from "@zsnout/ithkuil-jsx/jsx-runtime";
import { deepFreezeAndNullPrototype } from "../../generate/index.js";
import { Diacritic } from "../other/diacritic.js";
import { Anchor } from "../utilities/anchor.js";
const DIACRITICS = /* @__PURE__ */ deepFreezeAndNullPrototype({
"UNF/K": "DOT",
FRM: "HORIZ_BAR",
1: "VERT_BAR",
2: "HORIZ_WITH_BOTTOM_LINE",
});
/**
* Creates the underposed diacritic of a primary character as an SVG path.
*
* @param props Properties that modify the diacritic.
* @returns An `SVGPathElement` containing the diacritic, or `undefined` if no
* diacritic is needed.
*/
export function PrimaryUnderPosed({ handwritten, bottom = "UNF/C", }) {
if (bottom == "UNF/C") {
return undefined;
}
const diacriticName = DIACRITICS[bottom];
return (_jsx(Anchor, { at: "tc", children: _jsx(Diacritic, { handwritten: handwritten, name: diacriticName }) }));
}