GlyphSvg.h header

#include <ew/app/GlyphSvg.h>

Namespace ew::app

Functions

QString ew::app::script::glyphPathData(const ew::core::conlang::Glyph &glyph, const ew::core::conlang::WritingSystem &writing, const PenOptions &pen, double size)

The path data for glyph as the script would ink it.

A glyph drawn with strokes is inked with pen; one that has only an ew::core::conlang::Glyph::svgPath returns that path unchanged, so a script authored before the editor existed – or imported from SVG – still renders. A COMPOSED glyph is assembled from writing's primitives through its composition rule.

QString ew::app::script::glyphSvgDocument(const ew::core::conlang::Glyph &glyph, const ew::core::conlang::WritingSystem &writing, const PenOptions &pen, double size)

glyph as a standalone SVG document size units square, for export or a preview.

QString ew::app::script::glyphVariantPathData(const ew::core::conlang::Glyph &glyph, const ew::core::conlang::WritingSystem &writing, const QString &variantName, const PenOptions &pen, double size)

The path data for glyph in the orientation named variantName.

The named variant's transform is applied to the base drawing, so one symbol in two orientations stays one drawing. An unknown name returns the base form rather than an empty glyph: a text that asks for an orientation the script does not define should still be readable.

QString ew::app::script::outlinePathData(const std::vector< ew::core::conlang::StrokePoint > &outline, double size)

The SVG path data (d) for the closed polygon outline, in a size-unit em box.

The model's coordinates are 0..1; SVG wants a box with a size. Scaling here rather than in the model is what lets one drawing serve a 24-pixel preview and a printed specimen without being stored twice.

std::vector< ew::core::conlang::Stroke > ew::app::script::resolvedStrokes(const ew::core::conlang::Glyph &glyph, const ew::core::conlang::WritingSystem &writing)

The strokes glyph is drawn from, with a composed glyph's primitives assembled into place.

Separate from the path so the canvas can edit what it shows: a composed glyph's assembled strokes are what the user sees, and handing back only a path string would leave the editor unable to show where the parts sit.