#1 2010-10-03 10:00:15

nzsolt
Member
Registered: 2010-10-03
Posts: 5

font position problem

Hi,

synpdf is a great tool, thanks for it!
It works, but there is a problem with a compressed font.
The letters position is not good, all are the same.
I made a test package: (you can download from here http://www.nodesystems.hu/pdftest.zip)
it contains the ttf file, a meta file (which is good) and the pdf (with wrong letter position)

Can you tell what is the solution?

Our pdf maker pas source:

procedure TMyPrinter.SaveToPDF(const TheFile : String);
var i:integer;
    xPDF:TPdfDocument;
    meta:TMetaFile;
begin
try
  xPDF:=TPdfDocument.Create;
  xPDF.NewDoc;
  for i:=1 to PageCount do
  begin
   meta:=MetaFiles[ i ];
   xPDF.AddPage;
   xPDF.Canvas.RenderMetaFile(meta);
  end;
  xPDF.SaveToFile(TheFile);
finally
  xPDF.Free;
end;
end;

Thanks!

Last edited by nzsolt (2010-10-03 10:11:54)

Offline

#2 2010-10-07 16:13:51

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,205
Website

Re: font position problem

OK! I'll take a look at that next week.
(I'm currently on the road, but next week, I'll have some time)

I guess it's because the individual positioning (the dxpoints field of the EMRTEXT record AFAIR) is not handled by the unit.
These positions are making pdf files bigger, and are usualy not necessary at all.
So there was no support yet of these data. Because no one used them yet...

I'll check that this is the reason of the problem.
Then implement, on option, this individual positioning.

I think it will fulfill your requirements.

Offline

#3 2010-10-08 05:12:34

nzsolt
Member
Registered: 2010-10-03
Posts: 5

Re: font position problem

Maybe the TTF file cause the problem, because the standard windows fonts appear good.
I made another test package (you can download from here http://www.nodesystems.hu/pdftest2.zip)
There are a metafile and a pdf in it. The Times New Roman text is good.

Our pas was changed to:  (for resizing and margin handling)

   ...   
   xPDF.AddPage;
   sc:=(xpdf.DefaultPageHeight*Screen.PixelsPerInch/72)/PageSize.Y;
   xPDF.Canvas.RenderMetaFile(meta,sc,XOff*sc,YOff*sc*-1);
   ...

Thanks!

Offline

#4 2010-10-08 08:43:06

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,205
Website

Re: font position problem

I've some tools to enumerate an emf, but no tool available to check the ttf file content.

About the font system, there may be a problem in the current implementation: there is no Font-Fallback implemented yet.
See http://msdn.microsoft.com/en-us/library … S.85).aspx
That means that the ttf file must contain all characters displayed.
Your ttf file perhaps doesn't contain these characters, therefore there is nothing displayed.
Another possibility is that this ttf file is not installed under your Windows....

But if the pdf contains the characters, but at a wrong position, it could probably be another issue...

Did you try with Uniscribe ON?

Offline

#5 2010-10-08 12:25:44

nzsolt
Member
Registered: 2010-10-03
Posts: 5

Re: font position problem

I try the xpdf.UseUniscribe:=True but nothing changed, the letters appear but wrong postion,
it is look like it draws the first carachter and the next one hasn't width or width=0 and give the same postion like the first character.

Offline

#6 2010-10-17 08:51:57

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,205
Website

Re: font position problem

I didn't have time to check it yet....
Because I expect that your request will need some important code change.

Stay tuned!

Offline

#7 2010-11-18 08:52:59

nzsolt
Member
Registered: 2010-10-03
Posts: 5

Re: font position problem

It's solved! The TTF file was bad, after doing an AutoMetrics (in FontCreator), the printed pdfs are good.
Thanks for this great tool!

Offline

#8 2010-11-18 11:06:08

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,205
Website

Re: font position problem

This is a very very good news!!!!

smile

Offline

Board footer

Powered by FluxBB