SetMissingGlyphCallback
文字、字型、回呼
描述
登錄選配回呼,可觀察遺失的 Unicode 純量,並為該事件選擇回報或中止
語法
Delphi
TPDFlibMissingGlyphEvent= Procedure(Sender: TObject;
CodePoint: Cardinal; UTF16Index, Page: Integer;
Const FontName, Operation: WideString; Var Action: Integer) Of Object;
PDFlib.OnMissingGlyph:= MissingGlyphHandler;ActiveX
Function PDFlib::SetMissingGlyphCallback(Callback As Object) As Long
Function Callback.MissingGlyph(CodePoint As Long, UTF16Index As Long,
Page As Long, FontName As String, Operation As String) As LongDLL
typedef int (__stdcall *TPDFlibMissingGlyphCallback)(
uint32_t CodePoint, int UTF16Index, int Page,
const wchar_t* FontName, const wchar_t* Operation, void* UserData);
int DLSetMissingGlyphCallback(int InstanceID,
TPDFlibMissingGlyphCallback Callback, void* UserData);參數
| CodePoint | 完整的 Unicode 純量值 |
|---|---|
| UTF16Index | 純量或 shaped cluster 的零起算來源索引 |
| Page | 所選頁碼(1 起算);沒有作用中的頁面時為零 |
| FontName | 所選的字型程式或資源名稱 |
| Operation | 偵測到缺字的文字操作 |
| Action | 進入時的目前政策;傳回或指派 0 表示回報後丟棄,1 表示中止 |
傳回值
登錄方法在實例有效時傳回 1
備註
事件在回呼執行前就加入保留的報告
DLL 文字指標為唯讀,且只在回呼期間有效
跨越 DLL 或 ActiveX 回呼邊界的例外會被攔下,回退為回報後捨棄的行為