ConscriptRender.h header
#include <ew/app/ConscriptRender.h>
Namespace ew::app
Functions
QString ew::app::script::composeGlyphSvg(const ew::core::conlang::WritingSystem &writing, const std::vector< QString > &primitiveIds, double size=100.0)
Assembles the glyph that primitiveIds spell in writing as SVG content, placing each primitive in the matching slot of the script's ew::core::conlang::GlyphComposition within a size-unit box.
This is what makes a featural script's inventory GENERATED rather than authored: a script with a few dozen primitives implies thousands of symbols, and drawing each by hand is both intractable and destroys the systematic relationship between them that the design encodes.
Returns an empty string when the script composes nothing, when no primitive is given, or when a primitive does not satisfy the ew::core::conlang::CompositionSlot::fills requirement of the slot it would occupy – a mis-assembled symbol is a wrong claim about the script, so it is not drawn. Primitives beyond the last slot are ignored.
QString ew::app::script::glyphTransformAttribute(ew::core::conlang::GlyphTransform transform, double size)
The SVG transform attribute that produces transform within a size-unit box, or an empty string for a transform that is the identity.
Centred on the box so a flip or rotation stays where the glyph was drawn instead of leaving it. The axis each transform names is defined on ew::core::conlang::GlyphTransform; a mirror-y is a flip across the HORIZONTAL axis, which preserves the left-to-right order of a glyph's parts – the property a script relies on when it inverts a meaning by flipping the symbol.
std::vector< QString > ew::app::script::renderGlyphSequence(const ew::core::conlang::WritingSystem &writing, const QString &word)
Converts word (written in the language's romanization) into the ordered sequence of glyph names that spell it in writing, greedily matching the longest ligature or glyph grapheme at each position and reversing the order for a right-to-left script. A run of characters that maps to no glyph is kept verbatim as its own token, so unmapped text survives. This is the "render in
script" step – the sequence a renderer draws.
QString ew::app::script::renderWordSvg(const ew::core::conlang::WritingSystem &writing, const QString &word, int glyphSize=100)
Renders word in writing as a standalone SVG document: each glyph's outline is placed in a glyphSize-pixel cell advancing along the script's writing direction (left-to-right, right-to-left, or top-to-bottom), with any unmapped token drawn as text. This is the script's artwork/asset export – a shareable image of the word in the constructed script. Returns an empty string when word is empty or glyphSize is not positive.