Skip to content

Add PAGX-to-HTML exporter with standards-compliant CSS/SVG rendering pipeline, WOFF2 glyph embedding, and SVG filter composition#3439

Open
shlzxjp wants to merge 677 commits into
mainfrom
feature/henryjpxie_pagx_html
Open

Add PAGX-to-HTML exporter with standards-compliant CSS/SVG rendering pipeline, WOFF2 glyph embedding, and SVG filter composition#3439
shlzxjp wants to merge 677 commits into
mainfrom
feature/henryjpxie_pagx_html

Conversation

@shlzxjp
Copy link
Copy Markdown
Collaborator

@shlzxjp shlzxjp commented May 19, 2026

实现 PAGX 文档到 HTML 的完整导出能力,支持在浏览器中高保真渲染 PAGX 设计稿。

主要功能:

  • 公共 API:HTMLExporter::ToHTML / ToFile,极简接口 + Options 结构体
  • 渐变系统:Linear/Radial/Conic/Diamond 渐变的 CSS/SVG 双路径输出
  • 文本渲染:WOFF2 嵌入字体生成、TextPath/TextModifier/TextBox 完整支持
  • 滤镜管线:Blur/DropShadow/InnerShadow SVG filter 链,PlusDarker blend 特殊处理
  • Mask/Clip:Alpha/Luminance mask 通过 SVG data-URI,Contour mask 通过 clip-path
  • 布局系统:Flex 容器/子项、Repeater 展开、Group flatten
  • 图像处理:ImagePattern CSS/PNG 双路径,静态图导出

代码质量保障(经四轮深度评审):

  • 零 hack/trick,CSS 属性映射严格遵循 W3C 规范
  • 防御性编程:数组越界、空指针、整数溢出、XSS 注入全面防护
  • 性能优化:Path/Filter/Gradient 定义去重,SVG vs CSS 智能决策
  • 可维护性:大函数拆分(colorToCSS、renderSVG、writeLayer)、RAII guard、分区注释
  • 编码规范:零 lambda、零 dynamic_cast、零异常、命名规范全部合规

shlzxjp added 30 commits April 22, 2026 20:05
…ter radial-gradient element-local coordinate fix.
…fx mirror to keep writingMode and textAlign intact.
shlzxjp added 22 commits May 18, 2026 16:26
…helper, split renderSVG into focused methods, add section comments and math documentation.
…ir, fix single-stop gradient offset, increase CSS float precision to 4 decimals, guard usLastCharIndex overflow.
…, CBDT offset overflow protection, and null image pointer validation.
…e, writeLayerInner, and ReversePathDataToSVGString.
…ropShadowFilterDef, and emitInnerShadowFilterDef.
…t semantic class names, and remove duplicate section header.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 19, 2026

Codecov Report

❌ Patch coverage is 67.51139% with 1782 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.60%. Comparing base (8ee29c2) to head (325d6dd).

Files with missing lines Patch % Lines
src/pagx/html/HTMLWriterShape.cpp 68.97% 376 Missing and 134 partials ⚠️
src/pagx/html/HTMLWriterColor.cpp 36.43% 222 Missing and 31 partials ⚠️
src/pagx/svg/SVGImporter.cpp 3.26% 176 Missing and 2 partials ⚠️
src/pagx/html/HTMLWriterFilter.cpp 69.53% 118 Missing and 45 partials ⚠️
src/pagx/html/HTMLStyleExtractor.cpp 76.44% 64 Missing and 91 partials ⚠️
src/pagx/html/HTMLWriterUtils.cpp 59.55% 105 Missing and 39 partials ⚠️
src/pagx/html/HTMLExporter.cpp 70.00% 40 Missing and 20 partials ⚠️
src/pagx/html/HTMLStaticImageRenderer.cpp 64.02% 45 Missing and 14 partials ⚠️
src/pagx/html/HTMLPlusDarkerRenderer.cpp 59.55% 30 Missing and 25 partials ⚠️
src/pagx/html/HTMLWriterGroup.cpp 52.63% 36 Missing and 9 partials ⚠️
... and 9 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3439      +/-   ##
==========================================
- Coverage   81.54%   79.60%   -1.94%     
==========================================
  Files         558      580      +22     
  Lines       51406    60853    +9447     
  Branches    13987    18936    +4949     
==========================================
+ Hits        41917    48443    +6526     
- Misses       6607     8727    +2120     
- Partials     2882     3683     +801     

☔ 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.

@shlzxjp shlzxjp changed the title Add PAGX-to-HTML exporter with comprehensive CSS/SVG rendering pipeline Add PAGX-to-HTML exporter with standards-compliant CSS/SVG rendering pipeline, WOFF2 glyph embedding, and SVG filter composition May 19, 2026
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.

2 participants