Sign in Join

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

Mailing lists / lazarus / 2000-01

[Re: cvs changes]

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Marc Weustink
to Michal Bukovjan: I still claim that switching to AllocMem removed lots of weird messages and the font…

+ From: Michal Bukovjan

+ I still claim that switching to AllocMem removed lots of
+ weird messages and the font displayed is now *CORRECT* -
+ this is what I see, so please if nothing changes for you,
+ don't change it back. I tried that and it only breaks the
+ font again.

Thats why I posted this message. I do see that somethings might not work on other systems. I only want to understand why, otherwise you are only fixing symptoms and not the real problem

+ I can also replace all appropriate Dispose calls with
+ FreeMem, to preserve the pairs, or maybe I could switch
+ back to New and zero the memory manually.

OK

+ About the HWND (HDC) = 0. Do you think the best way would be
+ to pregenerate a DC which would have correct properties
+ (for example in initialization part of gtkwinapi.pp unit)

I don't feel like creating a separate window for that, in fact we have it already, it's our desktop.

+ or should we handle the HDC = 0
I gues you mean HWND here

+ in each call like GetDC, SelectObject, etc. separately? I think so, only some functions wont support a DC from a hwdn=0

+ As for the resolution, this may be left from when I was
+ debugging and trying to figure out why the font displayed
+ is not like expected.

Ah, I thought so.

+ You are right and I will change it back to '*' if it is not
+ already done.

Or change it to '', since it is unused.

+ The reason I changed it is because you (or
+ the code :-) assumes that you are running at 120 dpi
+ resolution, which is not my case (I have 75).

The 120 was just a hack to get things running. I didn't have a PixelsPerInch at that moment. The only thin now in my case is that the font is drawn way to small. But thats I think a bug in my XServer (Xwin32 on a NT box with large fonts).

Marc

Reply by email

Michal Bukovjan

Marc,

I still claim that switching to AllocMem removed lots of weird messages and the font displayed is now *CORRECT* - this is what I see, so please if nothing changes for you, don't change it back. I tried that and it only breaks the font again.

I can also replace all appropriate Dispose calls with FreeMem, to preserve the pairs, or maybe I could switch back to New and zero the memory manually.

About the HWND (HDC) = 0. Do you think the best way would be to pregenerate a DC which would have correct properties (for example in initialization part of gtkwinapi.pp unit) or should we handle the HDC = 0 in each call like GetDC, SelectObject, etc. separately?

As for the resolution, this may be left from when I was debugging and trying to figure out why the font displayed is not like expected. You are right and I will change it back to '*' if it is not already done. The reason I changed it is because you (or the code :-) assumes that you are running at 120 dpi resolution, which is not my case (I have 75).

Michal Bukovjan

"Marc Weustink" wrote 37 lines
+ From: Michal Bukovjan + + New should also work, but it does not zero memory upon + allocation. This was causing all sorts of things, + instead of font of size 10 normal I was getting + font 14 italics, etc. + You could also see tons of messages like XLFD : could not find + courier-*-*-1254545465-14545412-* and other nonsense. + + As I changed it to AllocMem, fonts display OK and the error + messages about fonts mostly disappeared. It didn't change anything for me, I get still these messages. Second, the origin of these messages is not the memory being zeroed but the fact that GetFont doesn't return valid info on a DC with HWND=0. Thats a part that had a low priority to me so I didn't fix it yet. Another thing to keep in mind is that AllocMem/FreeMem and New/Despose should be used together. Since the rest of the API uses dispose, I prefer to use New instead of AllocMem Something else. I allso saw that you changed the pointsize and the resolution of the XLFD. As far as my docs go this shouldn't be done since we are using the font height (and not point size). If you're using font height the pointsize should be empty and a resolution should only be given if a pointsize is used. Do you have other sources of info ? Marc _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

____________________________________________________________________ Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com.

Reply by email

Michal Bukovjan

New should also work, but it does not zero memory upon allocation. This was causing all sorts of things, instead of font of size 10 normal I was getting font 14 italics, etc.

You could also see tons of messages like XLFD : could not find courier-*-*-1254545465-14545412-* and other nonsense.

As I changed it to AllocMem, fonts display OK and the error messages about fonts mostly disappeared.

The DeleteObject may still have some bugs.

I'll look at that further tonight.

Michal Bukovjan

Marc Weustink wrote 22 lines
At 21:36 17-01-2000 MET, Michal Bukovjan wrote: >I just commited some changes into the CVS. > >Began implementation of DeleteObject in GtkWinAPI. Great, that was something I still had to do but hadn't time for it. >Fixed a bug in GDIObject allocation. This in turn fixed a lot of weird >problems, and now the fonts display correctly/perfectly on my Linux :-))) ??? The only main difference I see is a AllocMem instead of a New. AFAIK the new should work allso (or is there something I don't know ?) Hmmm... It dumps here. I'll try to find why. Marc _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

____________________________________________________________________ Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com.

Reply by email