AddOpenTypeFontFromFileA

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 AddOpenTypeFontFromFile and string arguments are interpreted using the current SetAnsiMode code page

This function is identical to AddTrueTypeFontFromFile. Both functions allow a TrueType, OpenType/TrueType or OpenType/CFF font to be added from a raw sfnt, WOFF 1.0 or WOFF2 file

This function is identical to AddTrueTypeFontFromFile. Both functions allow a TrueType, OpenType/TrueType or OpenType/CFF font to be added from a file.

This version of the function provides an Options parameter which may be expanded in future to support advanced OpenType features.

Syntax

Delphi

Function DLAddOpenTypeFontFromFileA(InstanceID: Integer; FileName: PAnsiChar; Options: Integer): Integer;

DLL

int DLAddOpenTypeFontFromFileA(int InstanceID, const char* FileName, int Options);

Parameters

FileNameThe font file name.
OptionsShould be set to 0.

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