Headless workspace admission
Workspace-aware appearance, shaping and ordering functions borrow the existing THPDFWorkspaceAdmission interface from HPDFTypes to share one caller-owned resource ledger
The original entry points remain available and use the nil-workspace path; applications can opt into admission without changing their existing font, Unicode, geometry or object-identity contracts
Admission categories
Reserve(Bytes) admits implemented storage before allocation; a zero-byte reservation is also an operation or cancellation checkpoint
Finish(TemporaryBytes) releases the temporary working-storage category defined by the owner; it does not imply that cumulative charges or object-generation charges are reset
GeneratedObjects, TemporaryObjects and RetainGeneratedObjects distinguish preparation work from final retained PDF identities; temporary AP generation does not silently consume the same committed identity twice
Pascal scratch admissions, native callback admissions, byte charges, polls and retained object identities are different measurements and must not be described as one universal allocation count
Native shaping and ordering
Workspace-aware HarfBuzz and FriBidi calls use matching-architecture libraries with workspace allocator ABI version 1; explicit library paths use HOTPDF_HARFBUZZ_LIBRARY and HOTPDF_FRIBIDI_LIBRARY
The selected module performs its own allocation and operation callbacks while the Pascal caller owns the scope; a native failure returns through C before the original retained Pascal exception is raised
Calls without a borrowed owner continue to use the established native API and do not require workspace exports from an ordinary runtime
Results and cancellation
Borrowed owners must outlive the generation call and its internal cleanup; returned appearance streams detach from that owner before returning, and returned managed arrays do not depend on the owner for later release
The rich-raster decoder holds a local candidate until decoding and the final cancellation check succeed, preventing a late failure from publishing partially filled pixel or alpha arrays
The admission contract covers the implemented parser, planning, copy, font, layout, AP and native workspace paths; process heap, stack, operating-system loader storage and unrelated third-party work remain outside this ledger
Existing embedded-FDF package selection and held-import APIs retain their released behavior; this workspace extension strengthens their appearance-generation accounting rather than introducing package import again
Native scope API · Text shaping · Rich layout · Embedded FDF packages