mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 5
T
Talyn Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Feb 2003
Posts: 5
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...

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
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.

Last edited by qwerty; 10/02/03 07:08 PM.

/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Feb 2003
Posts: 5
T
Talyn Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Feb 2003
Posts: 5
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...


Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
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"


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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.


Spelling mistakes, grammatical errors, and stupid comments are intentional.

Link Copied to Clipboard