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

2020-10-08 Thread 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.

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
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


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

2020-10-08 Thread Martin Frb via lazarus

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
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


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

2020-10-08 Thread Martin Frb via lazarus

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
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


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

2020-10-08 Thread Maxim Ganetsky via lazarus

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:gan...@narod.ru
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Feature Request: Override/Implement methods

2020-10-08 Thread Ondrej Pokorny via lazarus

On 08.10.2020 02:02, Mattias Gaertner via lazarus wrote:

As for overrides:
Insert a new line in the class declaration, Ctrl+Space, select the
parent method. This will create an override.


And the same goes for interfaces. Ctrl+Space offers methods from 
interfaces as well.


Ondrej

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Feature Request: Override/Implement methods

2020-10-08 Thread Marc Weustink via lazarus



On 8-10-2020 02:02, Mattias Gaertner via lazarus wrote:

On Thu, 8 Oct 2020 01:36:23 +0200
Martin Frb via lazarus  wrote:


On 08/10/2020 01:16, Graeme Geldenhuys via lazarus wrote:

Hi,

I've pulled the latest Lazarus code and went through all the menu
items I could find but could see what I was looking for. Does
Lazarus have a feature eg: (Editor -> Source [popup menu] ->
Override/Implement Methods) so the IDE could stub out say missing
methods from a Interface I listed in the class definition, or allow
to override methods from parent classes?


AFAIK Closest we have is; Refactor > Abstract Methods.

Lists abstracts methods that are not overriden in this or parent
class (i.e that would still be abstract in this class)


As for overrides:
Insert a new line in the class declaration, Ctrl+Space, select the
parent method. This will create an override.


DUH... learning every day.

Marc
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus