Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

DynaPDF.FontInfo

Retrieves the most important properties of a font.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
DynaPDF 5.1 Yes Yes Yes Yes Yes

MBS( "DynaPDF.FontInfo"; PDF; Index; Selector { ; FileName } )

Parameters

Parameter Description Example value
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
Optional file name for values returned as container values. For CMapBuf and FontBuffer.
"test.dat"

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.

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

See also

Example Databases


DynaPDF.FlushPages   -   DynaPDF.FreeTextAnnot

Feedback: Report problem or ask question.




Links
MBS Xojo blog