Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

DynaPDF.FontInfo

Retrieves the most important properties of a font.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 5.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.FontInfo"; PDF; Index; Selector { ; FileName } )   More

Parameters

Parameter Description Example Flags
PDF The PDF reference returned from DynaPDF.New. $pdf
Index The font index from zero to DynaPDF.GetFontCount. 0
Selector Which value to return. Can be Ascent, AvgWidth, BaseEncoding, BaseFont, CapHeight, CharSet, CharSetSize, CIDOrdering, CIDRegistry, CIDSet, CIDSetSize, CIDSupplement, CIDToGIDMap, CMapBuf, CMapBufSize, CMapName, Encoding, FirstChar, FontBBox, Flags, FontBufSize, FontBuffer, FontFamily, FontFilePath, FontFileType, FontName, FontStretch, FontType, FontWeight, FullName, HaveEncoding, HorzWidths, HorzWidthsCount, Imported, ItalicAngle, Lang, LastChar, Leading, Length1, Length2, Length3, MaxWidth, Metadata, MetadataSize, MisWidth, Panose, PostScriptName, SpaceWidth, StemH, StemV, ToUnicode, ToUnicodeSize, VertDefPos, VertWidths, VertWidthsCount, WMode or XHeight. "FamilyName"
FileName Optional file name for values returned as container values. For CMapBuf and FontBuffer. "test.dat" Optional

Result

Returns value or error.

Description

Retrieves the most important properties of a font.
CMapBuf and FontBuffer values are returned as container values.
HorzWidths is returned as a list of floating point numbers separated by newline character.
VertDefPos is returned as two floating point numbers for X and Y separated by space character.
VertWidths is returned as list of three floating pointing numbers. First is width, second X and third value is Y.
FontFamily, FontFilePath, FullName and PostScriptName are returned as unicode texts if possible.

For embedded fonts the FontBufSize field is > 0.

See also FontInfo function in DynaPDF manual.

Examples

Get Family Name for first font:

MBS( "DynaPDF.FontInfo"; $pdf; 0; "FamilyName" )

Create records with family name for each font in PDF file:

#Load PDF from container
Set Variable [$r; Value:MBS("DynaPDF.OpenPDFFromContainer"; $pdf; System Font Info::PDF)]
#import a page
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFFile"; $pdf; 1)]
#List fonts in PDF
Set Variable [$FontCount; Value:MBS("DynaPDF.GetFontCount"; $pdf)]
If [$FontCount > 0]
    Set Variable [$index; Value:0]
    Loop
        #Get values
        New Record/Request
        Set Field [System Font Info::FontFamily; MBS("DynaPDF.FontInfo"; $pdf; $Index; "FontFamily")]
        Commit Records/Requests [Skip data entry validation; No dialog]
        #Next
        Set Variable [$Index; Value:1 + $Index]
        Exit Loop If [$Index >= $FontCount]
    End Loop
End If

Query font buffer size:

MBS( "DynaPDF.FontInfo"; $PDF; $Index; "FontBufSize" )

See also

Release notes

  • Version 14.0
    • Changed DynaPDF.FontInfo to return numbers for FontBBox as list of values with numbers.

Example Databases

Blog Entries

This function checks for a license.

Created 21st March 2015, last changed 23th March 2021


DynaPDF.FlushPagesEx - DynaPDF.FreeTextAnnot