THPDFFontDecoder Record

폰트 디코드 폴백 체인이 만든, 로드된 PDF 폰트 하나의 디코드 테이블과 폭 메트릭을 담고 있습니다

선언

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폰트 사전 subtype. Type0, Type1, TrueType, CIDFontType2 등
Strategies성공적으로 채워진 폴백 전략의 집합
ToUnicodeMapbfchar·bfrange 항목을 담아 파싱한 /ToUnicode CMap. 최우선 순위입니다
EncodingMap파싱한 /Encoding 스트림 또는 이름 있는 CMap
PredefinedEncodingWinAnsiEncoding 같은 사전 정의 인코딩 이름
CIDToGIDIdentityCIDToGIDMap이 Identity라 명시적 테이블이 필요 없을 때 True
CIDToGIDsCID당 Word 하나로 펼친 바이너리 CIDToGIDMap 스트림
CIDToUnicodecid2code.txt 폴백에서 온 CID-Unicode 테이블
GlyphNameUnicode/Differences 복구에 쓰이는 256항목짜리 glyph 이름-Unicode 테이블
GIDToUnicodeglyph ID에서 Unicode로 뒤집은 내장 cmap
Widths단순 폰트 /Widths 어드밴스(1/1000 em 단위). code에서 FirstChar를 뺀 값이 인덱스입니다
FirstCharWidths 배열이 지원하는 첫 문자 코드
LastCharWidths 배열이 지원하는 마지막 문자 코드
CIDWidthsCIDFont /W 배열에서 온 CID 폭 범위
CIDDefaultWidth/DW에서 온 기본 CID 어드밴스
CIDVertWidths세로쓰기 /W2 메트릭. CID별 또는 범위별 [w1y v1x v1y] 트리플로 저장합니다
CIDVertDefaultAdvance/DW2 w1y에서 온 기본 세로 변위량. 기본값 -1000
CIDVertDefaultOriginY/DW2 v1y에서 온 기본 세로 원점. 기본값 880
VerticalWritingWMode 1 메트릭이 resolver의 세로 분기를 담당할 때 True
Ascent폰트 디스크립터 메트릭에서 읽은 폰트 ascent
Descent폰트 디스크립터 메트릭에서 읽은 폰트 descent
HasVerticalMetrics폰트의 세로 메트릭을 찾았을 때 True
CodeUnitBytes문자 코드당 바이트 수. 콘텐츠 인터프리터에 이 폰트에 대해 답합니다
OK디코드 전략이 하나라도 쓸 수 있을 때 True

사용 참고 사항

관련 API