Piet,

use the next code to check if font is TrueType:

var boolTrueType: Boolean;

function SetFontTypeFlag(var LogFont: TEnumLogFont;
var ptm: TNewTextMetric;
      FontType: integer; Data: Pointer): Integer;
stdcall;
begin
  boolTrueType := (ptm.tmPitchAndFamily and
TMPF_TRUETYPE) = TMPF_TRUETYPE;
  Result := 0;
end;

function IsTrueType(FontName: string): Boolean;
var
  DC: HDC;
begin
  DC := GetDC(0);
  EnumFontFamilies(DC, PChar(FontName),
@SetFontTypeFlag, 0);
  Result := boolTrueType;
  ReleaseDC(0, DC);
end;

And use so:
if IsTrueType('Arial') then
  <do something>

With best regards, Mike Shkolnik
EMail: [EMAIL PROTECTED]
http://www.scalabium.com


--- Piet Henning <[EMAIL PROTECTED]> wrote:

> How can I detect if a FONT selection is TrueType?
> Thanks
> Piet


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to