PDFium Delphi Component Docs

ConfigureSystemFontCacheGovernor procedure

Units: PDFium, FPdfCache
Includes process-wide system-font results in a caller-selected shared byte budget

Syntax

procedure ConfigureSystemFontCacheGovernor(Governor: TPdfCacheGovernor);

Description

Call the procedure whilst PDFium is unloaded

Changing the governor clears retained system-font results and releases their old tokens

Passing nil restores entry-count-only system-font caching

Calling the procedure whilst PDFium is loaded raises EPdfError

Lifetime

The caller owns the governor

The governor must outlive the configured system-font cache

Before freeing it, call UnloadLibrary and then ConfigureSystemFontCacheGovernor(nil)

Example

var
  Governor: TPdfCacheGovernor;
begin
  Governor := TPdfCacheGovernor.Create(Int64(64) * 1024 * 1024);
  try
    UnloadLibrary;
    ConfigureSystemFontCacheGovernor(Governor);
    LoadLibrary;
    RunDocumentWork;
    UnloadLibrary;
    ConfigureSystemFontCacheGovernor(nil);
  finally
    Governor.Free;
  end;
end;

See Also

FPdfCache, ConfigureSystemFontProvider, LoadLibrary, UnloadLibrary