function TExportFonts.AddItem(AFontName: string; AFontStyle: TFontStyles
): TExportFontItem;
var
S1, S2, S3: String;
ext: string; // added by me
begin
Result:=FindItem(AFontName, AFontStyle);
if Assigned(Result) then exit;
if Assigned(gTTFontCache.Find(AFontName, Graphics.fsBold in AFontStyle, Graphics.fsItalic in AFontStyle)) then
begin
Result:=TExportFontItem.Create(Self, AFontName, AFontStyle);
S1:=ExtractFileDir(Result.FTTFFontInfo.FileName);
S2:=ExtractFileName(Result.FTTFFontInfo.FileName);
S3:=AFontName;
// added - start
ext:='';
if (Graphics.fsBold in AFontStyle) then
ext:=ext+'b';
if (Graphics.fsItalic in AFontStyle) then
ext:=ext+'i';
S3:=S3+ext;
// added - end
FOwner.FPDFDocument.FontDirectory:=S1;
Result.FPdfFont:=FOwner.FPDFDocument.AddFont(S2, S3);
end
else
Result:=FDefaultFontNormal;
end;