Mega Code Archive

 
Categories / Delphi / System
 

Determine if small or large fonts are installed on system

Title: Determine if small or large fonts are installed on system Question: How can I determine if a user has installed large or small fonts? Answer: The following functions returns true, if small fonts are installed on the system. You can replace the then line 'Result := (GetDeviceCaps(DC, logpixelsx) = 96);' by 'Result := (GetDeviceCaps(DC, logpixelsx) = 120);' to determine if large fonts are used. Function UsesSmallFonts: boolean; var DC: HDC; begin DC := GetDC(0); Result := (GetDeviceCaps(DC, logpixelsx) = 96); ReleaseDC(0, DC); end;