Printing on Mac with FastReport FMX
I'm using the Font Courier New 10 point in my report because I thought it would be universal on the PC and the Mac. However, my report prints perfectly on the PC but the font is much smaller on the Mac. Is there a way to ensure the same font and size print on both platforms? My report has several text objects on the form, I tried setting the font in the BeforePrint event as follows but the font size did not change.
var
Page1: TfrxReportPage;
begin
Page1 := Myreport.Pages[1] as TfrxReportPage;
Page1.Font.Size := 12
Any help would be greatly appreciated
thank you
var
Page1: TfrxReportPage;
begin
Page1 := Myreport.Pages[1] as TfrxReportPage;
Page1.Font.Size := 12
Any help would be greatly appreciated
thank you
Comments
Solved this on my own. The PC uses pixels and the Mac uses points and they really do not correlate. I did some searching and came across a factor for windows font control. Since I develop in Windows, but deploy to both Windows and PC, this seems to work just fine. Note: I'm using the PrintPage event instead of the BeforePrint event because the preview renders fine on both platforms but if the code is in BeforePrint it also changes the preview. I've also figured out how to handle the impact to margins. If anyone is interested, let me know and I will share that code.
const
WFC = 1.33; //1.33 to compensate for the 96dpi on windows
var
I : integer;
O: TObject;
begin
{$IFDEF MACOS}
for I := 0 to page.AllObjects.Count - 1 do
begin
O := page.AllObjects.Items;
if O is TfrxMemoView then
TfrxMemoView(O).Font.Size := (TfrxMemoView(O).Font.Size * WFC);
end;
{$ENDIF}
end;