PDFDocument.AddFonts

From Xojo Documentation

Method

PDFDocument.AddFonts(folder As FolderItem)

New in 2020r1

Supported for all project types and targets.

All fonts within the folder and any subfolders are embedded within the document so that they are not required to be installed on the user's machine in order for text that uses them to be rendered properly with those fonts.

Notes

The "Standard 14" fonts are always available for use. Fonts in your OS font folder may also be used and they will be automatically embedded into the PDF document for you.

If you have specific fonts you'd like to include, you can use the AddFonts() method to point to the folder containing the fonts and they will be embedded. This can be faster than scanning the entire OS font folder. It also allows you to use fonts that might not be installed on your OS.

You can call AddFonts() multiple times to embed fonts in separate folders.

You should call AddFonts() before using any of the fonts in its specified folder.

If your document uses a font that is not one of the Standard 14 fonts and also has not been embedded in the document then a substitute font is used (Arial on Windows, Helvetica on macOS/Linux).

If you pass a FolderItem that is not a folder, an InvalidArgumentException is raised.