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
Web font containers are unpacked once in memory and the unwrapped font program is embedded. WOFF2 input requires Windows 10 version 1703 or later
This function is functionally identical to AddOpenTypeFontFromFile
Raw TrueType files can use the temporary path selected by SetTempPath; web font containers use the in-memory path
Syntax
Delphi
Function DLAddTrueTypeFontFromFileA(InstanceID: Integer; FileName: PAnsiChar): Integer;
DLL
int DLAddTrueTypeFontFromFileA(int InstanceID, const char* FileName);
Parameters
| FileName | The full path and file name of the TrueType font file to embed. |
|---|
Return values
| 0 | The font could not be embedded |
|---|---|
| Non-zero | The ID of the font that was successfully added. This ID can be used with the SelectFont function to select the font |