Add SVGExporter with full PAGX-to-SVG conversion support#3317
Open
OnionsYu wants to merge 34 commits intoTencent:mainfrom
Open
Add SVGExporter with full PAGX-to-SVG conversion support#3317OnionsYu wants to merge 34 commits intoTencent:mainfrom
OnionsYu wants to merge 34 commits intoTencent:mainfrom
Conversation
…std::clamp, fix prefix check, and reserve P3 style string Made-with: Cursor
… into SVGWriterContext 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
…eference Made-with: Cursor
…skew, anchor, position, alpha) Made-with: Cursor
shlzxjp
reviewed
Mar 13, 2026
|
|
||
| By default the output file has the same base name as the input with a `.svg` extension | ||
| (e.g., `foo.pagx` → `foo.svg`). Use `-o` to override. On success the command prints | ||
| `pagx export-svg: wrote <path>` and exits 0; on failure it prints an error and exits 1. |
Collaborator
There was a problem hiding this comment.
如果失败有具体的错误代码的话,也可以返回具体的错误码
| } | ||
| switch (textBox->paragraphAlign) { | ||
| case ParagraphAlign::Middle: | ||
| y = textBox->position.y + textBox->size.height / 2 + text->fontSize * 0.35f; |
| // Main Export function | ||
| //============================================================================== | ||
|
|
||
| std::string SVGExporter::ToSVG(const PAGXDocument& doc, const Options& options) { |
Collaborator
There was a problem hiding this comment.
另外需要验证一下,pagx转换成svg后,再将svg转换成pagx,二者是否一致。需要保证二者互转信息不跌势,不支持的特性可以考虑额外标记data-前缀的用户参数来标记,目标是避免多次来回转换后信息丢失
added 3 commits
March 13, 2026 16:30
…export # Conflicts: # .codebuddy/skills/pagx/SKILL.md
…orter fixes, CLI rename
… fix, and comment improvements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SVGExporterclass 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.export-svgCLI command for exporting PAGX files to SVG format.PAGXSVGTest.cppand add roundtrip test suite for CLI export.Key Changes
SVGExporter.h,SVGExporter.cpp,CommandExportSVG.cpp/.h,PAGXSVGTest.cppSVGImporter.cpp(fix pattern import round-trip),PAGXTest.cpp(extract SVG tests),PAGXCliTest.cpp(add CLI roundtrip tests)Test Plan
export-svgcommand works correctlyMade with Cursor