DynaPDF.FontInfo
----------------

Retrieves the most important properties of a font.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [5.1](newinversion51.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

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

**MBS**( **"DynaPDF.FontInfo";** /\* Retrieves the most important properties of a font. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Index**; /\* The font index from zero to [DynaPDF.GetFontCount](DynaPDFGetFontCount.md).e.g. 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.e.g. "FamilyName" \*/   
**$FileName**) /\* Optional; Optional file name for values returned as container values. For CMapBuf and FontBuffer.e.g. "test.dat" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |  |
| Index | The font index from zero to [DynaPDF.GetFontCount](DynaPDFGetFontCount.md). | 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 &gt; 0.   
See also [FontInfo](https://www.monkeybreadsoftware.com/DynaPDF-Manual/GetFontInfoEx.shtml) 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](DynaPDFOpenPDFFromContainer.md)"; $pdf ; System Font Info::PDF )\]  
\#import a page   
Set Variable \[$r ; Value:MBS ("[DynaPDF.ImportPDFFile](DynaPDFImportPDFFile.md)"; $pdf ; 1)\]  
\#List fonts in PDF   
Set Variable \[$FontCount ; Value:MBS ("[DynaPDF.GetFontCount](DynaPDFGetFontCount.md)"; $pdf )\]  
If \[$FontCount &gt; 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 &gt;= $FontCount \]  
 End Loop  
End If  
Query font buffer size:

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

- [DynaPDF.GetFontCount](DynaPDFGetFontCount.md)
- [DynaPDF.ImportPDFFile](DynaPDFImportPDFFile.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.OpenPDFFromContainer](DynaPDFOpenPDFFromContainer.md)
- [DynaPDF.SysFontInfo](DynaPDFSysFontInfo.md)

### Release notes

- **Version 14.0**
    - Changed [DynaPDF.FontInfo](https://www.mbsplugins.eu/DynaPDFFontInfo.shtml) to return numbers for FontBBox as list of values with numbers.

### Example Databases

- [DynaPDF/PDF Font Info](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/PDF%20Font%20Info.shtml#2ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 13.6pr4](https://www.mbsplugins.de/archive/2023-12-20/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.1pr2](https://www.mbsplugins.de/archive/2015-03-23/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

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

  
[DynaPDF.FlushPagesEx](DynaPDFFlushPagesEx.md) - [DynaPDF.FreeTextAnnot](DynaPDFFreeTextAnnot.md)

[HTML Version](DynaPDFFontInfo.shtml)