Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-04

Editor font disturbed after upgrading to r19705

16 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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:

<?xml version="1.0"?>
<CONFIG>
<EditorOptions Version="4">
<Display EditorFont="Courier New" EditorFontHeight="-13" ExtraLineSpacing="0 " ShowLineNumbers="False" ShowOnlyLineNumbersMultiplesOf="1"/> <Color>
<LangObjectPascal Version="4"/>
</Color>
<KeyMapping>
<default>
<Version Value="5"/>
<printselection Value="80,1,0,0,0,0,0,0"/>
<jcfcurrenteditorwindow Value="68,1,0,0,0,0,0,0"/> </default>
</KeyMapping>
<CodeTools CodeTemplateFileName="H:\PROGRAMMAS\SVNLAZ\lazarus.dci"/> </EditorOptions>
</CONFIG>

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 this a bug, or is there something wrong with my system?

Bart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: editor_r18956.png
Type: image/png
Size: 7511 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090430/b62b2200/attachment.png -------------- next part --------------
A non-text attachment was scrubbed...
Name: editor_r19705.png
Type: image/png
Size: 6157 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090430/b62b2200/attachment-0001.png

Reply by email

Martin Friebe
to Bart
Bart wrote 14 lines
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

Show quoted text 52 lines
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: <?xml version="1.0"?> <CONFIG> <EditorOptions Version="4"> <Display EditorFont="Courier New" EditorFontHeight="-13" ExtraLineSpacing="0 " ShowLineNumbers="False" ShowOnlyLineNumbersMultiplesOf="1"/> <Color> <LangObjectPascal Version="4"/> </Color> <KeyMapping> <default> <Version Value="5"/> <printselection Value="80,1,0,0,0,0,0,0"/> <jcfcurrenteditorwindow Value="68,1,0,0,0,0,0,0"/> </default> </KeyMapping> <CodeTools CodeTemplateFileName="H:\PROGRAMMAS\SVNLAZ\lazarus.dci"/> </EditorOptions> </CONFIG> 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 http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Bart
to Martin Friebe
Martin Friebe wrote 9 lines
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: normal_couriernew.png
Type: image/png
Size: 12283 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090430/c87534ce/attachment-0002.png -------------- next part --------------
A non-text attachment was scrubbed...
Name: bug_couriernew.png
Type: image/png
Size: 12574 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090430/c87534ce/attachment-0003.png

Reply by email

Bernd Mueller
to Bart: I just upgraded my Lazarus from r18956 to r19705 on Win9x. When I started Lazarus the…
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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ide.gif
Type: image/gif
Size: 6019 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090501/63cfc881/attachment.gif

Reply by email

Martin Friebe
to Bart: I can certainly do so, but in which unit is this method? I wrote a small test program…
Bart wrote 15 lines
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)

Show quoted text 10 lines
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?

Show quoted text 16 lines
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

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed... Name: fontinfo.patch
Url: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090501/018a2b1e/attachment.pl

Reply by email

Bart
to Martin Friebe
Martin Friebe wrote 9 lines
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

Reply by email

ajv
to Bart

I have a problem with file region locking under Linux. First I start setup to create a file and writelock range 10..30 -------------------------------------------------------------- program setup;

{$mode delphi}{$H+}
Uses    cthreads, Classes, SysUtils, BaseUnix;
Const   Fn      = '/home/anthony/test_lock';
        F_RDLCK = 0;
        F_WRLCK = 1;
        F_UNLCK = 2;
Var     F, I    : Integer;
        Region  : FLock;
Begin
   If FileExists (Fn) Then DeleteFile (Fn);
   F := FpOpen (Fn, O_RDWR Or O_CREAT, $1B6);                   // $1B6
= o666
   For I := 0 To 255 Do FpWrite (F, I, 1);                      //
Populate file
   With Region Do                                               // Set
WriteLock 10..30
   Begin
      l_type  := F_WRLCK; l_whence := SEEK_SET;
      l_start := 10;      l_len    := 20
   End;
   If FpFcntl (F, F_SETLK, Region) = -1 Then
      WriteLn ('unable to apply writelock');
   Sleep (20000);                                               // Sleep
20 Sec
   FpClose (F);
End.
--------------------------------------------------------------------------------------
Then within 20 seconds i start test to obtain a readlock on 80.
This fails. Why? What am I doing wrong?
--------------------------------------------------------------------------------------
program test;
{$mode delphi}{$H+}
Uses    cthreads, Classes, SysUtils, BaseUnix;
Const   Fn      = '/home/anthony/test_lock';
        F_RDLCK = 0;
        F_WRLCK = 1;
        F_UNLCK = 2;
Var     F, I    : Integer;
        Region  : FLock;
Begin
   F := FpOpen (Fn, O_RDWR Or O_CREAT, $1B6);                   // $1B6
= o666
   With Region Do                                               // Set
ReadLock on 80
   Begin
      l_type  := F_RDLCK; l_whence := SEEK_SET;
      l_start := 80;      l_len    := 1
   End;
   If FpFcntl (F, F_SETLK, Region) = -1 Then
      WriteLn ('unable to apply readlock on 80');
   FpClose (F);
End.
------------------------------------------------------------------------------------
Thanks

Reply by email

Martin Friebe
to Bart: I applied the changes in sysnedit.pp and syneditextdrawer.pp then did a make clean all…
Bart wrote 18 lines
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.

Show quoted text 17 lines
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

Show quoted text 20 lines
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

Reply by email

Paul Ishenin
to Bernd Mueller
Bernd Mueller wrote 8 lines
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.

Reply by email

Bart
to Paul Ishenin
Paul Ishenin wrote 16 lines
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

Reply by email