View Single Post
  #4  
Old 07-01-2024, 04:35
BLACKFIRE69's Avatar
BLACKFIRE69 BLACKFIRE69 is offline
Registered User
 
Join Date: Mar 2019
Location: In the Hell
Posts: 688
Thanks: 481
Thanked 2,547 Times in 561 Posts
BLACKFIRE69 is on a distinguished road
Quote:
Originally Posted by Tihiy_Don View Post
this is exactly the error that occurs if the font is deleted in the first place. As recommended by the author of the library.





well,

* first of all, this isn't an error message; it's a warning message indicating that the font cannot be removed completely but only partially.

* as @audiofeel mentioned, the font (segmdl2.ttf) you're using is a system font that is already installed in the system, hence this warning will be displayed.



to avoid this issue:

1. 'InstallFMXFont' is intended for custom fonts, not system fonts. in a future update, i'll modify the DLL to prevent the installation of system fonts accidentally.

2. For the current situation, what you need to do is install your font file as a copy of the current system file. this simply means renaming your font file (segmdl2.ttf) to something else, such as 'segmdl2_New.ttf' or 'segmdl2_Copy.ttf', or any other name you prefer. this'll prevent the warning message from appearing.

Code:
Rename:  segmdl2.ttf   >>>   segmdl2_BF69.ttf


[Files]
...
Source: ".\Files\segmdl2_BF69.ttf"; DestDir: "{tmp}"; Flags: dontcopy;

{Code]
function InitializeSetup(): Boolean;
begin
  InstallFMXFont(ExtractAndLoad('segmdl2_BF69.ttf'));

  FMXInnoInit;
  ...
end;

procedure DeinitializeSetup();
begin
  DeleteFMXFont(ExpandConstant('{tmp}\segmdl2_BF69.ttf'));

  ISArcExCleanUp;
  FMXInnoShutDown;
end;


* ISArcExCleanUp:

regarding 'ISArcExCleanUp,' when you call the function 'ISArcExCleanUp,' it performs internal memory clean-up for the current process. this may include cleaning up the font memory cache, which could be why the warning message isn't displayed. however, it isn't recommended to call 'ISArcExCleanUp' before 'DeleteFMXFont'.
Reply With Quote
The Following 3 Users Say Thank You to BLACKFIRE69 For This Useful Post:
audiofeel (07-01-2024), Behnam2018 (07-01-2024), Tihiy_Don (07-01-2024)