Bart wrote:
On 4/30/09, Martin Friebe <laza...@mfriebe.de> 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