TFontManager.LoadFontReaderFamily

function LoadFontReaderFamily(const fontFamily: string): TLoadFontResult; overload;

function LoadFontReaderFamily(const fontFamily: string; out fontReaderFamily: TFontReaderFamily): TLoadFontResult; overload;


This function is for Windows only.

Example 1:

var
  frItalic: TFontReader;
  frItal14Cache: TFontCache;
begin
  FontManager.LoadFontReaderFamily('Arial');
  frItalic := FontManager.GetBestMatchFont([msItalic]);
  // do something with frItalic  
  frItal14Cache := TFontCache.Create(frItalic, DPIAware(14));
  try
    // and draw some text with frItal14Cache     
  finally
    frItal14Cache.Free;
  end;
      

Example 2:

var
  arialFamily: TFontReaderFamily;
begin
  // make sure we load the italic font
  // as part of the Arial family of fonts ...
  if (FontManager.LoadFontReaderFamily('Arial', 
    arialFamily) <> lfrSuccess) or
    not Assigned(arialFamily.italicFR) then Exit;    
  // do something with arialFamily.italicFR
      

See Also

TFontReaderFamily, TLoadFontResult