View Single Post
  #145  
Old 19-01-2013, 13:33
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,749
Thanks: 2,170
Thanked 11,206 Times in 2,307 Posts
Razor12911 is on a distinguished road
[Files]
Source: Font.ttf; DestDir: {tmp}; Flags: dontcopy;

[Code]
#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif


const
FR_PRIVATE = $10;

function AddFontResource(lpszFilename:string;fl:dword;pdv:i nteger): Integer; external 'AddFontResourceEx{#A}@gdi32.dll stdcall';
function RemoveFontResource(lpszFilename:string;fl:dword;pd v:integer): BOOL; external 'RemoveFontResourceEx{#A}@gdi32.dll stdcall';

procedure InitializeWizard;
begin
ExtractTemporaryFile('Font.ttf');
AddFontResource(ExpandConstant('{tmp}\Font.ttf'), FR_PRIVATE, 0);
end;

procedure DeinitializeSetup;
begin
RemoveFontResource(ExpandConstant('{tmp}\Font.ttf' ), FR_PRIVATE, 0);
end;

__________________________________________________ ______________

Glad could help with font.

Work on ANSI and UNICODE

Sorry for bad english.

Last edited by Razor12911; 19-01-2013 at 13:56.
Reply With Quote