mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2012
Posts: 299
Epic Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jan 2012
Posts: 299
My client: mIRC v7.63. My system: Windows 8.1. I seem to have encountered an error while creating the script.

In "View/Font" me have the font installed "Comic Sans MS" with style "bold" and with size "11". But when I look at the properties of the active window, it shows me the font size as "15".

When setting the font "Comic Sans MS" with style "regular" and with size "10" property shows the font size as "13".

Code
//echo -a $window($active).font - $window($active).fontsize

This makes it difficult to get the exact font size in the active window to duplicate those sizes and settings in another window in my script. Maybe I'm doing something wrong.


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Yes, this can be confusing. See https://forums.mirc.com/ubbthreads.php/topics/260579/bug-setting-getting-font-sizes-in-custom

The ratio between the 2 numbers is 4/3, but I'm not sure how fractions are handled.

Joined: Jan 2012
Posts: 299
Epic Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jan 2012
Posts: 299
I still don't understand how I can get the exact size of the font set to in "View/Font" or for the active window.

If the size is set to "11", then I need to get the value "11", not "15". Because (15 != 11) and because of this I will have a different font size whereas I need to duplicate the same value when creating a new window.

If can still somehow solve this problem in order to extract the exact font size, then please give an example in the form of code.


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
Font sizes in mIRC appear to always be integer.

So the following will show the font size in points:

Code
//echo -a $window($active).font - $round($calc($window($active).fontsize * 3 / 4),0)

Joined: Jan 2012
Posts: 299
Epic Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jan 2012
Posts: 299
Thanks for the help! That helped. Although it would be much more convenient to extract the exact font size without such tricky calculations. But thanks anyway.


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
You could ask Khaled to implement $window().fontpoints to give the font size in points.

I am assuming that the ratio between fontsize and points is always fixed at 3:4.


Link Copied to Clipboard