THotPDF.GetLoadedFontDict Method
Returns the complete font dictionary object of a specific font resource in the specified page of the loaded PDF, used for accessing low-level properties such as font descriptors, width tables, and encoding mappings
Declaration
function GetLoadedFontDict(PageIndex, FontIndex: Integer): THPDFDictionaryObject;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
PageIndex | Zero-based index of the target page |
FontIndex | The zero-based index of the target font in the page's font resource dictionary |
Return value
返回字体字典的 THPDFDictionaryObject;索引越界或字体无法解析时返回 nil
Usage notes
- 调用前应先通过
GetLoadedFontCount确认有效索引范围 - The returned dictionary may be an indirect reference to an already parsed object; the caller must not free this object, and the reference becomes invalid after the document is closed
- For CIDFont or Type0 composite fonts, the dictionary may contain a DescendantFonts array, which requires additional parsing to obtain complete glyph information