mIRC Homepage
Posted By: Talyn $cnick and $window().fontsize - 09/02/03 05:23 PM
I've noticed that $cnick will no longer work unless you are on a channel. It used to work correctly in previous versions, there's no need to be on a channel if you're only listing information stored in the nick coloring section of the address book (mirc.ini,cnicks).

Also $window(whatever).fontsize does not return the correct fontsize...

Not sure if these have been brought up already, but I didn't see them on the 3 pages that are currently available...
Posted By: qwerty Re: $cnick and $window().fontsize - 10/02/03 07:00 PM
Regarding $window().fontsize, it is not a bug. It's just that the font size value displayed in the Font dialog does not match the value used in mirc commands. mirc however allows you to use values as those in the Font dialog, by specifying a negative number.

For example: type /font in the status window and, in the dialog that pops up, select Fixedsys with size 9. Then check $window(status window).fontsize. It returns 12. Now type /font -s 12 Fixedsys. You'll notice that the font does not change. This means that the 12 is translated to 9 in the Font dialog. Now if you type /font -s -9 Fixedsys, you'll see again that the font doesn't change. So /font -s -9 Fixedsys and /font -s 12 Fixedsys are equivalent. You can easily make an alias that converts a Font dialog value to a mirc value (the opposite is not directly possible, so one would have to make a little loop).
Code:
fontconv window -h @@ | font @@ $2 $+(",$remove($1,"),") | var %a = $window(@@).fontsize | window -c @@ | return %a

Usage: $fontconv(fontname,fontsize), where fontsize would be a negative number.

Edit: it seems that the /window command itself does not support negative numbers :tongue: (or it doesn't do it properly, I don't know and don't have the time to check it thoroughly) so I had to change the script a bit.
Posted By: Talyn Re: $cnick and $window().fontsize - 10/02/03 10:29 PM
Not sure what that code was supposed to do, but all it did was return the exact same fontsize I gave it to start with.

I fail to see the point of $window(whatever).fontsize not returning the font settings value...

Posted By: qwerty Re: $cnick and $window().fontsize - 11/02/03 05:17 AM
Sorry if it wasn't clear, the alias accepts a negative font size and returns a positive one, ie converts a Font dialog value to a mirc value.

Example: $fontconv(Fixedsys,-9) returns "12"
Posted By: starbucks_mafia Re: $cnick and $window().fontsize - 11/02/03 08:52 PM
In other words it converts points (measurement used in the Font Dialog) to pixels (measurement returned by $window().fontsize).

Still, a .ptfontsize property for $window() wouldn't hurt.
© mIRC Discussion Forums