This topic is 2907 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi all. I'm currently adding a Lua console to my game, but I don't want to have to bundle a font file with the executable just for the console, so I'd like to load a built in Windows font instead. I've googled around, but come up blank on how to do this with Freetype2.

So my question is basically: How do I load a built-in Windows font into Freetype2 (using only libraries accessible from non-managed c++)? Ideally I'd like to load the system font used for command/dos windows.

##### Share on other sites
For getting fonts folder:
char buffer[MAX_PATH];SHGetFolderPath(NULL, CSIDL_FONTS, NULL, SHGFP_TYPE_CURRENT,  buffer)

that will give you the font directory (usually %WINDIR%/Fonts)

As for the system terminal it uses a raster font, I would suggest just using using Courier New (or perhaps seeing if consolas is available on the computer and falling back to Courier New)

##### Share on other sites
Quote:
 Original post by ender_341For getting fonts folder:char buffer[MAX_PATH];SHGetFolderPath(NULL, CSIDL_FONTS, NULL, SHGFP_TYPE_CURRENT, buffer)that will give you the font directory (usually %WINDIR%/Fonts)As for the system terminal it uses a raster font, I would suggest just using using Courier New (or perhaps seeing if consolas is available on the computer and falling back to Courier New)

Awesome, thanks!

1. 1
2. 2
3. 3
Rutin
22
4. 4
frob
17
5. 5

• 9
• 33
• 13
• 13
• 10
• ### Forum Statistics

• Total Topics
632580
• Total Posts
3007194

×