Persistent Font-Subset Cache

cache پایدار font-subset از تکرار subsetting پرهزینهٔ TrueType یا OpenType جلوگیری می‌کند، وقتی اسناد بعدی همان محتوای فونت و همان مجموعهٔ گلیف را استفاده کنند

Configuration

property FontSubsetCacheFolder: AnsiString;
property FontSubsetCacheMaxBytes: Int64;
function GetFontSubsetCacheInfo: THPDFFontSubsetCacheInfo;
procedure ClearFontSubsetCache;

An empty FontSubsetCacheFolder disables disk caching without changing font output

FontSubsetCacheMaxBytes به‌طور پیش‌فرض 256 MiB است و می‌توان آن را در زمان اجرا کاهش داد که بلافاصله eviction به روش least-recently-used را فعال می‌کند

آمار

THPDFFontSubsetCacheInfo contains HitCount, MissCount, WriteCount, EvictionCount, CorruptCount, RejectedCount, WriteFailureCount, CurrentBytes, and FileCount

Correctness and recovery

مثال

var
  Info: THPDFFontSubsetCacheInfo;
begin
  PDF.EnableFontSubsetting := True;
  PDF.FontSubsetCacheFolder := 'C:\ProgramData\MyApp\HotPDF\FontSubsets';
  PDF.FontSubsetCacheMaxBytes := 256 * 1024 * 1024;
  { create documents that use embedded TrueType or OpenType fonts }
  Info := PDF.GetFontSubsetCacheInfo;
end;

APIهای مرتبط