libpag icon indicating copy to clipboard operation
libpag copied to clipboard

Add pagx embed command, restructure pagx font, and support external font files.

Open YyZz-wy opened this issue 6 months ago • 1 comments

本 PR 整合 PAGX CLI 的三阶段重构:

  1. 新增 pagx embed 命令:统一字形与图片嵌入流程,支持 --skip-fonts / --skip-images / --fallback 选项;ImageEmbedder 与 FontEmbedder 拆分清晰。
  2. 重构 pagx font 命令:扁平化为单一查询命令,移除 embed 子命令(保留兼容重定向),新增 --list 列出系统字体。
  3. PAGX Font 节点新增 file 属性:可引用外部字体文件,pagx embed 自动扫描并注册字体到 FontConfig,无需 --font-file 参数;ClearEmbeddedGlyphRuns 在 Font 含 file 时保留节点结构仅清除 Glyph 子节点,支持幂等 re-embed。

附带 SystemFonts 在 macOS / Windows / Linux / FreeType 后端新增 AllFontFamilies 与 FindFont 实现,修复若干内存泄漏与悬空指针问题,并更新 spec、skills 文档及 CLI 测试。

YyZz-wy avatar May 29 '26 08:05 YyZz-wy

Codecov Report

:x: Patch coverage is 78.18599% with 190 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 82.33%. Comparing base (77a8c79) to head (e165f32).

Files with missing lines Patch % Lines
src/pagx/SystemFonts.cpp 36.27% 53 Missing and 12 partials :warning:
src/cli/CliUtils.h 17.24% 22 Missing and 2 partials :warning:
test/src/PAGXCliTest.cpp 93.71% 6 Missing and 18 partials :warning:
src/cli/CommandEmbed.cpp 74.44% 12 Missing and 11 partials :warning:
src/cli/CommandFont.cpp 80.51% 12 Missing and 3 partials :warning:
src/renderer/ImageEmbedder.cpp 61.29% 5 Missing and 7 partials :warning:
src/pagx/PAGXDocument.cpp 83.07% 6 Missing and 5 partials :warning:
src/cli/CliUtils.cpp 50.00% 6 Missing and 3 partials :warning:
src/renderer/FontEmbedder.cpp 80.00% 3 Missing and 3 partials :warning:
src/pagx/PAGXImporter.cpp 90.00% 0 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3471      +/-   ##
==========================================
+ Coverage   82.27%   82.33%   +0.05%     
==========================================
  Files         691      695       +4     
  Lines       87954    88675     +721     
  Branches    25281    25482     +201     
==========================================
+ Hits        72368    73011     +643     
- Misses      10301    10316      +15     
- Partials     5285     5348      +63     

:umbrella: View full report in Codecov by Harness.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov-commenter avatar May 29 '26 09:05 codecov-commenter