How do I make my program take fonts from a given folder?
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
How do I make my program take fonts from a given folder?
hi!
Users of the Eidos system not from Russia are faced with the fact that they have questions displayed on screen forms wherever Cyrillic is used. I understand that they simply do not have the necessary fonts in Windows. How do I make my program take fonts from a given folder?
http://aidos.byethost5.com/map5.php
Users of the Eidos system not from Russia are faced with the fact that they have questions displayed on screen forms wherever Cyrillic is used. I understand that they simply do not have the necessary fonts in Windows. How do I make my program take fonts from a given folder?
http://aidos.byethost5.com/map5.php
- Attachments
-
- Безымянный.jpg (551.99 KiB) Viewed 5857 times
Re: How do I make my program take fonts from a given folder?
Hi,
Code: Select all
cFont := '.\fonts\thisismyfont.ttf' // subfolder fonts contains the font
DllCall("GDI32.DLL", DLL_STDCALL, "AddFontResourceA", cFont )
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: How do I make my program take fonts from a given folder?
Mind that this effects system only until next reboot.
https://learn.microsoft.com/en-us/windo ... tresourcea
This function installs the font only for the current session. When the system restarts, the font will not be present. To have the font installed even after restarting the system, the font must be listed in the registry.
https://learn.microsoft.com/en-us/windo ... tresourcea
This function installs the font only for the current session. When the system restarts, the font will not be present. To have the font installed even after restarting the system, the font must be listed in the registry.
Re: How do I make my program take fonts from a given folder?
Hi,
Yes, you need to load it every time at startup.
When you close your application you can do the following, to release the font.
Yes, you need to load it every time at startup.
When you close your application you can do the following, to release the font.
Code: Select all
DllCall("GDI32.DLL", DLL_STDCALL, "RemoveFontResourceA", cFont )
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: How do I make my program take fonts from a given folder?
Thanks, I'll take it into account
But so far so:
http://lc.kubagro.ru/__AidosALL.txt
Search: "n InstallFonts()"
But so far so:
http://lc.kubagro.ru/__AidosALL.txt
Search: "n InstallFonts()"
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: How do I make my program take fonts from a given folder?
I made the release of fonts during the normal logout. How do I find out the correspondence of ttf file names and font names?
Re: How do I make my program take fonts from a given folder?
Windows api function GetFontResourceInfo (gdi32.dll) that does that
BOOL GetFontResourceInfo(LPCTSTR lpszFilename, // font file name
LPDWORD cbBuffer, // size of buffer for resouce information
LPVOID lpBuffer, // buffer for returned resouce information
DWORD dwQueryType, // resouce information query type
);
There was post on superuser:
https://superuser.com/questions/1432800 ... mmand-line
BOOL GetFontResourceInfo(LPCTSTR lpszFilename, // font file name
LPDWORD cbBuffer, // size of buffer for resouce information
LPVOID lpBuffer, // buffer for returned resouce information
DWORD dwQueryType, // resouce information query type
);
There was post on superuser:
https://superuser.com/questions/1432800 ... mmand-line
Eugene Lutsenko wrote: ↑Wed Nov 09, 2022 11:54 am I made the release of fonts during the normal logout. How do I find out the correspondence of ttf file names and font names?
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: How do I make my program take fonts from a given folder?
I would like to download only those fonts that are actually used in the Eidos system. There are not so many of them, they take up less space and it happens faster.