Skip to content
rigkidPublic

About

SVG import/export for ParsedPathDoc / CPaths

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

rigSvg

preview

SVG to ParsedPathDoc - layers of CPaths plus the doc CPaintLibrary. Projects that bag through a RigWorks document (writeDocument / readDocument).

Import: path (M/L/H/V/C/S/Q/T/A/Z - arcs stay A, smooth S/T), line, rect, circle, ellipse, polyline, polygon, nested g layers, transform, root viewBox, fill/stroke colours, stroke-width, <text> / <textPath>, clipPath, @font-face, <linearGradient> / <radialGradient> via url(#...).

Export: groups per layer, solid fill/stroke, gradient defs (OkLab/HSV densify to sRGB stops; intensity bakes in linear light and clamps), analytic A, text, clip, and named font-faces.

Depends on rigPlotComponent.

When a host IMui is attached, the pack registers a .svg file-browser Icons decoder. The worker paints PathFlatten contours and stamps glyphs with the imstb_truetype.h already shipped by rigImTui / rigImGui (no extra copy). CPU RGBA (Blend2D only if that target is already linked). Import/export is still loadFile / writeFile. The fallback face is Roboto-Regular.ttf from the host fonts directory.

rigkit::plot::ParsedPathDoc doc;
rigkit::svg::loadFile(path, doc);
std::string json;
rigkit::svg::writeDocument(doc, json);
rigkit::svg::writeFile(doc, outPath, paperWmm, paperHmm);

Style

Format first-party src/ and examples/ with clang-format before commit (never third_party/).

./tools/format.sh
./tools/install-hooks.sh    # once per clone - pre-commit formats staged C/C++

Hooks only look for clang-format on PATH and warn, without formatting, when it is missing. Put it on PATH:

  • Windows: install LLVM (enable "Add LLVM to the system PATH"), or winget install LLVM.LLVM, then open a new shell. Confirm: clang-format --version.
  • macOS: brew install clang-format
  • Linux: sudo apt install clang-format

From a RigKit host checkout, ./tools/install-hooks.sh wires every pack repo. Full policy: RigKit packs Style.

API/docs

About

SVG import/export for ParsedPathDoc / CPaths

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages