//Might come handy when you need to make a list with all fonts, instead of the common font dialog...
#include <windows.h> #include <stdio.h> char Fonts[2048][256]; DWORD FontsNo = 0;
int CALLBACK EnumFontsProc(CONST LOGFONT *lplf, CONST TEXTMETRIC *lptm, DWORD dwType, LPARAM lpData) { strcpy(Fonts[FontsNo++], lplf->lfFaceName); return(true); }
int main() { HDC hDC = GetDC(NULL); EnumFonts(hDC, NULL, EnumFontsProc, NULL); ReleaseDC(NULL, hDC); for (DWORD i = 0; i < FontsNo; i++) printf("%s\r\n", Fonts[i]); printf("\r\nThere are currently %d fonts on system..", FontsNo); return 0; } |