Главная страница | назад





Article #17466: Checking if TrueType fonts are available.

 Question and Answer Database
FAQ2466D.txt Checking if TrueType fonts are available.
Category :Windows API
Platform :All
Product :All 32 bit
Question:
How can I tell if TrueType fonts are available on a given system?
Answer:
The following example should report if the TrueType engine is
available, enabled, and at least one TrueType font is installed:
function IsTrueTypeAvailable : bool;
var
{$IFDEF WIN32}
rs : TRasterizerStatus;
{$ELSE}
rs : TRasterizer_Status;
{$ENDIF}
begin
result := false;
if not GetRasterizerCaps(rs, sizeof(rs)) then exit;
if rs.WFlags and TT_AVAILABLE <> TT_AVAILABLE then exit;
if rs.WFlags and TT_ENABLED <> TT_ENABLED then exit;
result := true;
end;
7/16/98 4:31:28 PM

Last Modified: 01-SEP-99