AddTrueTypeFontFromFileA

Text, Fonts

Description

The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to AddTrueTypeFontFromFile and string arguments are interpreted using the current SetAnsiMode code page

Embeds a TrueType, OpenType/TrueType or OpenType/CFF font from a raw sfnt, WOFF 1.0 or WOFF2 file without requiring the font to be installed

Embeds a TrueType, OpenType/TrueType or OpenType/CFF font into the document. The TrueType font is specified by the file name and does not have to be installed as a system font.

This function is functionally identical to AddOpenTypeFontFromFile.

For TrueType and OpenType/TrueType fonts, a temporary file must be created during this process, call SetTempPath to specify where this temporary file should be created.

Syntax

Delphi

Function DLAddTrueTypeFontFromFileA(InstanceID: Integer; FileName: PAnsiChar): Integer;

DLL

int DLAddTrueTypeFontFromFileA(int InstanceID, const char* FileName);

Parameters

FileNameThe full path and file name of the TrueType font file to embed.

Return values

0The font could not be embedded
Non-zeroThe ID of the font that was successfully added. This ID can be used with the SelectFont function to select the font