Skip to content

Add SVGExporter with full PAGX-to-SVG conversion support#3317

Open
OnionsYu wants to merge 66 commits intoTencent:mainfrom
OnionsYu:feature/onionsyu_svg_export
Open

Add SVGExporter with full PAGX-to-SVG conversion support#3317
OnionsYu wants to merge 66 commits intoTencent:mainfrom
OnionsYu:feature/onionsyu_svg_export

Conversation

@OnionsYu
Copy link
Contributor

@OnionsYu OnionsYu commented Mar 12, 2026

Summary

  • Add SVGExporter class implementing full PAGX-to-SVG conversion, including support for fills, strokes, gradients, image patterns, blend modes, Display P3 color space, shadow filters, color matrix/blend filters, masks, clipPaths, text alignment, and custom data attributes.
  • Add export-svg CLI command for exporting PAGX files to SVG format.
  • Extract SVG-specific test cases into PAGXSVGTest.cpp and add roundtrip test suite for CLI export.

Key Changes

  • New files: SVGExporter.h, SVGExporter.cpp, CommandExportSVG.cpp/.h, PAGXSVGTest.cpp
  • Refactored: SVGImporter.cpp (fix pattern import round-trip), PAGXTest.cpp (extract SVG tests), PAGXCliTest.cpp (add CLI roundtrip tests)
  • Internal improvements: SVGWriter class encapsulation, SVGBuilder optimizations, shared def ID counter to avoid collisions in nested writers

Test Plan

  • All existing PAGX tests pass
  • New SVG export roundtrip tests pass
  • CLI export-svg command works correctly

Made with Cursor

OnionsYu added 29 commits March 11, 2026 20:57
…std::clamp, fix prefix check, and reserve P3 style string

Made-with: Cursor
…AGXFile/SaveSVGFile into a single SaveFile helper

Made-with: Cursor
…export

# Conflicts:
#	.codebuddy/skills/pagx/SKILL.md
#	src/cli/main.cpp
#	test/src/PAGXCliTest.cpp
@OnionsYu OnionsYu requested a review from kevingpqi123 as a code owner March 12, 2026 09:19
@OnionsYu OnionsYu force-pushed the feature/onionsyu_svg_export branch from 78513b9 to f4131d8 Compare March 18, 2026 13:04
@OnionsYu OnionsYu force-pushed the feature/onionsyu_svg_export branch 2 times, most recently from bdf1f7a to 90ab2fd Compare March 18, 2026 13:44
@OnionsYu OnionsYu force-pushed the feature/onionsyu_svg_export branch from ba199e9 to afc3165 Compare March 19, 2026 02:22
@codecov-commenter
Copy link

codecov-commenter commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 70.81232% with 521 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.22%. Comparing base (1db9626) to head (4abbaa2).

Files with missing lines Patch % Lines
src/pagx/svg/SVGExporter.cpp 71.54% 180 Missing and 55 partials ⚠️
src/pagx/svg/SVGTextLayout.cpp 6.31% 191 Missing and 2 partials ⚠️
src/cli/CommandConvert.cpp 41.84% 68 Missing and 14 partials ⚠️
test/src/PAGXSVGTest.cpp 98.06% 3 Missing and 7 partials ⚠️
src/pagx/svg/SVGImporter.cpp 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3317      +/-   ##
==========================================
- Coverage   75.29%   75.22%   -0.08%     
==========================================
  Files         504      509       +5     
  Lines       33422    35211    +1789     
  Branches    10673    11270     +597     
==========================================
+ Hits        25166    26487    +1321     
- Misses       6032     6424     +392     
- Partials     2224     2300      +76     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

onionsyu and others added 3 commits March 19, 2026 13:06
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…export

# Conflicts:
#	src/pagx/svg/SVGBlendMode.h
#	test/baseline/version.json
@OnionsYu OnionsYu force-pushed the feature/onionsyu_svg_export branch from 0bd71ab to 74b9c75 Compare March 20, 2026 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants