[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Miniwindows
. . -> [Subject]  0x000000 & 0xFFFFFF
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

0x000000 & 0xFFFFFF

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Lvmwrah   (3 posts)  [Biography] bio
Date Mon 06 Apr 2009 03:47 PM (UTC)

Amended on Mon 06 Apr 2009 06:29 PM (UTC) by Lvmwrah

Message
I'm getting an issue when I try to make a miniwindow with a black background and display white text.

First, black on white:
http://img512.imageshack.us/img512/7153/ss1.png
Looks just fine.

White on black, though:
http://img512.imageshack.us/img512/6857/ss2.png
Does not.

The following is what I use. Note, there's still comments from the help in this thing. All this is new to me, but I'm still not seeing why this is happening.

http://pastebin.com/d1b1390c

Between the two pictures, all I'm doing is switching around the color codes.

[Edit]

Playing around with this a lot, it seems the odd warping only happens with certain fonts with any light colored text on dark backgrounds. This happens with Tahoma, Courier, or Arial. It doesn't happen with Fixedsys or System. Something about shading/blending just makes thin fonts appear wonky?
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #1 on Mon 06 Apr 2009 06:45 PM (UTC)
Message
What exactly is the issue you're seeing? What are you expecting to see but aren't?

If you are referring to the very slight color artifacts around the white-on-black text, you're probably seeing the effects of ClearText font smoothing, which isn't controlled by MUSHclient.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Lvmwrah   (3 posts)  [Biography] bio
Date Reply #2 on Mon 06 Apr 2009 07:01 PM (UTC)
Message
http://img206.imageshack.us/img206/8927/ss3.png

The top is what happens when I try to write text in a mini window.

The bottom is what happens when I use ColourNote in the regular output portion of the world's window. It's how I want the text to appear.

If it's something out of the client's hands, then oh well.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #3 on Mon 06 Apr 2009 08:52 PM (UTC)
Message
Sorry, you're going to have to be a little more specific; maybe other people are clearly seeing the difference but I'm not. Please say in words what it is that you're expecting to see but aren't. I'm guessing that you're not worried about the fact that the "NO" shows up in one but not the other. (It would be helpful if your pictures reproduced the exact same circumstances.)

If it might be caused by cleartext, just try turning that off and see if you're satisfied.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Mon 06 Apr 2009 11:02 PM (UTC)
Message
I can see what you mean alright, and I can reproduce it here. The miniwindow text seems blurred, compared to the output window, using the same font and colour.

That was with Cleartype turned off - with it on, they both seemed the same to me, however that "same" was a bit hard on the eyes.

I'll have to look into that - I thought the text was rendered with the same OS call (ExtTextOut) - and after looking, it is. However there is one difference.

One uses ETO_CLIPPED to clip the resulting output to a rectangle and one doesn't. However a quick test shows changing that makes no difference. There must be some subtle difference to the way the fonts are created - I'll look into it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Mon 06 Apr 2009 11:11 PM (UTC)

Amended on Tue 07 Apr 2009 01:26 AM (UTC) by Nick Gammon

Message
Ah OK, I found it! :-)

Your code was:


WindowCreate ("WinDef", 
              660, 0, 584, 100,
              1,    -----> problem is here
              2,
              0x000000)
                 
WindowFont ("WinDef", "cour", "Courier New", 10, false, false, false, false, 0, 0)

WindowShow ("WinDef",  true)

local line = 0

WindowText ("WinDef", "cour", 
                "-- Defences -------------------------------------------------------------",
                0, line, 0, 0,
                0xFFFFFF,
                false)
local line = line + 18

WindowText ("WinDef", "cour", 
                "¬ NO Lightshield ¬ NO Mindnet  · NO Blind    £ NO Frost      ¤ NO Sileris",
                0, line, 0, 0,        -- rectangle
                0xFFFFFF, -- colour
                false)              -- not Unicode
local line = line + 18

WindowText ("WinDef", "cour", 
                "¬ NO Discharge   ¬ NO Deatheye · Deaf        £ NO Speed      ¤ NO Caloric",
                0, line, 0, 0,        -- rectangle
                0xFFFFFF, -- colour
                false)              -- not Unicode
local line = line + 18

WindowText ("WinDef", "cour", 
                "¬ NO Cloak       ¬ NO Thirdeye · NO Kola     £ NO Levitation ¤ NO Mass",
                0, line, 0, 0,        -- rectangle
                0xFFFFFF, -- colour
                false)              -- not Unicode
local line = line + 18

  
font_height = WindowFontInfo ("WinDef", "cour", 1)
font_width1 = WindowTextWidth ("WinDef", "cour", "H:100% M: 98% E:100% W: 99% S: 88% X:82.25% <eb lr>                        PRONE")
font_width2 = WindowTextWidth ("WinDef", "cour", "ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp")

world.Note ("Font Height = "..font_height)
world.Note ("Font Width1 = "..font_width1)
world.Note ("Font Width2 = "..font_width2)



Your position code for WindowCreate is 1:


Position - a number indicating where you want the window positioned on the screen. Whenever the screen is resized or redrawn the contents of the window are drawn in the requested position:

0 = strech to output view size
1 = stretch with aspect ratio
2 = strech to owner size


This caused MUSHclient to copy the miniwindow to the output window in such a way that it created the artifact you see. Since you are using absolute positioning anyway, the problem goes away if you use another position flag (that doesn't stretch), like 4.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #6 on Tue 07 Apr 2009 03:07 AM (UTC)
Message
That's funny, with my monitor at work the distortion wasn't bad at all (in fact as you can see I hardly noticed it) but at home, it's a lot worse.

I wonder if that has to do with the RGB pixel ordering on the flat panel monitors: I know that text rendered with one pixel ordering to a monitor with a different pixel ordering can look bad.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Lvmwrah   (3 posts)  [Biography] bio
Date Reply #7 on Tue 07 Apr 2009 03:27 AM (UTC)

Amended on Tue 07 Apr 2009 03:40 AM (UTC) by Lvmwrah

Message
Thank you! No issue now.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #8 on Tue 07 Apr 2009 05:49 PM (UTC)
Message
This is so weird... I'm back at work again and I swear the two lines look almost the same, nothing like the difference I saw from home. Strange...

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


5,671 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]