Autorun has a Loadfont function that allows you to use loaded fonts in Total Commander and plugins.
The problem for fonts selected in TC settings is that the plugin doesn't have time to load them before TC initializes them, so you have to execute cm_FontConfig, toggle the checkbox back and forth and confirm.
If there was a possibility to port fonts by means of TC itself (from %COMMANDER_PATH%\Fonts\, for example) or at least to wait for their loading by Autorun before rendering, it would be great.
Autoloading/porting fonts
Moderators: Hacker, petermad, Stefan2, white
Autoloading/porting fonts
Overquoting is evil! 👎
- ghisler(Author)
- Site Admin
- Posts: 50383
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Autoloading/porting fonts
I need more information on how you load fonts with autorun, and how TC could know when a font is being loaded, and when it's done.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Autoloading/porting fonts
The function parameter is the font path relative to the TC folder (or full). autorun.cfg:
Autorun.wdx is always at the top of the plugin list, LoadFont functions are executed first. To find out that the font is loaded, you can check the number with the EXTENDED macro and send a message (for example, 7777777) with the font file name in wparam, which TC will accept:
I suppose you know what to do with the received name.
Code: Select all
LoadFont Fonts\Fontname.ttf
LoadFont '%COMMANDER_PATH%\Fonts\Fontname2.otf'
Code: Select all
LoadLibrary Plugins\Autorun_Runtime.dll
LoadFont Fonts\FontName.ttf
If EXTENDED > 0 Then SendMessage(AUTORUN_TCHANDLE, 7777777, 'Fonts\FontName.ttf', 0, 1)
Overquoting is evil! 👎
- ghisler(Author)
- Site Admin
- Posts: 50383
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Autoloading/porting fonts
Try sending WM_USER+21 (which would be Nr. 1045) to Total Commander to reload fonts.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Autoloading/porting fonts
PostMessage(AUTORUN_TCHANDLE, 1045) worked! Thanks! 

Overquoting is evil! 👎