-
Notifications
You must be signed in to change notification settings - Fork 527
Add pagx embed command, restructure pagx font, and support external font files. #3471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
YyZz-wy
wants to merge
90
commits into
main
Choose a base branch
from
feature/codywwang_cli_embed
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 77 commits
Commits
Show all changes
90 commits
Select commit
Hold shift + click to select a range
fc2706f
Ignore GSD planning directory from version control.
YyZz-wy f6723e6
Add ImageEmbedder header declaring embed and lastErrorPath API.
YyZz-wy 5b6a818
Implement ImageEmbedder with ReadFileToData supporting empty-file and…
YyZz-wy 4c99b91
Add CommandEmbed header declaring RunEmbed entry point.
YyZz-wy 849b4a6
Add pagx embed command orchestrating font and image embedding with sk…
YyZz-wy 1435101
Register pagx embed command and update top-level usage.
YyZz-wy c864a08
Add embed_sample pagx and png fixtures for pagx embed CLI tests.
YyZz-wy 0b403b1
Fix FontEmbedder::ClearEmbeddedGlyphRuns to remove stale Font and Gly…
YyZz-wy b02b1a7
Add EMBED CLI tests covering default embed skip flags missing image a…
YyZz-wy 78de811
Fix FontEmbedder::ClearEmbeddedGlyphRuns to remove stale Font and Gly…
YyZz-wy 9da0451
Replace lambda with explicit loop in FontEmbedder::ClearEmbeddedGlyph…
YyZz-wy 2961465
Retire pagx font embed subcommand with redirect error and drop dead h…
YyZz-wy 7e7d61e
Revise CommandFont header doc comment to query-only scope.
YyZz-wy 103b09b
Add FONT-01 CLI test asserting pagx font embed redirect error.
YyZz-wy 097a127
Add std::nothrow to ImageEmbedder buffer allocation to honor no-excep…
YyZz-wy f7436e6
Document full reset contract of FontEmbedder::ClearEmbeddedGlyphRuns …
YyZz-wy 56e0165
Trim CommandEmbed header doc to a summary and defer flag list to Prin…
YyZz-wy c5d04d1
Add FontFamilyEntry struct and AllFontFamilies declaration to SystemF…
YyZz-wy ebcebb7
Implement SystemFonts::AllFontFamilies for macOS, Windows, Linux, and…
YyZz-wy f0794c7
Flatten pagx font into a single query command and delete the info sub…
YyZz-wy dcfdf36
Rename FontInfo tests to Font, add info redirect and help surface tests.
YyZz-wy 15b57ea
Add --list flag parsing, validation, and system font list formatting …
YyZz-wy 3b31a25
Add FontList text, JSON, and mutual exclusion tests for pagx font --l…
YyZz-wy a6e759b
Update CommandFont.h comment to reflect removed subcommands.
YyZz-wy 1bad5eb
Eliminate redundant map lookup in SystemFonts Linux AllFontFamilies.
YyZz-wy 32f58fe
Move EmbedOptions and helpers inside namespace pagx::cli.
YyZz-wy b8c47d2
Rename misleading Font_HelpShowsNewSurface test to Font_HelpShowsCurr…
YyZz-wy a3b86aa
Update npm README to reflect renamed font and embed commands.
YyZz-wy 43d0ebd
Add font-not-embedded assertion to Embed_SkipFonts_ImagesOnly test.
YyZz-wy 15cb770
Add font-embedded assertion to Embed_SkipImages_FontsOnly test.
YyZz-wy 5cdebbf
Deduplicate file reads for identical paths in ImageEmbedder.
YyZz-wy 0091dd1
Warn when --size is used with --list in pagx font command.
YyZz-wy a627d27
Fix embed command description to distinguish font glyph embedding fro…
YyZz-wy 5bb47f9
Reuse existing image_as_mask.png for embed tests instead of a duplica…
YyZz-wy 08f5f14
Align npm README embed command description and flag text with CLI hel…
YyZz-wy 7d678ec
Assert font node is embedded in Embed_FontFlags_AcceptedLikeOldSubcom…
YyZz-wy 0dcaef4
Assert font node is embedded in Embed_BothDefault_EmbedsFontsAndImages.
YyZz-wy 9b37b03
Assert FontList text output contains at least two non-empty family li…
YyZz-wy 36b1000
Loosen FontList_JsonOutput to check for family and styles tokens inst…
YyZz-wy 40ae84c
Use word-boundary check for retired info subcommand in Font_HelpShows…
YyZz-wy f07cedd
Document macOS AllFontFamilies API choice over CTFontManagerCopyAvail…
YyZz-wy 3735a12
Remove pre-C++11 template space in SystemFonts.cpp nested vector type.
YyZz-wy d7d8384
Update SystemFonts class doc to cover AllFontFamilies in addition to …
YyZz-wy 0352774
Track --size presence via bool flag so explicit default value still t…
YyZz-wy a601ce1
Revert template space fix that conflicts with project clang-format co…
YyZz-wy 2ed17a1
codeformat
YyZz-wy da92e93
Revert LayerBuilder.cpp and .gitignore to main branch state.
YyZz-wy 2c79ea4
Add codebase map to .planning/codebase/.
YyZz-wy ebb7ce4
Add SystemFonts::FindFont fallback for CLI font resolution on FreeTyp…
YyZz-wy 14d2021
Fix use-after-free in FontEmbedder nodeMap cleanup and harden embed C…
YyZz-wy f437e0d
Reorder nodeMap cleanup before node compaction to avoid use-after-fre…
YyZz-wy e5c1618
Use known URL scheme prefixes in IsUrlPath to avoid false positives o…
YyZz-wy e61ee9b
Remove unused sizeSpecified field from FontOptions after warning remo…
YyZz-wy d38388f
Support Windows backslash path separators in CliUtils path functions.
YyZz-wy 75a4b6f
Lowercase font extension before comparison to make case-insensitive m…
YyZz-wy 6e32c4c
Check return value of loadFileData in ImageEmbedder to detect missing…
YyZz-wy 6e7ad22
Show concrete input path in embed usage line instead of placeholder s…
YyZz-wy 565fb30
Remove .planning/codebase/ from repository and add .planning/ to giti…
YyZz-wy 8396456
Stop tracking .planning/codebase/ files from repository index.
YyZz-wy 6a3251b
Implement SystemFonts::FindFont for Windows using DirectWrite FindFam…
YyZz-wy a21eac1
Stop ignoring AI planning artifacts.
YyZz-wy ee06e50
Fix code review issues from PR #3405 second round review.
YyZz-wy ebc82dd
Add file attribute to PAGX Font node with XSD schema and import/expor…
YyZz-wy 1b95b5d
Auto-register fonts from Font file attribute in pagx embed and update…
YyZz-wy 8e4ead0
Update skills docs and add CLI tests for Font file attribute auto-reg…
YyZz-wy 68c863e
Fix dangling glyph pointers in ClearEmbeddedGlyphRuns and remove unus…
YyZz-wy bafc4ef
Fix stale comment in ImageEmbedder.h to reflect all-or-nothing semant…
YyZz-wy f3fd086
Make IsUrlPath case-insensitive per RFC 3986 Section 3.1.
YyZz-wy a954969
Fix CFMutableDictionaryRef leak on CFSetCreate failure in FindFont.
YyZz-wy edf4412
Remove documented --file/--font-file flags from pagx embed per Comman…
YyZz-wy 2129274
Remove unused tempPng copy from Embed_FileFlag_RejectedAsUnknown that…
YyZz-wy 7c71e51
Lift duplicated glyph-removal loop in ClearEmbeddedGlyphRuns above th…
YyZz-wy ef24936
Update Font::file doc-comment to match the embed flow that preserves …
YyZz-wy d1f6586
Rewrite pagx font cli reference to match the flat command and drop re…
YyZz-wy 815d1fa
Extract ResolveRelativePath helper to deduplicate Image and Font path…
YyZz-wy 6e4f513
Add missing StreamCapture RAII helper used by Font file CLI tests.
YyZz-wy 38eb8f4
Run clang-format on PAGXDocument.cpp to satisfy project style.
YyZz-wy a7c64a0
Fix Windows font path resolution and path comments.
YyZz-wy 3c04ca3
Merge remote-tracking branch 'origin/main' into feature/codywwang_cli…
YyZz-wy 17e370f
Remove duplicated MakeStandaloneParams in Text and reuse the one from…
YyZz-wy 6fa0fd7
Add missing Font file import round-trip test for Phase 3 plan 03.
YyZz-wy b90fe4b
Make removeNodes, setNodeId and resetLayoutState private with FontEmb…
YyZz-wy 890fb04
Error when --skip-fonts and --fallback are both set in embed command.
YyZz-wy 1cd6eac
Fix IsUrlPath to also match data: URI scheme.
YyZz-wy 54f6708
Preserve Font file original path across import/export round-trip.
YyZz-wy 9d07c41
Unify atomic write in WriteStringToFile, fix font ID collision, remov…
YyZz-wy edce376
Merge remote-tracking branch 'origin/main' into feature/codywwang_cli…
YyZz-wy d31df93
Merge remote-tracking branch 'origin/main' into feature/codywwang_cli…
YyZz-wy e738016
Update screenshot baseline for layout_flex_weights test.
YyZz-wy 1d4e909
Update screenshot baseline for spec app_icons game_hud glyph_run and …
YyZz-wy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <pagx width="400" height="200"> | ||
| <Layer> | ||
| <TextBox textAlign="center"> | ||
| <Text text="Hello PAGX" fontFamily="Noto Sans SC" fontSize="32"/> | ||
| <Fill color="#000000"/> | ||
| </TextBox> | ||
| </Layer> | ||
| <Resources> | ||
| <Font id="noto" file="NotoSansSC-Regular.otf" unitsPerEm="1000"/> | ||
| </Resources> | ||
| </pagx> |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <pagx width="200" height="200"> | ||
| <Layer> | ||
| <Rectangle left="10" top="10" width="80" height="80"/> | ||
| <Fill> | ||
| <ImagePattern image="@sample" matrix="0.3,0,0,0.3,0,0" tileModeX="clamp" tileModeY="clamp"/> | ||
| </Fill> | ||
| </Layer> | ||
| <Layer> | ||
| <TextBox textAlign="center"> | ||
| <Text text="Hello" fontFamily="Helvetica" fontSize="24"/> | ||
| <Fill color="#000000"/> | ||
| </TextBox> | ||
| </Layer> | ||
| <Resources> | ||
| <Image id="sample" source="image_as_mask.png"/> | ||
| </Resources> | ||
| </pagx> |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removeNodes/setNodeId/resetLayoutState三个新方法本质上是为FontEmbedder::ClearEmbeddedGlyphRuns服务的内部协作接口,却暴露在公开头文件include/pagx/PAGXDocument.h中。第三方调用者一旦使用removeNodes,就要承担注释里写的"any external pointers… become dangling"风险,没有任何编译期或运行期保护。建议把这三个方法改成private+friend class FontEmbedder,或者迁移到内部头文件,避免污染公开 API surface。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改