Browse Source

* Not the complete fix for bug ID #31092 was committed

git-svn-id: trunk@35131 -
michael 8 years ago
parent
commit
e342d3e15c
2 changed files with 9 additions and 6 deletions
  1. 6 3
      packages/fcl-pdf/src/fppdf.pp
  2. 3 3
      packages/fcl-pdf/src/fpttfsubsetter.pp

+ 6 - 3
packages/fcl-pdf/src/fppdf.pp

@@ -4360,9 +4360,12 @@ begin
   IDict:=CreateGlobalXRef.Dict;
   IDict:=CreateGlobalXRef.Dict;
   Trailer.AddReference('Info', GLobalXRefCount-1);
   Trailer.AddReference('Info', GLobalXRefCount-1);
   (Trailer.ValueByName('Size') as TPDFInteger).Value:=GLobalXRefCount;
   (Trailer.ValueByName('Size') as TPDFInteger).Value:=GLobalXRefCount;
-  IDict.AddString('Title',Infos.Title);
-  IDict.AddString('Author',Infos.Author);
-  IDict.AddString('Creator',Infos.ApplicationName);
+  if Infos.Title <> '' then
+    IDict.AddString('Title',Infos.Title);
+  if Infos.Author <> '' then
+    IDict.AddString('Author',Infos.Author);
+  if Infos.ApplicationName <> '' then
+    IDict.AddString('Creator',Infos.ApplicationName);
   IDict.AddString('Producer',Infos.Producer);
   IDict.AddString('Producer',Infos.Producer);
   IDict.AddString('CreationDate',DateToPdfDate(Infos.CreationDate));
   IDict.AddString('CreationDate',DateToPdfDate(Infos.CreationDate));
 end;
 end;

+ 3 - 3
packages/fcl-pdf/src/fpttfsubsetter.pp

@@ -930,10 +930,10 @@ var
   n: integer;
   n: integer;
 begin
 begin
   Result := TMemoryStream.Create;
   Result := TMemoryStream.Create;
-  for n := 0 to FGlyphIDList.Count-1 do
+  for n := 0 to FGlyphIDs.Count-1 do
   begin
   begin
-    WriteUInt16(Result, FFontInfo.Widths[FGlyphIDList[n].GlyphID].AdvanceWidth);
-    WriteInt16(Result, FFontInfo.Widths[FGlyphIDList[n].GlyphID].LSB);
+    WriteUInt16(Result, FFontInfo.Widths[FGlyphIDs[n].GID].AdvanceWidth);
+    WriteInt16(Result, FFontInfo.Widths[FGlyphIDs[n].GID].LSB);
   end;
   end;
 end;
 end;