TFontManager.GetBestMatchFont

function GetBestMatchFont(const fontInfo: TFontInfo): TFontReader; overload;

function GetBestMatchFont(const styles: TMacStyles): TFontReader; overload;


var
  frItalic: TFontReader;
  frItal14Cache: TFontCache;
begin
  // FontManager.LoadFontReaderFamily loads regular, 
  // italic, bold and bold-italic fonts (if available)
  FontManager.LoadFontReaderFamily('Arial');
  frItalic := FontManager.GetBestMatchFont([msItalic]);
  // create a TFontCache object with frItalic  
  frItal14Cache := TFontCache.Create(frItalic, DPIAware(14));
  try
    // and draw some text with frItal14Cache 
    
  finally
    frItal14Cache.Free;
  end;
      

See Also

TFontReader, TFontInfo, TMacStyles