Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [AGK] ChooseSystemFont()

Virtual Nomad
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 30th May 2023 01:08 Edited at: 30th May 2023 17:32
ChooseRawFile() cannot access Windows System Fonts (ie, C:\Windows\Fonts) while GetRawFolderNumFiles() does enumerate and GetRawFolderFileName() is functional allowing us to build a list of system fonts and load via LoadFont("raw:" + FullPath$)

If there is a native manner that i didn't consider, please advise. Otherwise:

MWheel/[Up|Down] to scroll through/preview font + [Home|End]

Tested Classic V2023.01.16 on WIN10

Note: Fonts located outside of the System folder (including ...\Username\AppData\Local\Microsoft\Windows\Fonts) are accessible via ChooseRawFile() otherwise.

Add: could others on other OSs advise if ChooseRawFile() can select a System font and report? ie, is this a win-only issue? (i've tried running as Admin, etc).

And, does the code provided work as expected on other operating systems?


Login to view attachments
VIP Member
Gold Codemaster
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 31st May 2023 06:05
The ChooseRawFile is probably the same problem as in FileExplore. While I use the newer FileSelectionBox (IFileOpenDialog) compared to AppGameKit .
The way I found out it should be a Windows-only problem.
When I set a flag in my FileExplore (FOS_ALLNONSTORAGEITEMS) the content of the folder is shown to me in a way.
Not as it is created in the file structure.
It changes its display mode automatically.
The fonts of a font family are grouped together and handled like folders.
However, if you then select a font, not the file name is returned but the font name itself (not 'arial.ttf' but 'Arial Standard').

These are my experiences with this topic.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Donations are always welcome.

Login to post a reply

Server time is: 2023-09-24 02:41:44
Your offset time is: 2023-09-24 02:41:44