Printing on Mac with FastReport FMX

edited 3:29PM in FastReport VCL 5
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

Comments

  • edited 3:29PM
    jayE wrote: »
    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

    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;

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.