@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.
24 lines (23 loc) • 909 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({
FNC: "DOT",
RPS: "HORIZ_BAR",
AMG: "DIAG_BAR",
});
/**
* Creates the superposed 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 PrimarySuperPosed({ handwritten, context, }) {
if (!context || context == "EXS") {
return undefined;
}
const diacriticName = DIACRITICS[context];
return (_jsx(Anchor, { at: "bc", children: _jsx(Diacritic, { handwritten: handwritten, name: diacriticName }) }));
}