From WikiChip
Difference between revisions of "mirc/identifiers/$width"
(Created page with "{{mirc title|$width Identifier}}'''$width''' returns the width of text in pixel in the specified font. == Synopsis == <pre>$width(text,font,size,B,C)</pre> == Parameters ==...") |
(→See Also) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
== Synopsis == | == Synopsis == | ||
− | <pre>$width(text,font,size, | + | <pre>$width(text,font,size,bNiNpNtN)</pre> |
== Parameters == | == Parameters == | ||
Line 9: | Line 9: | ||
* '''font''' - The name of the font | * '''font''' - The name of the font | ||
* '''size''' - The size of the font, you can specify a negative value to match the size of fonts in the font dialog | * '''size''' - The size of the font, you can specify a negative value to match the size of fonts in the font dialog | ||
− | * ''' | + | |
− | * ''' | + | Before, there was a 4th 5th and even a 6th true/false parameters (bold, italic, and control code processing), to set some custom measurements, it was changed to a single 4th parameter when tab processing were added: |
+ | |||
+ | * '''bNiNpNtN''' - Optional, defines some options for the measurement, N can be 1 or 0 to enable or disable the option: | ||
+ | ** '''bN''' enables/disables bold | ||
+ | ** '''iN''' enables/disables italic | ||
+ | ** '''pN''' enables/disables control code (-bi not needed there) | ||
+ | ** '''tN''' enables/disables tab character | ||
== Properties == | == Properties == | ||
Line 23: | Line 29: | ||
== See Also == | == See Also == | ||
{{mIRC|$height}} | {{mIRC|$height}} | ||
+ | {{mIRC|$wrap}} | ||
[[Category:mIRC identifiers]] | [[Category:mIRC identifiers]] |
Latest revision as of 19:44, 22 January 2022
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
$width returns the width of text in pixel in the specified font.
Synopsis[edit]
$width(text,font,size,bNiNpNtN)
Parameters[edit]
- text - The text you want the width of
- font - The name of the font
- size - The size of the font, you can specify a negative value to match the size of fonts in the font dialog
Before, there was a 4th 5th and even a 6th true/false parameters (bold, italic, and control code processing), to set some custom measurements, it was changed to a single 4th parameter when tab processing were added:
- bNiNpNtN - Optional, defines some options for the measurement, N can be 1 or 0 to enable or disable the option:
- bN enables/disables bold
- iN enables/disables italic
- pN enables/disables control code (-bi not needed there)
- tN enables/disables tab character
Properties[edit]
None
Example[edit]
//echo -a $width(test,verdana,15)
Compatibility[edit]
Added: mIRC v5.31
Added on: 04 Jan 1998
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.