synopse / mORMot

Synopse mORMot 1 ORM/SOA/MVC framework - Please upgrade to mORMot 2 !
https://synopse.info
785 stars 323 forks source link

Revert the pull request 46 #407

Closed tim-lebedkov closed 2 years ago

tim-lebedkov commented 2 years ago

The change in pull request 46 seems to be invalid: https://github.com/synopse/SynPDF/pull/46

Here is the code I used to test this.

The output was: MS Sans Serif 2 Microsoft Sans Serif 2 Courier New 1 Courier 1

This means that "(ALogFont.lfPitchAndFamily and 3) = FIXED_PITCH" would evaluate for the parameter AIsFixedWidth to

MS Sans Serif 2 => False Microsoft Sans Serif 2 => False Courier New 1 => True Courier 1 => True

This is correct.

@maykon-t can you test on your computer?

// JCL_DEBUG_EXPERT_GENERATEJDBG OFF
program TestFonts;

{$APPTYPE CONSOLE}

{$R *.res}

uses
    System.SysUtils, Windows;

function EnumFontsProc(var LogFont: TLogFont; var TextMetric: TTextMetric;
    FontType: Integer; Data: Pointer): Integer; stdcall;
begin
    WriteLn(string(LogFont.lfFaceName), ' ', LogFont.lfPitchAndFamily and 3);

    Result := 1;
end;

var
    DC: HDC;
    F: LOGFONTW;
begin
    DC := GetDC(0);
    try
        FillChar(F, sizeof(F), 0);
        F.lfCharset := DEFAULT_CHARSET;
        EnumFontFamiliesEx(DC, F, @EnumFontsProc, 0, 0);
    finally
        ReleaseDC(0, DC);
    end;
    ReadLn;
end.
synopse commented 2 years ago

Please use the SynPdf repository for this.

But it is very difficult to merge SynPdf fixes. Sometimes it is fixed for one user which send the pull request, but it breaks existing and working code of other users.

tim-lebedkov commented 2 years ago

Normally this happens if the developer is not skilled enough to manage the project. This is clearly not the case. I can only guess what the actual problem is.