Page 1 of 1

Printresolution

Posted: Thu Feb 26, 2004 10:17 pm
by 8439995
What formula does TeeChart use to calculate font sizes for printing from
Printresolution?
I just want the font sizes on the printout to always be 10 point regardless
of screen size, printer resolution, physical output size etc.
I can't come up with a way of setting PrintResolution that will give me a
consistent printer font size for axes labels, title, legends etc.
Thanks

Steve Sidwell

Printresolution

Posted: Fri Feb 27, 2004 2:29 am
by 8439995
After a lot of trial and error this seems to work:

pixperinch := getdevicecaps(printer.handle, LOGPIXELSY);
factor := pixperinch / screen.PixelsPerInch;
w1 := (prect.Bottom - prect.Top);
w2 := round(aChart.height * factor);
aChart.PrintResolution := -(w1 - w2) * 100 div w2;
aChart.PrintPartialCanvas(printer.Canvas, prect);

The fonts always come out the same same now regardless of the size of the chart on screen, the size of the rectangle on the print canvas or the printer resolution.
Please can you confirm this is correct?

Thanks

Steve Sidwell

Posted: Fri Feb 27, 2004 8:52 am
by Marjan
Hi, Steve.

The scaling is calculated internally in the TeeProcs.pas unit, more speficically, in the Procedure TCustomTeePanel.CalcMetaBounds and TCustomTeePanel.PrintPartialCanvas methods. The code you used is very close to the one we used. I've sent both methods sources to your email address.

Re: Printresolution

Posted: Tue Jan 30, 2007 2:34 pm
by 5891343
8439995 wrote:After a lot of trial and error this seems to work:

pixperinch := getdevicecaps(printer.handle, LOGPIXELSY);
factor := pixperinch / screen.PixelsPerInch;
w1 := (prect.Bottom - prect.Top);
w2 := round(aChart.height * factor);
aChart.PrintResolution := -(w1 - w2) * 100 div w2;
aChart.PrintPartialCanvas(printer.Canvas, prect);
I tried this on some plot with several fastline graphics, but, I got nice fonts on labels, but, the graphs got very thick and very little information visible compared to the window presentation.

I for my part want the resolution of the graphs as with printresolution -100, but axis, ticks and fonts unchanged, so I really miss a switch telling that rescaling with printresolution -100 should only be done with graphs, not with axis, tics, fonts etc.

Now -100 gives invisible fonts (font size 0.001 or alike)
:-(
We need this for scientific publications.
(Fonts should then be 12 pt, axis line thickness about 1/2-1 mm etc.

Please have a look at http://folk.uio.no/achristo/ActiCalc/gr ... lution.htm for more details

Posted: Mon Feb 05, 2007 4:45 pm
by Pep
Hi,

one way to solve this could be by chaning the FontZoom and Pen width before do the print :

Chart1.View3DOptions.FontZoom:=200;
Chart1.Axes.Left.Ticks.Width:=2;

Posted: Mon Feb 05, 2007 4:52 pm
by 5891343
Pep wrote:Hi,

one way to solve this could be by chaning the FontZoom and Pen width before do the print :

Chart1.View3DOptions.FontZoom:=200;
Chart1.Axes.Left.Ticks.Width:=2;
Ok. I'll try that.