mIRC Home    About    Download    Register    News    Help

Print Thread
#239933 05/12/12 04:45 PM
Joined: Jul 2006
Posts: 4,020
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,020
When using drawtext -r, the color of the text isn't only the one specified, I'm not sure why but it seems to be a bug:

Code:
alias drawbug {
  window -pdCBf @a -1 -1 200 200
  drawrect -fr @a 16777215 0 0 0 200 200
  drawrect -er @a 0 1 0 0 200 200
  drawtext -r @a 0 verdana 15 80 80 mIRC
  .timer 1 1 drawfill -r @a 1234567 0 60 60
}
You can see when drawfilling with a black border that some pixels of the letters are not black since they are 'consumed'.

I'm using 7.27 on windows 7.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #239949 08/12/12 06:11 PM
Joined: Dec 2002
Posts: 3,840
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 3,840
This happens because the font you have specified is drawn using ClearType which uses anti-aliasing/transparency to smooth font borders. If you test this with a non-ClearType font, it works as expected. The Windows API command ExtFloodFill(), which is what mIRC uses to fill areas, does not handle transparency and I am not aware of any alternatives that do. You can see the same effect in reverse by using the -s switch for a surface fill:

Code:
.timer 1 1 drawfill -rs @a $rgb(255,0,0) $rgb(255,255,255) 40 40

Khaled #239954 09/12/12 04:49 PM
Joined: Jul 2006
Posts: 4,020
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,020
I understand but this is annoying, I shouldn't have to deal with this. Is there any way for you to disable the use of ClearType, or I just cannot draw a text in pure black with the font verdana?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #239961 11/12/12 11:22 AM
Joined: Dec 2002
Posts: 3,840
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 3,840
It should be possible to add a switch to the /drawtext command that disables ClearType, however it may not be as simple as that.

mIRC uses a standard method across all routine to create fonts using the default settings recommended for each font, eg. some fonts will be displayed using ClearType, whereas others will not - Windows decides this based on the font, the display, and so on. Fonts that are designed for ClearType may look far worse without it.

Adding support for the ClearType setting in /drawtext should allow you to /drawfill cleanly around the text (although /drawfill cannot fill in parts of the text that have closed loops - so it may not make sense using it in this context) but the resulting font may not be that readable without using some of the other Windows API CreateFont() options. Unfortunately it would be far too complicated to add support for all of those options.

In any case, I have added this to my to-do list.

Khaled #240004 15/12/12 02:23 AM
Joined: Jul 2006
Posts: 4,020
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,020
Ok, thanks for the answer.
May I ask why you added it to your todo list if you feel like it's complicated to add support for this?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #240010 15/12/12 01:32 PM
Joined: Dec 2002
Posts: 3,840
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 3,840
Adding support for all of the font options would be complicated - this is not the to-do list. Adding support for enabling/disabling ClearType should not be complicated - this is on the to-do list. However, even if I implement it, it may not make it to a final release. That depends on whether it works out the way I expect. I have probably spent hundreds of hours over the years implementing requested features that never made it into a final release because the result was not what I expected for one reason or another.

Khaled #240012 15/12/12 03:57 PM
Joined: Jul 2006
Posts: 4,020
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,020
Right, we would be glad to hear some news about feature you are working on, whether they are working or not etc wink


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard