[Lazarus] Font ligatures support

classic Classic list List threaded Threaded
39 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
> -> => >= <= *** .. ... <> >< >> << >>> <<< == !=
>
> Visual Studio shows all as ligatures except the first one

It's trivial - synedit just doesn't TextOut such symbols in one block,
ie it doesn't renders '->' as 2 chars but renders it as 2 chars - and >.
Same for >>> and <<< etc.

--
Regards,
Alexey

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 06/10/2020 01:01, Maxim Ganetsky via lazarus wrote:

> 05.10.2020 18:36, Martin Frb via lazarus пишет:
>> On 05/10/2020 00:27, Maxim Ganetsky via lazarus wrote:
>>> Lazarus hangs on start for me on Windows 7 when compiled with this
>>> define.
>>>
>>> Lazarus 2.1.0 r63957 FPC 3.2.0 i386-win32-win32/win64. I use
>>> JetBrains Mono font.
>>>
>>
>> The other ...TextOut in the lines below that should be kept as they are.
>
> This change does not help.

Ok, I installed Win7 in a virtualbox, got Lazarus, installed the
"JetBrains mono" font (just the regular, skipped all the
light/italics....) and "JetBrains mono Variable".

No crash.
Ligatures work (well the subset as described in other mail)

Without any way of reproducing, there isn't much I can do.

----
Can you try to catch it in the debugger, and see what params are given
to NewTextOut
in
#2  0x00ab95f6 in DRAWHILIGHTMARKUPTOKEN (ATOKENINFO=...,
parentfp=0x13abf6e8)
     at lazsyntextarea.pp:1741

  fTextDrawer.NewTextOut(TxtLeft, rcToken.Top, TxtFlags, tok,
ATokenInfo.Tk.TokenStart, ATokenInfo.Tk.TokenLength, FEtoBuf);

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

[Lazarus] @Alexey length(Glyph) [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 03/10/2020 16:34, Alexey Tor. via lazarus wrote:
> It's not very simple. see file
> https://github.com/Alexey-T/ATSynEdit/blob/master/atsynedit/atsynedit_canvasproc.pas 
>
> and search for "ligatures" in all places. Unit has special code for
> win32.

Just a note

     if GetCharacterPlacementW(DC, PWChar(Str), Length(Str), 0,
@CharPlaceInfo, GCP_LIGATE)<> 0 then
       Result:= Windows.ExtTextOutW(DC, X, Y, ETO_CLIPPED or ETO_OPAQUE
or ETO_GLYPH_INDEX, Rect, Pointer(Glyphs), Length(Glyphs), Dx)

Should that be
   CharPlaceInfo.nGlyphs
instead of
   Length(Glyphs)
?

GetCharacterPlacementW may return up to (but therefore also less than) 
Length(Glyphs) glyphs.
So ExtTextOutW should get the adjusted count?




--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 04/10/2020 18:05, Martin Frb wrote:
On 04/10/2020 10:14, Mr Bee wrote:
If it does work, would you please submit it as a patch for the next release? At least, add a note that the font ligatures feature only supports monospaced fonts and only works on Windows. It's better than nothing.

revision 63951

Windows only, compile with -dWINDOWS_LIGATURE
Tested with Cascadia.

I did add a couple of checks. Amended it for right to left languages (Arabic).

Arabic only works with certain fonts.
And Japanese Katakana seems not to work at all (or I have not found a supporting font, while without this feature it works with "Deja Vue" and others).

It appears that this API restricts Windows font substitution abilities.
It might be that in order for all this to work, one has to use the newer "uniscribe" API.

I also kind of assume that in the current IFDEF code the use of the DX array (ETO) is wrong. But I could not produce any errors from that / And it only would happen if  NeedETO = True.

So for the moment, this stays highly experimental.


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list


06.10.2020 13:32, Martin Frb via lazarus пишет:

> On 06/10/2020 01:01, Maxim Ganetsky via lazarus wrote:
>> 05.10.2020 18:36, Martin Frb via lazarus пишет:
>>> On 05/10/2020 00:27, Maxim Ganetsky via lazarus wrote:
>>>> Lazarus hangs on start for me on Windows 7 when compiled with this
>>>> define.
>>>>
>>>> Lazarus 2.1.0 r63957 FPC 3.2.0 i386-win32-win32/win64. I use
>>>> JetBrains Mono font.
>>>>
>>>
>>> The other ...TextOut in the lines below that should be kept as they are.
>>
>> This change does not help.
>
> Ok, I installed Win7 in a virtualbox, got Lazarus, installed the
> "JetBrains mono" font (just the regular, skipped all the
> light/italics....) and "JetBrains mono Variable".
>
> No crash.
> Ligatures work (well the subset as described in other mail)
>
> Without any way of reproducing, there isn't much I can do.
>
> ----
> Can you try to catch it in the debugger, and see what params are given
> to NewTextOut
> in
> #2  0x00ab95f6 in DRAWHILIGHTMARKUPTOKEN (ATOKENINFO=...,
> parentfp=0x13abf6e8)
>     at lazsyntextarea.pp:1741
>
>  fTextDrawer.NewTextOut(TxtLeft, rcToken.Top, TxtFlags, tok,
> ATokenInfo.Tk.TokenStart, ATokenInfo.Tk.TokenLength, FEtoBuf);

Can you add some debugln in a format convenient to you? This will
simplify things, I think.

--
Best regards,
 Maxim Ganetsky                  mailto:[hidden email]
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
On 06/10/2020 15:09, Maxim Ganetsky via lazarus wrote:

>
> ----
> Can you try to catch it in the debugger, and see what params are given
> to NewTextOut
> in
> #2  0x00ab95f6 in DRAWHILIGHTMARKUPTOKEN (ATOKENINFO=...,
> parentfp=0x13abf6e8)
>      at lazsyntextarea.pp:1741
>
>   fTextDrawer.NewTextOut(TxtLeft, rcToken.Top, TxtFlags, tok,
> ATokenInfo.Tk.TokenStart, ATokenInfo.Tk.TokenLength, FEtoBuf);
> Can you add some debugln in a format convenient to you? This will
> simplify things, I think.
>
This is in the paint handler, and it is called for each token. So
potentially very slow with debugln.

But since it is in startup, hopefully you wont have to many.

Apply this patch please

diff --git a/components/synedit/lazsyntextarea.pp
b/components/synedit/lazsyntextarea.pp
index 4c5a599c9b..163af24e6c 100644
--- a/components/synedit/lazsyntextarea.pp
+++ b/components/synedit/lazsyntextarea.pp
@@ -1737,6 +1737,7 @@ procedure TLazSynTextArea.PaintTextLines(AClip:
TRect; FirstLine, LastLine,
      if rcToken.Right > nRightEdge + 1 then
        tok.Bottom := rcLine.Bottom;
      TxtLeft := ScreenColumnToXValue(ATokenInfo.PhysicalCharStart); //
because for the first token, this can be middle of a char, and lead to
wrong frame
+debugln('Calling NewTextOut L: %s rcT: %s tok: %s tkt: %s // %s // eto:
%s', [dbgs(TxtLeft), dbgs(rcToken), dbgs(tok),
dbgMemRange(PByte(ATokenInfo.Tk.TokenStart), ATokenInfo.Tk.TokenLength),
dbgs(ATokenInfo.Tk.TokenLength), dbgs(Length(FEtoBuf.EtoData)) ]);
      fTextDrawer.NewTextOut(TxtLeft, rcToken.Top, TxtFlags, tok,
        ATokenInfo.Tk.TokenStart, ATokenInfo.Tk.TokenLength, FEtoBuf);

diff --git a/components/synedit/syntextdrawer.pp
b/components/synedit/syntextdrawer.pp
index 834d442563..ddbb09f4df 100644
--- a/components/synedit/syntextdrawer.pp
+++ b/components/synedit/syntextdrawer.pp
@@ -1267,9 +1267,14 @@ procedure TheTextDrawer.NewTextOut(X, Y: Integer;
fuOptions: UINT;
      CharPlaceInfo.lpGlyphs:= @Glyphs[0];
      CharPlaceInfo.nGlyphs:= Length(Glyphs);
      Glyphs[0] := #0;
+debugln('BEFORE');
      if GetCharacterPlacementW(FDC, PWChar(W), Length(W), 0,
CharPlaceInfo, GCP_LIGATE or GCP_REORDER or GCP_GLYPHSHAPE)<> 0 then begin
+debugln('GOT PLACEMENT %s  / %s  / %s', [dbgs(length(Glyphs)),
dbgs(CharPlaceInfo.nGlyphs), dbgs(CharPlaceInfo.lpGlyphs=@Glyphs[0]) ]);
+if CharPlaceInfo.nGlyphs > 0 then begin
+debugln('GOT --- %s  / %s', [dbgs(length(Glyphs)),
dbgMemRange(CharPlaceInfo.lpGlyphs, 2*CharPlaceInfo.nGlyphs)]);
        Windows.ExtTextOutW(FDC, X, Y, fuOptions or ETO_GLYPH_INDEX,
@ARect, Pointer(Glyphs), CharPlaceInfo.nGlyphs, EtoArray);
        exit;
+end;
      end;
    end;
    {$ENDIF}

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
06.10.2020 16:23, Martin Frb via lazarus пишет:

> On 06/10/2020 15:09, Maxim Ganetsky via lazarus wrote:
>>
>> ----
>> Can you try to catch it in the debugger, and see what params are given
>> to NewTextOut
>> in
>> #2  0x00ab95f6 in DRAWHILIGHTMARKUPTOKEN (ATOKENINFO=...,
>> parentfp=0x13abf6e8)
>>      at lazsyntextarea.pp:1741
>>
>>   fTextDrawer.NewTextOut(TxtLeft, rcToken.Top, TxtFlags, tok,
>> ATokenInfo.Tk.TokenStart, ATokenInfo.Tk.TokenLength, FEtoBuf);
>> Can you add some debugln in a format convenient to you? This will
>> simplify things, I think.
>>
> This is in the paint handler, and it is called for each token. So
> potentially very slow with debugln.
>
> But since it is in startup, hopefully you wont have to many.
>
> Apply this patch please


With this patch applied Lazarus seems to crash on debugln in
lazsyntextarea.pp. Just in case, I tried to remove this particular
debugln, then it printed 'BEFORE' and nothing more.

i:\FPC\lazarus>lazarus --debug-output=.\dbgoutput.txt
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions]
PrimaryConfigPath="C:\Users\Maxim
\AppData\Local\lazarus"
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions]
SecondaryConfigPath="i:\FPC\lazar
us"
Hint: (lazarus) [TMainIDE.LoadGlobalOptions]
Hint: (lazarus) LastCalled="I:\FPC\lazarus\lazarus.old.working.exe"
Hint: (lazarus) CurPrgName="i:\FPC\lazarus\lazarus.exe"
Hint: (lazarus)
AltPrgName="C:\Users\Maxim\AppData\Local\lazarus\bin\lazarus.exe
"
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=i386-win32-win32
New=i386-win
32-win32 Changed: OS/CPU=True LCL=False
TApplication.HandleException: EAccessViolation
Access violation
   Stack trace:
   $00C12B2D  DRAWHILIGHTMARKUPTOKEN,  line 1740 of lazsyntextarea.pp
   $00C11C76  PAINTLINES,  line 1799 of lazsyntextarea.pp
   $00C11847  PAINTTEXTLINES,  line 1871 of lazsyntextarea.pp
   $00C113D8  DOPAINT,  line 1489 of lazsyntextarea.pp
   $00C07EA0  PAINT,  line 1308 of syneditmiscclasses.pp
   $00C0FDD2  DOPAINT,  line 1134 of lazsyntextarea.pp
   $00C07EA0  PAINT,  line 1308 of syneditmiscclasses.pp
   $00D9A022  DOPAINT,  line 1353 of sourcesyneditor.pas
   $00C07EA0  PAINT,  line 1308 of syneditmiscclasses.pp
   $0079ECCB  PAINT,  line 4221 of synedit.pp
   $005B3471  PAINTWINDOW,  line 123 of include/customcontrol.inc
   $0059BB7B  PAINTHANDLER,  line 4857 of include/wincontrol.inc
   $005A00A4  WMPAINT,  line 6851 of include/wincontrol.inc
   $005B3330  WMPAINT,  line 103 of include/customcontrol.inc
   $004103A1
   $0059D0A7  WNDPROC,  line 5429 of include/wincontrol.inc
   $007A6B0F  WNDPROC,  line 6399 of synedit.pp
FreeFormEditor: FormEditor1=TFormEditor
Hint: (lazarus) [TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE
Hint: (lazarus) [TMainIDE.Destroy] END
Heap dump by heaptrc unit of i:\FPC\lazarus\lazarus.exe
6222427 memory blocks allocated : 556846869/572547168
6211889 memory blocks freed     : 555436555/571105040
10538 unfreed memory blocks : 1410314
True heap size : 28114944 (128 used in System startup)
True free heap : 25543392
Should be : 25661040
Call trace for block $1CEE6DD0 size 64
   $00418EBF
   $770034A1
   $77003473
   $76FB0133
   $00C11C76  PAINTLINES,  line 1799 of lazsyntextarea.pp
   $00C11847  PAINTTEXTLINES,  line 1871 of lazsyntextarea.pp
   $00C113D8  DOPAINT,  line 1489 of lazsyntextarea.pp
   $00C07EA0  PAINT,  line 1308 of syneditmiscclasses.pp
   $00C0FDD2  DOPAINT,  line 1134 of lazsyntextarea.pp
   $00C07EA0  PAINT,  line 1308 of syneditmiscclasses.pp
   $00D9A022  DOPAINT,  line 1353 of sourcesyneditor.pas
   $00C07EA0  PAINT,  line 1308 of syneditmiscclasses.pp
   $0079ECCB  PAINT,  line 4221 of synedit.pp
   $005B3471  PAINTWINDOW,  line 123 of include/customcontrol.inc
   $0059BB7B  PAINTHANDLER,  line 4857 of include/wincontrol.inc
   $005A00A4  WMPAINT,  line 6851 of include/wincontrol.inc
Call trace for block $1C6FECD0 size 92

--
Best regards,
  Maxim Ganetsky                  mailto:[hidden email]
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
On 07/10/2020 01:42, Maxim Ganetsky via lazarus wrote:

> 06.10.2020 16:23, Martin Frb via lazarus пишет:
>> On 06/10/2020 15:09, Maxim Ganetsky via lazarus wrote:
>>>
>>> ----
>>> Can you try to catch it in the debugger, and see what params are given
>>> to NewTextOut
>>> in
>>> #2  0x00ab95f6 in DRAWHILIGHTMARKUPTOKEN (ATOKENINFO=...,
>>> parentfp=0x13abf6e8)
>>>      at lazsyntextarea.pp:1741
>>>
>>>   fTextDrawer.NewTextOut(TxtLeft, rcToken.Top, TxtFlags, tok,
>>> ATokenInfo.Tk.TokenStart, ATokenInfo.Tk.TokenLength, FEtoBuf);
>>> Can you add some debugln in a format convenient to you? This will
>>> simplify things, I think.
>>>
>> This is in the paint handler, and it is called for each token. So
>> potentially very slow with debugln.
>>
>> But since it is in startup, hopefully you wont have to many.
>>
>> Apply this patch please
>
>
> With this patch applied Lazarus seems to crash on debugln in
> lazsyntextarea.pp. Just in case, I tried to remove this particular
> debugln, then it printed 'BEFORE' and nothing more.

Sorry my fault, I thought I had all the nil checks....
Please replace that debugln with

debugln('Calling NewTextOut L: %s rcT: %s tok: %s tkt: %s // %s // eto:
%s', [dbgs(TxtLeft), dbgs(rcToken), dbgs(tok),
dbgMemRange(PByte(ATokenInfo.Tk.TokenStart), ATokenInfo.Tk.TokenLength),
dbgs(ATokenInfo.Tk.TokenLength), dbgs(FEtoBuf<>nil) ]);


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
07.10.2020 14:23, Martin Frb via lazarus пишет:

> On 07/10/2020 01:42, Maxim Ganetsky via lazarus wrote:
>> 06.10.2020 16:23, Martin Frb via lazarus пишет:
>>> On 06/10/2020 15:09, Maxim Ganetsky via lazarus wrote:
>>>>
>>>> ----
>>>> Can you try to catch it in the debugger, and see what params are given
>>>> to NewTextOut
>>>> in
>>>> #2  0x00ab95f6 in DRAWHILIGHTMARKUPTOKEN (ATOKENINFO=...,
>>>> parentfp=0x13abf6e8)
>>>>      at lazsyntextarea.pp:1741
>>>>
>>>>   fTextDrawer.NewTextOut(TxtLeft, rcToken.Top, TxtFlags, tok,
>>>> ATokenInfo.Tk.TokenStart, ATokenInfo.Tk.TokenLength, FEtoBuf);
>>>> Can you add some debugln in a format convenient to you? This will
>>>> simplify things, I think.
>>>>
>>> This is in the paint handler, and it is called for each token. So
>>> potentially very slow with debugln.
>>>
>>> But since it is in startup, hopefully you wont have to many.
>>>
>>> Apply this patch please
>>
>>
>> With this patch applied Lazarus seems to crash on debugln in
>> lazsyntextarea.pp. Just in case, I tried to remove this particular
>> debugln, then it printed 'BEFORE' and nothing more.
>
> Sorry my fault, I thought I had all the nil checks....
> Please replace that debugln with
>
> debugln('Calling NewTextOut L: %s rcT: %s tok: %s tkt: %s // %s // eto:
> %s', [dbgs(TxtLeft), dbgs(rcToken), dbgs(tok),
> dbgMemRange(PByte(ATokenInfo.Tk.TokenStart), ATokenInfo.Tk.TokenLength),
> dbgs(ATokenInfo.Tk.TokenLength), dbgs(FEtoBuf<>nil) ]);

I got the following output:

i:\FPC\lazarus>lazarus
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions]
PrimaryConfigPath="C:\Users\Maxim
\AppData\Local\lazarus"
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions]
SecondaryConfigPath="i:\FPC\lazar
us"
Hint: (lazarus) [TMainIDE.LoadGlobalOptions]
Hint: (lazarus) LastCalled="I:\FPC\lazarus\lazarus.old.working.exe"
Hint: (lazarus) CurPrgName="i:\FPC\lazarus\lazarus.exe"
Hint: (lazarus)
AltPrgName="C:\Users\Maxim\AppData\Local\lazarus\bin\lazarus.exe
"
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=i386-win32-win32
New=i386-win
32-win32 Changed: OS/CPU=True LCL=False
Calling NewTextOut L: 71 rcT: l=71,t=36,r=85,b=54 tok:
l=71,t=36,r=85,b=54 tkt:
2020 // 2 // eto: False
BEFORE

--
Best regards,
  Maxim Ganetsky                  mailto:[hidden email]
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
On 09/10/2020 00:55, Maxim Ganetsky via lazarus wrote:
> Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=i386-win32-win32
> New=i386-win
> 32-win32 Changed: OS/CPU=True LCL=False
> Calling NewTextOut L: 71 rcT: l=71,t=36,r=85,b=54 tok:
> l=71,t=36,r=85,b=54 tkt:
> 2020 // 2 // eto: False
> BEFORE
>

That output looks all ok.

I concluded from the output that you have a 32 bit IDE.
So I checked => 32 bit IDE crashes for me too.
 From the bit of debugging I have done, this may be a stack corruption.
I had cases where the OS returned to NewTextOut (even though indicating
that GetCharacterPlacementW failed), but NewTextOut crashed on exit.
(either in its internal finally handler, or on actually returning to parent)

Interestingly on Win10 a 32bit IDE - while not crashing - does not
display ligatures. The call to GetCharacterPlacementW returns failed.

Anyway, I squeezed this in, under the assumption it might be a quick
solution.
So this will have to go back on the todo list.
If someone has any worthwhile idea what might cause the issue....

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
On 09/10/2020 03:14, Martin Frb via lazarus wrote:

> On 09/10/2020 00:55, Maxim Ganetsky via lazarus wrote:
>> Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=i386-win32-win32
>> New=i386-win
>> 32-win32 Changed: OS/CPU=True LCL=False
>> Calling NewTextOut L: 71 rcT: l=71,t=36,r=85,b=54 tok:
>> l=71,t=36,r=85,b=54 tkt:
>> 2020 // 2 // eto: False
>> BEFORE
>>
>
> That output looks all ok.
>
> I concluded from the output that you have a 32 bit IDE.
> So I checked => 32 bit IDE crashes for me too.
> From the bit of debugging I have done, this may be a stack corruption.
> I had cases where the OS returned to NewTextOut (even though
> indicating that GetCharacterPlacementW failed), but NewTextOut crashed
> on exit. (either in its internal finally handler, or on actually
> returning to parent)
>
> Interestingly on Win10 a 32bit IDE - while not crashing - does not
> display ligatures. The call to GetCharacterPlacementW returns failed.

One more think
Lazarus build with 32bit 3.0.4 on win 7 does not crash. (But ligatures
do not work either).
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
It might be dead simple (at least I hope)

{$IFDEF WINDOWS_LIGATURE}
function GetCharacterPlacementW(hdc: HDC; lpString: LPCWSTR; nCount,
nMaxExtend: Integer; var lpResults: GCP_RESULTSW; dwFlags: DWORD):
DWORD; stdcall; external 'gdi32' name 'GetCharacterPlacementW';
{$ENDIF}

Add stdcall.

At least on win10 that makes 32bit working. Not booting up win 7 again.

I took the declaration from the windows units in fpc => which has some
wrongly typed params that I adjusted.
But it also does not have stdcall.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
On 09.10.2020 04:33, Martin Frb via lazarus wrote:
> It might be dead simple (at least I hope)
>
> {$IFDEF WINDOWS_LIGATURE}
> function GetCharacterPlacementW(hdc: HDC; lpString: LPCWSTR; nCount,
> nMaxExtend: Integer; var lpResults: GCP_RESULTSW; dwFlags: DWORD):
> DWORD; stdcall; external 'gdi32' name 'GetCharacterPlacementW';
> {$ENDIF}
>
> Add stdcall.

Yes, the stdcall fixes the crash for me on Windows 10 64bit & Lazarus
IDE 32bit.

But the ligatures are not very promising. I get ':=' as ligature but
nothing else.

Ondrej

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list


On 9-10-2020 04:33, Martin Frb via lazarus wrote:

> It might be dead simple (at least I hope)
>
> {$IFDEF WINDOWS_LIGATURE}
> function GetCharacterPlacementW(hdc: HDC; lpString: LPCWSTR; nCount,
> nMaxExtend: Integer; var lpResults: GCP_RESULTSW; dwFlags: DWORD):
> DWORD; stdcall; external 'gdi32' name 'GetCharacterPlacementW';
> {$ENDIF}
>
> Add stdcall.
>
> At least on win10 that makes 32bit working. Not booting up win 7 again.
>
> I took the declaration from the windows units in fpc => which has some
> wrongly typed params that I adjusted.
> But it also does not have stdcall.

All winapi calls should have stdcall, at least the ones without are
suspicious
(iirc for win64 we use the same calling convention so you might not notice)

Marc
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list

Op 2020-10-09 om 04:33 schreef Martin Frb via lazarus:
>
>
> I took the declaration from the windows units in fpc => which has some
> wrongly typed params that I adjusted.
> But it also does not have stdcall.

Windows unit has {$calling stdcall} globally

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 09/10/2020 09:06, Ondrej Pokorny via lazarus wrote:
>
> But the ligatures are not very promising. I get ':=' as ligature but
> nothing else.

You probably will see more inside comments or strings, or if the
highlighter is off.

In my tests, I did get in normal pascal source <= >= ..
But not ... or =>

The latter are not a single token to the highlighter, so they get broken
into text fragments.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
On 09.10.2020 14:11, Martin Frb via lazarus wrote:

> On 09/10/2020 09:06, Ondrej Pokorny via lazarus wrote:
>> But the ligatures are not very promising. I get ':=' as ligature but
>> nothing else.
>
> You probably will see more inside comments or strings, or if the
> highlighter is off.
>
> In my tests, I did get in normal pascal source <= >= ..
> But not ... or =>
>
> The latter are not a single token to the highlighter, so they get
> broken into text fragments.

Ah, that's true.

Ondrej
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Win 7 issue / Re: -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
09.10.2020 5:33, Martin Frb via lazarus пишет:

> It might be dead simple (at least I hope)
>
> {$IFDEF WINDOWS_LIGATURE}
> function GetCharacterPlacementW(hdc: HDC; lpString: LPCWSTR; nCount,
> nMaxExtend: Integer; var lpResults: GCP_RESULTSW; dwFlags: DWORD):
> DWORD; stdcall; external 'gdi32' name 'GetCharacterPlacementW';
> {$ENDIF}
>
> Add stdcall.
>
> At least on win10 that makes 32bit working. Not booting up win 7 again.

Yes, my IDE is 32 bit. It works now correctly for me on Win7 too. Thanks!

--
Best regards,
  Maxim Ganetsky                  mailto:[hidden email]
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] -dWINDOWS_LIGATURE [[Re: Font ligatures support]]

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 04/10/2020 18:05, Martin Frb via lazarus wrote:
On 04/10/2020 10:14, Mr Bee wrote:
If it does work, would you please submit it as a patch for the next release? At least, add a note that the font ligatures feature only supports monospaced fonts and only works on Windows. It's better than nothing.

revision 63951

Windows only, compile with -dWINDOWS_LIGATURE
Tested with Cascadia.

Just as an update this breaks other scripts

    dbg.Arguments := 'a b c ä ö 😁 X あsf';

Using Deja vue mono, normally all chars are shown (maybe with windows build in font substitution).

With the patch, the smiley and Japanese (including the 2 full-widths chars) are no longer shown.


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
12