HPDFCMapReadCode
Read one variable-width character from a text operand using its encoding codespaces
Declaration
function HPDFCMapReadCode(const R: THPDFCMapParseResult; const Bytes: AnsiString; StartIndex: Integer; out Code: Cardinal; out BytesConsumed: Integer): boolean;
Unit
HPDFCMapReader
Usage notes
StartIndex is one-based; a valid character uses the shortest matching width from one through four bytes
An invalid character consumes the shortest range width associated with its longest matching prefix, or the shortest codespace width when no first byte matches; consumption stops at the end of Bytes
True means a cursor could consume bytes, including an undefined code; validate Code and BytesConsumed with HPDFCMapCodeInSpace before glyph selection, and use notdef substitution for an invalid code
See Native Cairo rendering for aggregate rendering budgets and cancellation