TFontManager

This class is intended primarily for single instance use. The FontManager function accesses the single instance TFontManager object that's automatically constructed by the library.

var
  arialFont: TFontReader;
  sansBoldFont: TFontReader;
  fontInfo: TFontInfo;
begin
  FontManager.LoadFromResource('my_ttf_font'; RT_RCDATA);

  arialFont := FontManager.Load('Arial');
  
  FontManager.Load('Arial Bold');
  FontManager.Load('Arial Italic');
  FontManager.Load('Arial Bold Italic');
  FontManager.Load('Times New Roman');
  FontManager.Load('Times New Roman Bold');
  FontManager.Load('Times New Roman Italic');
  FontManager.Load('Times New Roman Bold Italic');

  //now find the font that best matches - bold sans-serif
  FillChar(fontInfo, SizeOf(fontInfo), 0);
  fontInfo.fontFamily := ttfSansSerif;
  fontInfo.macStyles := [msBold];
  sansBoldFont := FontManager.GetBestMatchFont(fontInfo);
      

Reference

Methods Properties
In TFontManager:
Clear MaxFonts
Delete
GetBestMatchFont
Load
LoadFromFile
LoadFromResource
LoadFromStream

See Also

FontManager