Open dearmochi opened 7 years ago
On Windows you can open system drive letter:\Windows\Fonts to find all pre-installed fonts, also search in GarrysMod/garrysmod/resource/fonts.
With Lua you can't access files outside of the garrysmod folder. (OP wants a realtime list) But it's possible to search all *.ttf files in the gmod fonts folder (should be safe for use)
Also I wouldn't scan the system for installed fonts because of the TrueType Font Parsing risks.
@MinIsMin Windows fonts don't change much between different Windows versions, so using built-in Windows fonts should be safe. Realtime list is not needed.
This would allow developers to give players more freedom when it comes to customizing their interface's font. Since I am coding a chat box, I want to part with giving a preset list of fonts (that may not even work depending on the system) - instead I want to show a list of available fonts the user has on their PC.