FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   Fonts Manifest (https://fileforums.com/showthread.php?t=97963)

Prince4 10-06-2016 23:27

Fonts Manifest
 
There's something i also need to know (this is the best place to ask cause i can't find another)
How can i have custom fonts in a TLabel please i tried some methods like (AddFontResource '{tmp}\myfont.ttf') but failed.. I know there are nuemrous methods to this but i want to understand them please help me out

vint56 10-06-2016 23:50

Code:

#define Font "Zombie.ttf"
#define FontName "DS Zombie Cyr"

[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application

[Files]
Source: {#Font}; Flags: dontcopy

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

const
    FR_PRIVATE = $10;

function AddFontResource(lpszFilename: String; fl, pdv: DWORD): Integer; external 'AddFontResourceEx{#A}@gdi32.dll stdcall';
function RemoveFontResource(lpFileName: String; fl, pdv: DWORD): BOOL; external 'RemoveFontResourceEx{#A}@gdi32.dll stdcall';

procedure InitializeWizard();
begin
    if not FontExists('{#FontName}') then
    begin
        ExtractTemporaryFile('{#Font}');
        AddFontResource(ExpandConstant('{tmp}\{#Font}'), FR_PRIVATE, 0);
    end;
    WizardForm.Font.Name := '{#FontName}';
end;

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


Prince4 11-06-2016 00:02

Thanks brother will check it at noon thanks, iguess you like helping me out..

Thanks..

Prince4 11-06-2016 00:11

Quote:

Originally Posted by Prince4 (Post 449474)
Thanks brother will check it at noon thanks, iguess you like helping me out..

Thanks..

And yeah can you please check out the "Colored Fonts in MsgBox" thread please


All times are GMT -7. The time now is 21:13.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Copyright 2000-2020, FileForums @ https://fileforums.com