Yes, GetObject does return DEFAULT_PITCH . But you can get the true value by listing the fonts with the desired name:
function EnumFontsProc(var elf: TEnumLogFont; var tm: TNewTextMetric; FontType: Integer; Data: LPARAM): Integer; stdcall; begin; Result := Integer(FIXED_PITCH = (elf.elfLogFont.lfPitchAndFamily and FIXED_PITCH)); end; procedure TForm1.Button13Click(Sender: TObject); begin; if EnumFontFamilies(Canvas.Handle, PChar('Courier New'), @EnumFontsProc,0) then Caption := 'Fixed' else Caption := 'Variable'; end;
source share