THotPDF.CreateIndirectFontDict Method

 

THotPDF.CreateIndirectFontDict

THotPDF

 

先頭

ドキュメントの IndirectObjects テーブルに indirect PDF object として登録される新しい空の THPDFDictionaryObject を割り当てます。custom font / colour / OCG / Function dict を構築し、それを "N G R" indirect reference としてシリアライズする必要がある呼び出し元は、返された dict に値を追加し、既存の THPDFDictionaryObject を受け取る任意の API に渡します。これは長年 protected だった CreateIndirectDictionary helper の public API 版です

 

Delphi syntax:

function CreateIndirectFontDict: THPDFDictionaryObject;

 

C++ syntax:

THPDFDictionaryObject* CreateIndirectFontDict();

 

説明

返された dict は空の状態で始まります (entry はありません)。呼び出し元は AddNameValue、AddStringValue、AddNumericValue、AddValue などを使って entry を追加します。この dict はドキュメントが所有するため、手動で解放しないでください。メソッド名は SetFormUnicodeFontDict での主な用途に合わせて "FontDict" となっていますが、返される dict にフォント固有の意味はなく、呼び出し元が必要とする任意の PDF dictionary content を保持できます

 

Return value: an empty indirect THPDFDictionaryObject.

 

Code Example

// Build a minimal Type 0 / CIDFontType2 + Identity-H font dict for
// AcroForm Tx widget AP rendering
var
  F0: THPDFDictionaryObject;
begin
  HPDF.BeginDoc;
  F0 := HPDF.CreateIndirectFontDict;
  F0.AddNameValue('Type', 'Font');
  F0.AddNameValue('Subtype', 'Type0');
  F0.AddNameValue('BaseFont', 'MyCJK');
  F0.AddNameValue('Encoding', 'Identity-H');
  // ... fill DescendantFonts / CIDSystemInfo / FontDescriptor /
  HPDF.SetFormUnicodeFontDict('F0', F0);
  HPDF.EndDoc;
end;

 

関連項目

SetFormUnicodeFontDict