Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-05-04 Thread Bart
@Paul:

Something else I noticed.
Can there be a relationship between this and bug
http://bugs.freepascal.org/view.php?id=13062 (IDE prints garbage on
screen)?

I ask this because I noticed that the broken version produced lots of
garbage on the screen, and after your fix, this has been reduced (not
gone though).
It seems to be a win9x issue only (so hardly anyone seems to bother).

Bart
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-05-01 Thread Bart
On 5/1/09, Paul Ishenin  wrote:
> Bernd Mueller wrote:
>  > Martin Friebe wrote:
>  >
>  >> The best is probably to try and find the revision which broke it.
>  >> Everything else is just blind search for a needle in a hay stack.
>  >>
>  >
>  > r19131 is the breaking revision.
>  >
>
> Please test with r19746.
>
>  Best regards,
>
> Paul Ishenin.
>

I updated to r19751: this looks OK again!
Thanks very much for the swift fix.
(The IDE was almost unusable ...)

Every now and then I'm forced to use D3, and I've gotten so used to
Lazarus I'd really rather not have to go back.

Bart
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-05-01 Thread Paul Ishenin
Bernd Mueller wrote:
> Martin Friebe wrote:
>   
>> The best is probably to try and find the revision which broke it.
>> Everything else is just blind search for a needle in a hay stack.
>> 
>
> r19131 is the breaking revision.
>   
Please test with r19746.

Best regards,
Paul Ishenin.
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-05-01 Thread Paul Ishenin
Bernd Mueller wrote:
> Martin Friebe wrote:
>   
>> The best is probably to try and find the revision which broke it.
>> Everything else is just blind search for a needle in a hay stack.
>> 
>
> r19131 is the breaking revision.
>   
Oh... my revision. I will try to test on win98 tomorow.

Best regards,
Paul Ishenin.
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-05-01 Thread Bernd Mueller
Martin Friebe wrote:
> The best is probably to try and find the revision which broke it.
> Everything else is just blind search for a needle in a hay stack.

r19131 is the breaking revision.

Regards, Bernd.

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-05-01 Thread Martin Friebe
Bart wrote:
> On 5/1/09, Martin Friebe  wrote:
>   
>>  I have attached a patch with a few debugln in it. I don't know if they will
>> show anything useful, since I have no idea what is going on.
>>  If you apply it, you need to start lazarus with a logfile, to capture the
>> output. (There is a command line switch, but I have to find it myself / I
>> usually compile as none "window app", which means my Lazarus runs with a
>> console-window showing all the output)
>>
>>  Also if you do this, test it with only one Synedit open. (You can compile a
>> standalone app, with one SynEdit, and set the font from inside the app)
>> 
>
> I applied the changes in sysnedit.pp and syneditextdrawer.pp
> then did a make clean all
>
> This happens when I build and start my test app.
>   
Does that test app use a syntax highlighter? From the output I would 
guess that it does not. (because the font is only recalculated in plain, 
but not in bold or italic / You "compare app with memo" in your 2nd mail 
shows  plain style only.)
Anyway, as long as it doesn't, the output looks good.

One thing I noted in the pictures of your first mail (highlighted pascal 
before/after): In the after text the output of the bold text seems to 
use a different font than plain text. Compare the "u". The plain "u" 
(and any u in the before pic) has serif/serif-like extensions. the bold 
"u" in the after pic, has not.

Regards the output below: the "default" and "courier" are normal, 
SynEdit creates them during it's own creation, before you even have a 
chance to set the font.
> In OI the font is set to Verdanana, size -12 (height 16), pitch fpFixed
>
> F:\LazarusProjecten>test
> SetStyle created font for idx=0 name=default handle=596
> SetBasefont name=default  basefont.name=default Handle=596
> SetBasefont name=default  NO pinfo
> SetStyle created font for idx=1 name=default handle=3364
> RecalcCharExtend for font name=courier / courier mono=False Handle=2360
> SetStyle created font for idx=0 name=courier handle=2360
> SetBasefont name=courier  basefont.name=courier Handle=2360
> SetStyle created font for idx=1 name=courier handle=2492
> RecalcCharExtend for font name=courier / courier mono=False Handle=2360
> SetBasefont name=courier  NO pinfo
> RecalcCharExtend for font name=courier / courier mono=False Handle=1760
> SetStyle created font for idx=0 name=courier handle=1760
> SetBasefont name=courier  basefont.name=courier Handle=1760
>   
Here you would have set Verdana
> RecalcCharExtend for font name=Verdana / Verdana mono=False Handle=1720
> SetStyle created font for idx=0 name=Verdana handle=1720
>   
idx=0 => plain, no-bold, no-italic
> SetBasefont name=Verdana  basefont.name=Verdana Handle=1720
>
>
> When I set the font (in my app) to Courier New, Normal, 10 pt, this is
> the output:
>
> RecalcCharExtend for font name=Courier New / Courier New mono=False 
> Handle=2308
> SetStyle created font for idx=0 name=Courier New handle=2308
> SetBasefont name=Courier New  basefont.name=Courier New Handle=2308
>
>
> If I change the font in Lazarus IDE, I see no output on console, or on logfile
> (startlazarus --debug --pcp=bla)
>   
>>  If you use the same font, (and in normal, bold, italic) for Labels and/or
>> StaticText, does it look correct there?
>> 
>
> TLabel and TStaticText seems to work normally
>   
The best is probably to try and find the revision which broke it.
Everything else is just blind search for a needle in a hay stack.

But in case, what happens with labels/statictext, if you  set pitch to 
variable/fixed?

Martin
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-05-01 Thread Bart
On 5/1/09, Bernd Mueller  wrote:
> Bart wrote:
>
> >
> > Is this a bug, or is there something wrong with my system?
> >
>
>  I can confirm the described behavior on my Windows 98 machine.

What was your latest revision that seemed to be OK?
(My latest was 18956, I hope yours is later...)
That would help us finding where things went wrong.

Bart
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-05-01 Thread Bart
On 5/1/09, Martin Friebe  wrote:
>  I have attached a patch with a few debugln in it. I don't know if they will
> show anything useful, since I have no idea what is going on.
>  If you apply it, you need to start lazarus with a logfile, to capture the
> output. (There is a command line switch, but I have to find it myself / I
> usually compile as none "window app", which means my Lazarus runs with a
> console-window showing all the output)
>
>  Also if you do this, test it with only one Synedit open. (You can compile a
> standalone app, with one SynEdit, and set the font from inside the app)

I applied the changes in sysnedit.pp and syneditextdrawer.pp
then did a make clean all

This happens when I build and start my test app.

In OI the font is set to Verdanana, size -12 (height 16), pitch fpFixed

F:\LazarusProjecten>test
SetStyle created font for idx=0 name=default handle=596
SetBasefont name=default  basefont.name=default Handle=596
SetBasefont name=default  NO pinfo
SetStyle created font for idx=1 name=default handle=3364
RecalcCharExtend for font name=courier / courier mono=False Handle=2360
SetStyle created font for idx=0 name=courier handle=2360
SetBasefont name=courier  basefont.name=courier Handle=2360
SetStyle created font for idx=1 name=courier handle=2492
RecalcCharExtend for font name=courier / courier mono=False Handle=2360
SetBasefont name=courier  NO pinfo
RecalcCharExtend for font name=courier / courier mono=False Handle=1760
SetStyle created font for idx=0 name=courier handle=1760
SetBasefont name=courier  basefont.name=courier Handle=1760
RecalcCharExtend for font name=Verdana / Verdana mono=False Handle=1720
SetStyle created font for idx=0 name=Verdana handle=1720
SetBasefont name=Verdana  basefont.name=Verdana Handle=1720


When I set the font (in my app) to Courier New, Normal, 10 pt, this is
the output:

RecalcCharExtend for font name=Courier New / Courier New mono=False Handle=2308
SetStyle created font for idx=0 name=Courier New handle=2308
SetBasefont name=Courier New  basefont.name=Courier New Handle=2308


If I change the font in Lazarus IDE, I see no output on console, or on logfile
(startlazarus --debug --pcp=bla)




>  If you use the same font, (and in normal, bold, italic) for Labels and/or
> StaticText, does it look correct there?

TLabel and TStaticText seems to work normally

>  Note, the spacing will be ok there, because neither of them forces the
> mono-spacing. But does it actually look like the expected Courier New, and
> is it truly monospaced?
Take a look at my attachments in my previous mail, to see for yourself
The normal_couriernew is how Courier New should look on my system.

Bart
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-05-01 Thread Martin Friebe

Bart wrote:

On 4/30/09, Martin Friebe  wrote:
  

It looks to me like it uses a different font. certainly it looks like it
 believes the font was proportional (that is why you get the odd spacing,
 because SynEdit forces it into a grid).

 The last font-related changes in synedit where in revision 185xx (so
 before your last good revision).

 Maybe you could put some debugln into Synedit.SizeOrFontChanged and see

 which font is really used? Otherwise I have no idea.



I can certainly do so, but in which unit is this method?
  
I have attached a patch with a few debugln in it. I don't know if they 
will show anything useful, since I have no idea what is going on.
If you apply it, you need to start lazarus with a logfile, to capture 
the output. (There is a command line switch, but I have to find it 
myself / I usually compile as none "window app", which means my Lazarus 
runs with a console-window showing all the output)


Also if you do this, test it with only one Synedit open. (You can 
compile a standalone app, with one SynEdit, and set the font from inside 
the app)



I wrote a small test program that has a synmemo and a memo
It sets the fonts of  both the memo and synmemo the same
and then queries their names etc and writes them in the editcontrols
below (see attachments)

In r18956 when setting the font (via fontdialog) to Courier New 10
point normal you see that the fonts look exactly the same in synmemo
and memo (normal_couriernew.png).
In r19705 they look very different indeed (bug_couriernew.png).
  

Memos are native controls, so they are drawn differently.

If you use the same font, (and in normal, bold, italic) for Labels 
and/or StaticText, does it look correct there?
Note, the spacing will be ok there, because neither of them forces the 
mono-spacing. But does it actually look like the expected Courier New, 
and is it truly monospaced?



So at least it looks like the synmemo thinks it's font is courier new...

  

 I haven't got  Win9x, so I can't test. On XP it looks fine.




I tested the compiled programs under XP and they behaved normally (and
absolutely the same): the courier new font looks OK and the same in
synmemo and memo.

So we have a win9x specific bug?
(Delphi with a tsynmemo and a tmemo behaves just fine on my win9x system)

Bart

Index: components/synedit/synedit.pp
===
--- components/synedit/synedit.pp   (revision 19726)
+++ components/synedit/synedit.pp   (working copy)
@@ -7529,6 +7529,7 @@
 // TODO: Clear style only, if Highlighter uses styles
 Style := [];// Reserved for Highlighter
   end;
+  debugln(['RecalcCharExtend for font name=', Font.Name, ' / ', 
fFontDummy.Name, ' mono=',fFontDummy.IsMonoSpace, ' 
Handle=',fFontDummy.Handle]);
   with fTextDrawer do begin
 //debugln('TCustomSynEdit.RecalcCharExtent A UseUTF8=',dbgs(UseUTF8),
 //  ' Font.CanUTF8='+dbgs(Font.CanUTF8)+' CharHeight=',dbgs(CharHeight));
Index: components/synedit/syntextdrawer.pp
===
--- components/synedit/syntextdrawer.pp (revision 19726)
+++ components/synedit/syntextdrawer.pp (working copy)
@@ -780,6 +780,10 @@
   // clear styles
   SetStyle(Value.Style);
 end;
+if pInfo<> nil then
+  debugln(['SetBasefont name=', Value.Name, '  basefont.name=', 
pInfo^.BaseFont.Name, ' Handle=',pInfo^.BaseFont.Handle])
+else
+  debugln(['SetBasefont name=', Value.Name, '  NO pinfo']);
   end
   else
 raise EheFontStockException.Create('SetBaseFont: ''Value'' must be 
specified.');
@@ -851,6 +855,7 @@
   SelectObject(DC, hOldFont);
   {$ENDIF}
   InternalReleaseDC(DC);
+  debugln(['SetStyle created font for idx=',idx, ' name=',p^.Font.Name, ' 
handle=',p^.Handle]);
 end;
 
 procedure TheFontStock.UseFontHandles;
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-05-01 Thread Mattias Gaertner
On Fri, 01 May 2009 10:48:19 +0200
Bernd Mueller  wrote:

>[...]
> The class TForm1 is mixed then. See attached screen shot.

Sorry. My fault. I fixed that an hour ago in svn r19726.

Mattias
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-05-01 Thread Bernd Mueller

Bart wrote:


Is this a bug, or is there something wrong with my system?


I can confirm the described behavior on my Windows 98 machine. But the 
problem seems to go deeper. If I put a Button on a Form, and double 
click the Button to let the IDE write the OnClick method, I get the 
error message:


"The component editor of class 'TDefaultComponentEditor' has created the 
error: 'Unable to find method. Please fix the error shown in the message 
window'."


The class TForm1 is mixed then. See attached screen shot.


Regards, Bernd.


<>___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-04-30 Thread Bart
On 4/30/09, Martin Friebe  wrote:

> It looks to me like it uses a different font. certainly it looks like it
>  believes the font was proportional (that is why you get the odd spacing,
>  because SynEdit forces it into a grid).
>
>  The last font-related changes in synedit where in revision 185xx (so
>  before your last good revision).

>  Maybe you could put some debugln into Synedit.SizeOrFontChanged and see
>  which font is really used? Otherwise I have no idea.

I can certainly do so, but in which unit is this method?

I wrote a small test program that has a synmemo and a memo
It sets the fonts of  both the memo and synmemo the same
and then queries their names etc and writes them in the editcontrols
below (see attachments)

In r18956 when setting the font (via fontdialog) to Courier New 10
point normal you see that the fonts look exactly the same in synmemo
and memo (normal_couriernew.png).
In r19705 they look very different indeed (bug_couriernew.png).

So at least it looks like the synmemo thinks it's font is courier new...

>
>  I haven't got  Win9x, so I can't test. On XP it looks fine.
>

I tested the compiled programs under XP and they behaved normally (and
absolutely the same): the courier new font looks OK and the same in
synmemo and memo.

So we have a win9x specific bug?
(Delphi with a tsynmemo and a tmemo behaves just fine on my win9x system)

Bart
Bart
<><>___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-04-30 Thread Martin Friebe
Bart wrote:
> Hi,
>
> I just upgraded my Lazarus from r18956 to r19705  on Win9x.
> When I started Lazarus the font in the code editor had become almost
> unreadable (too small, appr. 5 pt.)
>
> I tried to adjust the font in using the appropriate dialog, but I
> could not get it as it was before.
> I then copied the editoroptions.xml from what used to be my "stable"
> version and applied it to r19705, so I was sure they both used the
> same fonts.
>
> However the r19705 renders the chosen font very differently.
>   
It looks to me like it uses a different font. certainly it looks like it 
believes the font was proportional (that is why you get the odd spacing, 
because SynEdit forces it into a grid).

The last font-related changes in synedit where in revision 185xx (so 
before your last good revision).

I haven't got  Win9x, so I can't test. On XP it looks fine.

Maybe you could put some debugln into Synedit.SizeOrFontChanged and see 
which font is really used? Otherwise I have no idea.

Regards
Martin


> The "editor r18956.png" show how the editor font used to be,
> the "editor r19705.png" shows how it is rendered now.
>
> Here's the editoroptions.xml that both Lazarus' use:
>
> 
> 
>   
>  ExtraLineSpacing="0
> " ShowLineNumbers="False" ShowOnlyLineNumbersMultiplesOf="1"/>
> 
>   
> 
> 
>   
> 
> 
> 
>   
> 
> 
>   
> 
>
>
> The fontheight of -13 looks strange, but Lazarus puts this value in
> when I choose the font directly from the font-dialog.
> I've tried changing the font-size to diffrent values (10 to 18) but
> nothing comes even close to what it used to be.
> The font is either too big, or too small, or the kerning (the space
> between individual characters) is too large.
>
> B.t.w. Yesterday I upgraded my Lazarus on Linux (GTK2) to r19690 and I
> noticed no fonts changes at all.
>
> Is this a bug, or is there something wrong with my system?
>
> Bart
>   
>
> 
>
>
> 
>
> 
>
> ___
> Lazarus mailing list
> Lazarus@lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>   
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Editor font disturbed after upgrading to r19705

2009-04-30 Thread Bart
Hi,

I just upgraded my Lazarus from r18956 to r19705  on Win9x.
When I started Lazarus the font in the code editor had become almost
unreadable (too small, appr. 5 pt.)

I tried to adjust the font in using the appropriate dialog, but I
could not get it as it was before.
I then copied the editoroptions.xml from what used to be my "stable"
version and applied it to r19705, so I was sure they both used the
same fonts.

However the r19705 renders the chosen font very differently.

The "editor r18956.png" show how the editor font used to be,
the "editor r19705.png" shows how it is rendered now.

Here's the editoroptions.xml that both Lazarus' use:



  


  


  



  


  



The fontheight of -13 looks strange, but Lazarus puts this value in
when I choose the font directly from the font-dialog.
I've tried changing the font-size to diffrent values (10 to 18) but
nothing comes even close to what it used to be.
The font is either too big, or too small, or the kerning (the space
between individual characters) is too large.

B.t.w. Yesterday I upgraded my Lazarus on Linux (GTK2) to r19690 and I
noticed no fonts changes at all.

Is this a bug, or is there something wrong with my system?

Bart
<><>___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus