THPDFFontDecoder レコード

フォントデコードフォールバックチェーンが構築した、ロード済み PDF フォント 1 個分の確定済みデコードテーブルと幅メトリクスを保持します

宣言

THPDFFontDecoder= record
  FontKey: AnsiString;             // resource key (e.g. /F1) for diagnostics
  Subtype: AnsiString;             // Type0, Type1, TrueType, CIDFontType2
  Strategies: THPDFFontStrategies; // which fallbacks are populated
  ToUnicodeMap: THPDFCMapParseResult;
  EncodingMap: THPDFCMapParseResult;        // /Encoding stream or named CMap
  PredefinedEncoding: AnsiString;           // 'WinAnsiEncoding' etc
  CIDToGIDIdentity: boolean;
  CIDToGIDs: array of Word;                 // binary CIDToGIDMap stream
  CIDToUnicode: THPDFCIDToUnicodeTable;     // cid2code.txt fallback
  GlyphNameUnicode: array[0.. 255] of Cardinal;
  GIDToUnicode: THPDFUnicodeByGID;
  // v2.505.0 simple-font /Widths (PDF 1.7 9.6.3 Table 111). Index =
  // (code - FirstChar); values are 1/1000-em glyph advances. Empty when
  // the font has no /Widths array (the interpreter falls back to 0.5*fs)
  Widths: array of Double;
  FirstChar: Integer;
  LastChar: Integer;
  CIDWidths: THPDFCIDWidthRanges;
  CIDDefaultWidth: Double;
  // Vertical (WMode 1) counterparts from the descendant CIDFont /W2 and
  // /DW2 (ISO 32000-1 9.7.4.3). Each /W2 metric is a [w1y v1x v1y]
  // triple: w1y is the displacement along the writing axis, v1x/v1y the
  // position vector from the glyph's horizontal origin to its vertical
  // origin. A range entry (cFirst cLast w1y v1x v1y) stores one triple;
  // a list entry (c [w1y v1x v1y ...]) stores one triple per CID from
  // FirstCID to LastCID. VerticalWriting gates the resolver's vertical
  // branch
  CIDVertWidths: THPDFCIDWidthRanges;
  CIDVertDefaultAdvance: Double;       // /DW2 w1y (second entry); default -1000
  CIDVertDefaultOriginY: Double;       // /DW2 v1y (first entry); default 880
  VerticalWriting: boolean;
  Ascent: Double;
  Descent: Double;
  HasVerticalMetrics: boolean;
  CodeUnitBytes: Integer;                    // bytes per char code
  OK: boolean;
end;

ユニット

HPDFTextExtraction

フィールド

フィールド目的
FontKeyフォントを名指す /F1 などのリソースキー。診断のために保持されます
Subtypeフォント辞書のサブタイプ。Type0、Type1、TrueType、CIDFontType2 など
Strategies正常に埋められたフォールバック戦略のセット
ToUnicodeMapbfchar と bfrange エントリを含む解析済み /ToUnicode CMap。最優先の戦略です
EncodingMap解析済みの /Encoding ストリームまたは名前付き CMap
PredefinedEncodingWinAnsiEncoding などの定義済みエンコーディング名
CIDToGIDIdentityCIDToGIDMap が Identity で、明示的なテーブルが不要な場合に True
CIDToGIDsバイナリの CIDToGIDMap ストリームを CID ごとに 1 Word へ展開したもの
CIDToUnicodecid2code.txt フォールバックによる CID から Unicode へのテーブル
GlyphNameUnicode/Differences リカバリで使われる、256 項目のグリフ名から Unicode へのテーブル
GIDToUnicode埋め込み cmap をグリフ ID から Unicode へ逆引きしたもの
Widths単純フォントの /Widths アドバンス(1/1000 em 単位)。code から FirstChar を引いた値でインデックスします
FirstCharWidths 配列がサポートする最初の文字コード
LastCharWidths 配列がサポートする最後の文字コード
CIDWidthsCIDFont の /W 配列による CID 幅範囲
CIDDefaultWidth/DW による既定の CID アドバンス
CIDVertWidths縦書き /W2 メトリクス。CID または範囲ごとに [w1y v1x v1y] の 3 つ組で保存されます
CIDVertDefaultAdvance/DW2 w1y による既定の縦方向変位。既定値は -1000
CIDVertDefaultOriginY/DW2 v1y による既定の縦書き原点。既定値は 880
VerticalWritingWMode 1 のメトリクスがリゾルバの縦書き分岐を制御する場合に True
Ascentフォントディスクリプタのメトリクスから読んだフォントのアセント
Descentフォントディスクリプタのメトリクスから読んだフォントのディセント
HasVerticalMetricsフォントの縦書きメトリクスが見つかった場合に True
CodeUnitBytes文字コードあたりのバイト数。そのフォントについてコンテンツインタプリタへ答えます
OK少なくとも 1 つのデコード戦略が使える場合に True

使用上の注意

関連 API