HPDFCMapReadCode

依 encoding 的 codespace 從文字運算元讀取一個變寬度字元

宣告

function HPDFCMapReadCode(const R: THPDFCMapParseResult; const Bytes: AnsiString; StartIndex: Integer; out Code: Cardinal; out BytesConsumed: Integer): boolean;

單元

HPDFCMapReader

使用注意

StartIndex 為 1 起算;合法字元使用 1 到 4 bytes 之間最短的符合寬度

無效字元消耗與其最長符合前綴相關的最短範圍寬度,第一個 byte 都不符合時則取最短 codespace 寬度;讀到 Bytes 結尾即停止

True 表示 cursor 消耗了位元組,code 仍可能未定義;選 glyph 前先用 HPDFCMapCodeInSpace 驗證 Code 與 BytesConsumed,無效 code 改用 notdef 替代

彙總 render 預算與取消機制見 Native Cairo rendering