On Win7 Label just disapper when i apply "my" font. On WinXP this methods works fine. I record small video (less 1 minute) what happens - YouTube
Also note that loading from filesystem doesn't always work. For instance if you have the ttf file in your user-directory, the OS can't reach it and will give you file not found error. This shouldn't be an issue for you now because you load it from E:\
Second... what kind of error do you get when you add RaiseLastOSError when the result of LoadFont is 0.
(you changed the source for your youtube because I can't see the showmessage for successful loading in WinXP)
Procedure LoadFonts;
begin
if FileExists(ExtractFilePath(Application.ExeName)+'Auricom_Regular.ttf') then
if AddFontResourceEx(PAnsiChar(ExtractFilePath(Application.ExeName)+'Auricom_Regular.ttf'), FR_Private, Nil) <> 0 then
begin
SendMessage(Form1.Handle, WM_FONTCHANGE, 0, 0);
ShowMessage('Font Installed!');
end else RaiseLastOSError;
end;
Do you get the Font Installed message or do you get an OS-error?
And last... like josh already mentioned.
DON'T distribute GDI32.dll. (I see they are the same)
It should already be installed in your Windows-directory. You are likely to distribute the wrong one for your OS.
(i.e. 32 or 64 bit and differences for XP through 10)
So never ever distribute that file.
PS. Maybe I missed something but why are you saving the ttf file to disk and load it from there? It is possible to load it directly from the resource file. So you don't have to save the ttf first. (Example is earlier in this thread)