You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+18-7Lines changed: 18 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,8 +52,8 @@ Build requires Ghostscript (`gs`) in PATH and Perl.
52
52
53
53
### Terminology
54
54
55
-
"Packaging" refers to PostScript processed into a form easier to distribute but
56
-
is harder to debug:
55
+
"Packaging" refers to PostScript processed (by the build system's "packager")
56
+
into a form easier to distribute but is harder to debug:
57
57
58
58
- Efficient byte-based encodings for numbers and operators
59
59
- Compressed numeric/string arrays
@@ -85,7 +85,7 @@ Build outputs:
85
85
-`build/standalone/<encoder>.ps` - Standalone encoder (manual, only required deps built)
86
86
87
87
88
-
## Resource File Structure
88
+
## Resource Source File Structure
89
89
90
90
Each resource source file has a similar structure:
91
91
@@ -102,8 +102,8 @@ Each resource source file has a similar structure:
102
102
4.**Static data structures**
103
103
- Plain definitions of literal stuctured data (arrays and dicts) that is costly to assemble if executed every call
104
104
- Runs once during resource definition; values immediately referenced by main procedure
105
-
- Names are prefixed with the resource name (e.g., `encoder.charmap`)
106
-
-Names are stored in a temporary dictionary discarded after resource definition, but values persist via immediate reference (`//encoder.static_var`)
105
+
- Names MUST be prefixed with the resource name (e.g., `encoder.charmap`) - the Makefile extracts all `//name` references to populate the packager's atload template, requiring globally unique names
106
+
-`//name` immediate references are resolved at parse time, embedding the value directly into procedures
107
107
- Embedded procedures should have explicit `bind`
108
108
- Must be marked `readonly`
109
109
@@ -118,7 +118,7 @@ Each resource source file has a similar structure:
118
118
- Calls lazy initialisation procedure
119
119
120
120
121
-
### Encoder Metadata
121
+
####Encoder Metadata
122
122
123
123
Encoder source files contain metadata comments:
124
124
@@ -136,6 +136,17 @@ system and is API for users that want to assemble the resources into a PS file
136
136
prolog.
137
137
138
138
139
+
### Resource output file structure
140
+
141
+
Built resource files have a similar structure to their source files, with their
142
+
source (packaged or otherwise) wrapped by comments that follow the PostScript
143
+
language Document Structuring Conventions.
144
+
145
+
-`BeginResource:` DSC comment contains VM memory usage that is measured by the build system per-resource by pre-loading all dependencies before measurement, so each resource's VMusage reflects only its own consumption.
146
+
147
+
Monolithic outputs contain comments that feature a "--BEGIN/END TEMPLATE--" marker pair that users can use to splice the relevant contents into the prolog of a PS document.
148
+
149
+
139
150
### Lazy Initialisation Pattern
140
151
141
152
```postscript
@@ -396,7 +407,7 @@ Large 2D symbols have different runtime bottlenecks, for example:
396
407
## Testing
397
408
398
409
-`tests/run_tests` - Top-level test orchestrator
399
-
-`tests/ps_tests/*.ps.test` - Individual encoder tests (run against packaged resources)
410
+
-`tests/ps_tests/*.ps.test` - Individual encoder tests (run from `build/packaged_resource/Resource` directory)
400
411
-`tests/test_*/run` - Integration tests for each build variant
0 commit comments