HPDFShapeHeadlessTextSpanWithWorkspace

function HPDFShapeHeadlessTextSpanWithWorkspace(const Context: UnicodeString;
  FirstUnit, UnitCount: Integer; const FontBytes: SysUtils.TBytes;
  MaximumGlyphs: Integer; CancellationToken: THPDFCancellationToken;
  CharacterAdvance: Double; WordAdvance: Double;
  ParagraphDirection: THPDFHeadlessTextDirection;
  Workspace: THPDFWorkspaceAdmission): THPDFHeadlessShapedGlyphs;

Declared in HPDFHeadlessShaping

Shapes the selected context span with the existing surrounding-text and direction rules while admitting temporary UTF-16 text, glyph buffers and native shaping work

Borrowed admission

Workspace is a borrowed THPDFWorkspaceAdmission; keep it alive for the entire call and do not reset its cumulative ledger during a failed attempt or retry

Pass nil to retain the original call behavior without a borrowed workspace; the original function signature remains available

Admission occurs before the implemented allocations or generated identities; bounded copy and operation checkpoints can also call Reserve(0)

An exception raised by the owner remains the operation failure; cleanup must remain possible after cancellation and must not replace that exception

A non-nil workspace requires the selected native shaping or ordering library to expose the compatible workspace allocator ABI; ordinary libraries remain usable by the original nil-workspace path

Native callbacks retain their original Pascal exception and return failure to C; the caller rethrows the retained exception after the native call returns

The returned arrays own their managed storage and can be released after the admission owner is destroyed; they do not retain a callable borrowed owner

See HPDFShapeHeadlessTextSpan for the unchanged input and output contract

See workspace admission and native runtimes for ledger categories and lifetime boundaries